通达信MACD和KDJ同显指标公式

SHORT:=12;
LONG:=26;
MID:=9;
M:=3;
WXS:=(LONG-SHORT)/2;{系数}
JGL_DF:=WXS*(EMA(CLOSE,SHORT)-REF(EMA(CLOSE,SHORT),1));{微分}
DIF_J:EMA(JGL_DF,LONG),COLOR1234AA,LINETHICK2;{积分}
DEA_G:EMA(DIF_J,MID),COLOR338833,LINETHICK2;{平滑}
MACD_L:(DIF_J-DEA_G)*2,COLORA9A813,COLORSTICK;
K_DF:SMA(JGL_DF,M,1)*1,COLORFEDCBA;{以下为“类KDJ”}
D_DF:SMA(K_DF,M,1),COLOR13F8F9;
J_DF:3*K_DF-2*D_DF,COLORF813F9;
{以下显示“J_DF前差值柱”,柱子太薄时显示“十”字星}
RF:=REF(J_DF,1);
DJ:=ABS(J_DF-RF);
MM:=(HHV(DJ,240)+LLV(DJ,240))/2;
STICKLINE(J_DF>RF,J_DF,RF,2.3,0),COLOR1388D3;
STICKLINE(J_DF>RF,J_DF,RF,1.0,0),COLOR13AAD3;
STICKLINE(J_DF<RF,J_DF,RF,2.3,0),COLOR338833;
STICKLINE(J_DF<RF,J_DF,RF,1.0,0),COLOR33AA33;
STICKLINE(J_DF<RF AND DJ<0.2*MM,J_DF-0.1*MM,RF+0.1*MM,0.1,0),COLOR33AA33;
STICKLINE(J_DF>=RF AND DJ<0.2*MM,J_DF+0.1*MM,RF-0.1*MM,0.1,0),COLOR13AADD;

(0)

相关推荐