通达信MACD和KDJ同显指标公式
2021/6/1 18:40:44
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;
投股票 网 ww w.tou18.cn
[源码翻译]通达信软件动态翻译的结果
SHORT赋值:12
LONG赋值:26
MID赋值:9
M赋值:3
WXS赋值:(LONG-SHORT)/2
JGL_DF赋值:WXS*(收盘价的SHORT日指数移动平均-1日前的收盘价的SHORT日指数移动平均)
输出DIF_J:JGL_DF的LONG日指数移动平均,COLOR1234AA,线宽为2
输出DEA_G:DIF_J的MID日指数移动平均,COLOR338833,线宽为2
输出MACD_L:(DIF_J-DEA_G)*2,COLORA9A813,COLORSTICK
输出K_DF:JGL_DF的M日[1日权重]移动平均*1,COLORFEDCBA
输出D_DF:K_DF的M日[1日权重]移动平均,COLOR13F8F9
输出J_DF:3*K_DF-2*D_DF,COLORF813F9
RF赋值:1日前的J_DF
DJ赋值:J_DF-RF的绝对值
MM赋值:(240日内DJ的最高值+240日内DJ的最低值)/2
当满足条件J_DF>RF时,在J_DF和RF位置之间画柱状线,宽度为2.3,0不为0则画空心柱.,COLOR1388D3
当满足条件J_DF>RF时,在J_DF和RF位置之间画柱状线,宽度为1.0,0不为0则画空心柱.,COLOR13AAD3
当满足条件J_DF<RF时,在J_DF和RF位置之间画柱状线,宽度为2.3,0不为0则画空心柱.,COLOR338833
当满足条件J_DF<RF时,在J_DF和RF位置之间画柱状线,宽度为1.0,0不为0则画空心柱.,COLOR33AA33
当满足条件J_DF<RFANDDJ<0.2*MM时,在J_DF-0.1*MM和RF+0.1*MM位置之间画柱状线,宽度为0.1,0不为0则画空心柱.,COLOR33AA33
当满足条件J_DF>=RFANDDJ<0.2*MM时,在J_DF+0.1*MM和RF-0.1*MM位置之间画柱状线,宽度为0.1,0不为0则画空心柱.,COLOR13AADD
股市公式下载推荐