KDJ叠加在MACD上面副图指标
上中下虚线分别是KDJ的100,50,0轴
假KDJ是压缩了的数值, 真KDJ是真实的数值
公式源码
{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;
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;
{}
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;