通达信KDJ叠加MACD副图指标 源码 贴图
{SHUHONG_2017-10-4};
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;{KDJ的0轴}
AA3:=(0+AA1)+(0-AA2);{公式网WWW.GPXIAZAI.COM}
AA4:REFDATE((AA1+AA2)/2,DATE)COLORGRAY,DOTLINE;{KDJ的50轴}
{AB1:REFDATE(((0+AA1)+(0-AA4))*3/5+AA4,DATE)COLORLIRED,DOTLINE;}{KDJ的80轴}
{AB2:REFDATE(((0+AA2)+(0-AA4))*3/5+AA4,DATE)COLORLIRED,DOTLINE;}{KDJ的20轴}
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;
|