通达信MACD叠加KDJ指标公式

DRAWGBK(C>0, RGB(1,1,1),RGB(20,20,20),0,'0',0);

NOTEXT0:0,COLORRED;

DIF:EMA(CLOSE,12)-EMA(CLOSE,26)COLORWHITE,NODRAW;

DEA:EMA(DIF,9)COLORYELLOW,NODRAW;

DRAWBAND(DIF,RGB(150,30,80),DEA,RGB(0,100,0));

MACD:(DIF-DEA)*2,COLORCYAN,COLORSTICK;

AX1:=MAX(MAX(DIF,DEA),MACD);

AX2:=MIN(MIN(DIF,DEA),MACD);

AA1:REFDATE(HHV(AX1,120),DATE)COLORGRAY,DOTLINE;{KDJ的100轴}

AA2:REFDATE(LLV(AX2,120),DATE)COLORGRAY,DOTLINE;

AA3:=(0+AA1)+(0-AA2);

AA4:REFDATE((AA1+AA2)/2,DATE)COLORGRAY,DOTLINE;

RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*AA3;

假K:SMA(RSV,3,1)+AA2,COLORWHITE;

假D:SMA(SMA(RSV,3,1)+AA2,3,1),COLORYELLOW;

假J:(3*SMA(RSV,3,1)-2*SMA(SMA(RSV,3,1),3,1))+AA2,COLORMAGENTA;

DRAWTEXT(ISLASTBAR,AA1,' 100')COLORGRAY;

DRAWTEXT(ISLASTBAR,AA2,' 0')COLORGRAY;

DRAWTEXT(ISLASTBAR,AA4,' 50')COLORGRAY;

ZRSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;

真K:SMA(ZRSV,3,1)COLORCYAN,NODRAW;

真D:SMA(真K,3,1)COLORBROWN,NODRAW;

真J:3*真K-2*真D,COLORLIRED,NODRAW;

DRAWTEXT_FIX(ISLASTBAR,0.01,0.02,0,'灰色虚线分别是KDJ的100,50,0轴')COLORYELLOW;

(0)

相关推荐