以下是通达信三背离主图指标公式
A:=MA(CLOSE,17)+ABS(MA(CLOSE,17)-REF(MA(CLOSE,17),1));
B:=MA(CLOSE,17)+MA(CLOSE,17)-REF(MA(CLOSE,17),1);
分水岭:IF(MA(CLOSE,17)<B,B,MA(CLOSE,17)),COLORYELLOW,LINETHICK2;
操作线:分水岭-(EMA(C,3)-分水岭),COLORGREEN,LINETHICK2;
PM:MA(C,5),COLORWHITE,LINETHICK2;
IF(PM>REF(PM,1),PM,DRAWNULL),COLORRED,LINETHICK2;
IF(PM=REF(PM,1),PM,DRAWNULL),COLORRED;
IF(PM<REF(PM,1),PM,DRAWNULL),COLORFF9900,LINETHICK2;
S:=(PM>操作线);
DD:=分水岭<REF(分水岭,1);
IF(DD,分水岭,DRAWNULL),COLORYELLOW,LINETHICK2;
IF(S,分水岭,DRAWNULL),COLORYELLOW,POINTDOT,LINETHICK4;
DRAWICON(CROSS(分水岭,操作线),分水岭-0.1,1);{买入红箭头}
A1:=BARSLAST(REF(CROSS(“MACD.DIF”,”MACD.DEA” >
A:=MA(CLOSE,17)+ABS(MA(CLOSE,17)-REF(MA(CLOSE,17),1));
B:=MA(CLOSE,17)+MA(CLOSE,17)-REF(MA(CLOSE,17),1);
分水岭:IF(MA(CLOSE,17)<B,B,MA(CLOSE,17)),COLORYELLOW,LINETHICK2;
操作线:分水岭-(EMA(C,3)-分水岭),COLORGREEN,LINETHICK2;
PM:MA(C,5),COLORWHITE,LINETHICK2;
IF(PM>REF(PM,1),PM,DRAWNULL),COLORRED,LINETHICK2;
IF(PM=REF(PM,1),PM,DRAWNULL),COLORRED;
IF(PM<REF(PM,1),PM,DRAWNULL),COLORFF9900,LINETHICK2;
S:=(PM>操作线);
DD:=分水岭<REF(分水岭,1);
IF(DD,分水岭,DRAWNULL),COLORYELLOW,LINETHICK2;
IF(S,分水岭,DRAWNULL),COLORYELLOW,POINTDOT,LINETHICK4;
DRAWICON(CROSS(分水岭,操作线),分水岭-0.1,1);{买入红箭头}
A1:=BARSLAST(REF(CROSS(“MACD.DIF”,”MACD.DEA”),1));
B1:=REF(C,A1+1)>C AND REF(“MACD.DIF”,A1+1)<“MACD.DIF” AND CROSS(“MACD.DIF”,”MACD.DEA”);
DRAWTEXT(B1>0,L-0.02,’★M’),COLOR00FFFF;{MACD底背离}
A2:=BARSLAST(REF(CROSS(“KDJ.K”,”KDJ.D”),1));
B2:=REF(C,A2+1)>C AND REF(“KDJ.K”,A2+1)<“KDJ.K” AND CROSS(“KDJ.K”,”KDJ.D”);
DRAWTEXT(B2,L-0.10,’◎K’),COLORFF00FF;{KDJ底背离}
A3:=BARSLAST(REF(CROSS(“RSI.RSI1″,”RSI.RSI2”),1));
B3:=REF(C,A3+1)>C AND REF(“RSI.RSI1”,A3+1)<“RSI.RSI1” AND CROSS(“RSI.RSI1″,”RSI.RSI2”);
DRAWTEXT(B3>0,L-0.18,’◆R’),COLOR0000FF;{RSI底背离}
C1:=BARSLAST(REF(CROSS(“MACD.DEA”,”MACD.DIF”),1));
D1:=REF(C,C1+1)<C AND REF(“MACD.DIF”,C1+1)>”MACD.DIF” AND CROSS(“MACD.DEA”,”MACD.DIF”);
DRAWTEXT(D1>0,H+0.16,’★M’),COLOR00FF00;{MACD顶背离}
C2:=BARSLAST(REF(CROSS(“KDJ.D”,”KDJ.K”),1));
D2:=REF(C,C2+1)<C AND REF(“KDJ.K”,C2+1)>”KDJ.K” AND CROSS(“KDJ.D”,”KDJ.K”);
DRAWTEXT(D2>0,H+0.08,’◎K’),COLORFFFFCC;{KDJ顶背离}
C3:=BARSLAST(REF(CROSS(“RSI.RSI2″,”RSI.RSI1”),1));
D3:=REF(C,C3+1)<C AND REF(“RSI.RSI1″,C3+1)>”RSI.RSI1” AND CROSS(“RSI.RSI2″,”RSI.RSI1”);
DRAWTEXT(D3>0,H+0.04,’◆R’),COLORFF9900;{RSI顶背离};
A1A:=EMA(CLOSE, 9);
A1B:=((A1A – EMA(CLOSE, 5)) < 0);
A1C:=((A1A – EMA(CLOSE, 5)) > 0);
A1D:=BARSLAST(A1B);
A1E:=BARSLAST(A1C);
A1F:=IF((A1E > 0),(CLOSE – REF(CLOSE, 1)) / REF(CLOSE, 1) * 100,0);
A20:=SUM(A1F,0);
A21:=IF((A1D > 0),(0 – 2),0);
A25:=EMA(EMA(EMA(CLOSE, 3), 3), 3);
多方:=((A25 – REF(A25, 1)) + A25)COLOR0000FF,LINETHICK2;
空方:=MA(多方, 15)COLORFF49FF;
DRAWTEXT(CROSS(多方,空方),空方 * 0.99,’↑买’)COLOR0000FF;
DRAWICON(((REF(A21, 1) = (0 – 2)) AND (A21 = 0)),LOW, 5);
AAA:=(3*C+H+L+O)/6;
短线:=(8*AAA+7*REF(AAA,1)+6*REF(AAA,2)+5*REF(AAA,3)+4*REF(AAA,4)+3*REF(AAA,5)+2*REF(AAA,6)+REF(AAA,8))/36,COLORRED,LINETHICK2;
中线:=MA(MA(C,18),5),LINETHICK1;
DRAWICON(REF(C,1)<中线 AND C>中线,L*0.98,5);
EMA13:=EMA(C,13),COLORWHITE;
EMA21:=EMA(C,21),COLORYELLOW;
EMA34:=EMA(C,34),COLORFF00FF;
EMA60:=MA(C,60),COLORFFCC66;
VAR200:=(2*CLOSE+HIGH+LOW)/4;
VAR300:=IF(YEAR>=2099 AND MONTH>2,0,1);
VAR400:=LLV(LOW,5); VAR500:=HHV(HIGH,4);
散户:=EMA((VAR200-VAR400)/(VAR500-VAR400)*100,4)*VAR300;
庄家:=EMA(0.667*REF(散户,1)+0.333*散户,2)*VAR300;
DRAWTEXT(VOL=HHV(VOL,20),C ,’————————————————————‘),COLOR808080;
DRAWTEXT(CROSS(散户,庄家) AND 散户<30,L-0.05,’←低吸’),COLORLIRED;
DRAWTEXT(CROSS(庄家,散户) AND 散户>70,H+0.05,’←高抛’),COLORGREEN;
DRAWICON(CROSS(散户,庄家) AND 散户<30,L-0.05,1);
DRAWICON(CROSS(庄家,散户) AND 散户>70,H+0.05,2);
VAR900:=CLOSE-REF(CLOSE,5);
VARA00:=EMA(EMA(VAR900,5),5)/EMA(EMA(ABS(VAR900),5),5);
VARC00:=EMA(EMA(VAR900,20),20)/EMA(EMA(ABS(VAR900),20),20);
卖出:=IF(VARA00>0 AND CROSS(VARC00,VARA00),90,100);
DRAWICON(卖出<0,H+0.05,2); 买线:=EMA(CLOSE,2);
卖线:=EMA(SLOPE(CLOSE,21)*20+CLOSE,42);
B1Q:IF(CROSS(买线,卖线),L-0.02,DRAWNULL),CROSSDOT,LINETHICK3,COLORMAGENTA;
S1:IF(CROSS(80,RSI)*30,H+0.02,DRAWNULL),CROSSDOT,LINETHICK3,COLORYELLOW;
VC:=((CLOSE-MA(CLOSE,6))/MA(CLOSE,6)*100+(CLOSE-MA(CLOSE,24))/MA(CLOSE,24)*100+(CLOSE-MA (CLOSE,32))/MA(CLOSE,32)*100)/3;
S2:=IF(VC>20 AND FILTER(VC< REF(VC,1),5),H+0.02,DRAWNULL),CIRCLEDOT,LINETHICK3,COLORGREEN;
VAR1:=CLOSE>REF(CLOSE,1) AND CLOSE>REF(CLOSE,2);
VAR2:=REF(VAR1,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR3:=REF(VAR2,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VAR4:=REF(VAR3,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR5:=REF(VAR4,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VAR6:=REF(VAR5,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR7:=REF(VAR6,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VAR8:=REF(VAR7,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR9:=REF(VAR8,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VARA:=REF(VAR9,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VARB:=REF(VARA,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VARC:=REF(VARB,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VARD:=CLOSE<REF(CLOSE,1) AND CLOSE<REF(CLOSE,2);
VARE:=REF(VARD,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VARF:=REF(VARE,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR10:=REF(VARF,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VAR11:=REF(VAR10,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR12:=REF(VAR11,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VAR13:=REF(VAR12,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR14:=REF(VAR13,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VAR15:=REF(VAR14,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR16:=REF(VAR15,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VAR17:=REF(VAR16,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR18:=REF(VAR17,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VAR19:=REF(VARD OR VARE OR VARF OR VAR10 OR VAR11 OR VAR12 OR VAR13 OR
VAR14 OR VAR15 OR VAR16 OR VAR17 OR VAR18,1) AND VAR1;
VAR1A:=REF(VAR1 OR VAR2 OR VAR3 OR VAR4 OR VAR5 OR VAR6 OR VAR7 OR
VAR8 OR VAR9 OR VARA OR VARB OR VARC,1) AND VARD;
DRAWTEXT(FILTER(VAR19=1,5),LOW,’ ‘),COLORFF00FF;
DRAWICON(FILTER(VAR19=1,5),LOW,9);
DRAWTEXT(FILTER(VAR1A=1,5),HIGH,’ ‘),COLOR00FF00;
DRAWICON(FILTER(VAR1A=1,5),HIGH,15);
BL:=VOL>=REF(V,1)*1.91 AND C>REF(C,1)*1.01;
DRAWTEXT(FILTER(BL,3),(LOW * 0.97),’倍量’)COLORYELLOW;
评论(0)