通达信操盘线副图源码
DIFW:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEAW:=EMA(DIFW,9);
MACDW:=(DIF-DEA)*2,COLORSTICK;
W1:STICKLINE(MACDW>0,MACDW,0,2,1),COLORRED;
W2:STICKLINE(MACDW<0,MACDW,0,2,0),COLORCYAN;
VA1:=HHVBARS(MACDW,BARSLAST(MACDW<0)+1);
VA2:=CROSS(BACKSET(CROSS(0,MACDW) OR (ISLASTBAR AND MACDW>0),REF(VA1,1)+2),0.5);
前高:DRAWLINE(VA2,MACDW,REF(VA2,1),REF(MACDW,1),1),COLORWHITE;
VA3:=LLVBARS(MACDW,BARSLAST(MACDW>0)+1);
VA4:=CROSS(BACKSET(CROSS(MACDW,0) OR (ISLASTBAR AND MACDW<0),REF(VA3,1)+2),0.5);
前低:DRAWLINE(VA4,MACDW,REF(VA4,1),REF(MACD,1),1),COLORYELLOW;
W3:STICKLINE(MACDW>0 AND MACDW>前高 AND 前高>0,MACDW,前高,2,0),COLORYELLOW;
W4:STICKLINE(MACDW<0 AND MACDW<前低 AND 前低<0,MACDW,前低,2,0),COLORGREEN;
W5:DRAWTEXT(REFX(VA2,1),0,'点'),COLORWHITE;
W6:DRAWTEXT(REFX(VA2,1),MACDW/2,'界'),COLORWHITE;
W7:DRAWTEXT(REFX(VA2,1),MACDW,'临'),COLORWHITE;
W8:DRAWTEXT(REFX(VA4,1),0,'临'),COLORRED;
W9:DRAWTEXT(REFX(VA4,1),MACDW/2,'界'),COLORRED;
W10:DRAWTEXT(REFX(VA4,1),MACDW,'点'),COLORRED;
195822689.png
|