外国MACD通达信公式 源码 K线图
P:=13;S:=5;M:=1;
DIFF:=EMA(C,S)-EMA(C,P);
DEA:=EMA(DIFF,M),COLORRED;
MACD:=2*(DIFF-DEA),COLORSTICK;
P1:=P;S1:=S;
DIFF1:=EMA(C,S1)-EMA(C,P1);
DEA1:=EMA(DIFF,M),COLORRED;
MACD1:=2*(DIFF1-DEA1),COLORSTICK;
MACD2:=DEA;{股票指标网www88gscom}
STICKLINE(MACD2<=REF(MACD2,1)AND MACD2>0,0,MACD2,3,0 ),COLOR00AAFF;
STICKLINE(MACD2<=REF(MACD2,1)AND MACD2>0,0,MACD2,1.8,0 ),COLOR00BBFF;
STICKLINE(MACD2<=REF(MACD2,1)AND MACD2>0,0,MACD2,1.3,0 ),COLOR00CCFF;
STICKLINE(MACD2<=REF(MACD2,1)AND MACD2>0,0,MACD2,1.2,0 ),COLOR00DDFF;
STICKLINE(MACD2<=REF(MACD2,1)AND MACD2>0,0,MACD2,1,0 ),COLOR00EEFF;
STICKLINE(MACD2<=REF(MACD2,1)AND MACD2>0,0,MACD2,0.5,0 ),COLOR00FFFF;
STICKLINE(MACD2>REF(MACD2,1)AND MACD2>0,0,MACD2,3.4,0 ),COLOR0000AA;
STICKLINE(MACD2>REF(MACD2,1)AND MACD2>0,0,MACD2,3.2,0),COLOR0011BB;
STICKLINE(MACD2>REF(MACD2,1)AND MACD2>0,0,MACD2,3,0),COLOR0022CC;
STICKLINE(MACD2>REF(MACD2,1)AND MACD2>0,0,MACD2,2,0),COLOR0033DD;
STICKLINE(MACD2>REF(MACD2,1)AND MACD2>0,0,MACD2,1,0),COLOR0044EE;
STICKLINE(MACD2>REF(MACD2,1)AND MACD2>0,0,MACD2,0.5,0),COLOR0055FF;
STICKLINE(MACD2>REF(MACD2,1)AND MACD2<=0,0,MACD2,3.4,0),COLORAA00BB;
STICKLINE(MACD2>REF(MACD2,1)AND MACD2<=0,0,MACD2,3.2,0),COLORBB11BB;
STICKLINE(MACD2>REF(MACD2,1)AND MACD2<=0,0,MACD2,3,0),COLORCC22BB;
STICKLINE(MACD2>REF(MACD2,1)AND MACD2<=0,0,MACD2,2,0 ),COLORDD33BB;
STICKLINE(MACD2>REF(MACD2,1)AND MACD2<=0,0,MACD2,1,0),COLOREE44BB;
STICKLINE(MACD2>REF(MACD2,1)AND MACD2<=0,0,MACD2,0.5,0 ),COLORFF55BB;
STICKLINE(MACD2<=REF(MACD2,1)AND MACD2<=0,0,MACD2,3,0 ),COLORFF7700;
STICKLINE(MACD2<=REF(MACD2,1)AND MACD2<=0,0,MACD2,1.5 ,0 ),COLORFF8811;
STICKLINE(MACD2<=REF(MACD2,1)AND MACD2<=0,0,MACD2,1.2,0 ),COLORFFAA22;
STICKLINE(MACD2<=REF(MACD2,1)AND MACD2<=0,0,MACD2,1.0 ,0 ),COLORFFBB33;
STICKLINE(MACD2<=REF(MACD2,1)AND MACD2<=0,0,MACD2,0.8 ,0 ),COLORFFDD44;
STICKLINE(MACD2<=REF(MACD2,1)AND MACD2<=0,0,MACD2,0.5 ,0 ),COLORFFFF55;
{R:=(HHV(DEA,100)+ABS(LLV(DEA ,100)))/2;
R/4,POINTDOT,COLORFFFF00;
R/2,POINTDOT,COLORFFFF00;
R/4*3,POINTDOT,COLORFFFF00;
-R/4,POINTDOT,COLORFFFF00;
-R/2,POINTDOT,COLORFFFF00;
-R/4*3,POINTDOT,COLORFFFF00;}
DIFF5:EMA(CLOSE,7) - EMA(CLOSE,19);
DEA5:EMA(DIFF5,9);
来函数检测结果如下:
该公式没有未来函数
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
P赋值:13
S赋值:5
M赋值:1
DIFF赋值:C的S日指数移动平均-C的P日指数移动平均
DEA赋值:DIFF的M日指数移动平均,画红色
MACD:=2*(DIFF-DEA),COLORSTICK
P1:=P
S1:=S
DIFF1:=C的S1日指数移动平均-C的P1日指数移动平均
DEA1:=DIFF的M日指数移动平均,画红色
MACD1:=2*(DIFF1-DEA1),COLORSTICK
MACD2:=DEA
{股票指标网WWW88GSCOM}
STICKLINE(MACD2<=1日前的MACD2AND MACD2>0,0,MACD2,3,0 ),COLOR00AAFF
STICKLINE(MACD2<=1日前的MACD2AND MACD2>0,0,MACD2,1.8,0 ),COLOR00BBFF
STICKLINE(MACD2<=1日前的MACD2AND MACD2>0,0,MACD2,1.3,0 ),COLOR00CCFF
STICKLINE(MACD2<=1日前的MACD2AND MACD2>0,0,MACD2,1.2,0 ),COLOR00DDFF
STICKLINE(MACD2<=1日前的MACD2AND MACD2>0,0,MACD2,1,0 ),COLOR00EEFF
STICKLINE(MACD2<=1日前的MACD2AND MACD2>0,0,MACD2,0.5,0 ),COLOR00FFFF
STICKLINE(MACD2>1日前的MACD2AND MACD2>0,0,MACD2,3.4,0 ),COLOR0000AA
STICKLINE(MACD2>1日前的MACD2AND MACD2>0,0,MACD2,3.2,0),COLOR0011BB
STICKLINE(MACD2>1日前的MACD2AND MACD2>0,0,MACD2,3,0),COLOR0022CC
STICKLINE(MACD2>1日前的MACD2AND MACD2>0,0,MACD2,2,0),COLOR0033DD
STICKLINE(MACD2>1日前的MACD2AND MACD2>0,0,MACD2,1,0),COLOR0044EE
STICKLINE(MACD2>1日前的MACD2AND MACD2>0,0,MACD2,0.5,0),COLOR0055FF
STICKLINE(MACD2>1日前的MACD2AND MACD2<=0,0,MACD2,3.4,0),COLORAA00BB
STICKLINE(MACD2>1日前的MACD2AND MACD2<=0,0,MACD2,3.2,0),COLORBB11BB
STICKLINE(MACD2>1日前的MACD2AND MACD2<=0,0,MACD2,3,0),COLORCC22BB
STICKLINE(MACD2>1日前的MACD2AND MACD2<=0,0,MACD2,2,0 ),COLORDD33BB
STICKLINE(MACD2>1日前的MACD2AND MACD2<=0,0,MACD2,1,0),COLOREE44BB
STICKLINE(MACD2>1日前的MACD2AND MACD2<=0,0,MACD2,0.5,0 ),COLORFF55BB
STICKLINE(MACD2<=1日前的MACD2AND MACD2<=0,0,MACD2,3,0 ),COLORFF7700
STICKLINE(MACD2<=1日前的MACD2AND MACD2<=0,0,MACD2,1.5 ,0 ),COLORFF8811
STICKLINE(MACD2<=1日前的MACD2AND MACD2<=0,0,MACD2,1.2,0 ),COLORFFAA22
STICKLINE(MACD2<=1日前的MACD2AND MACD2<=0,0,MACD2,1.0 ,0 ),COLORFFBB33
STICKLINE(MACD2<=1日前的MACD2AND MACD2<=0,0,MACD2,0.8 ,0 ),COLORFFDD44
STICKLINE(MACD2<=1日前的MACD2AND MACD2<=0,0,MACD2,0.5 ,0 ),COLORFFFF55
{R赋值:(100日内DEA最高值+100日内DEA 最低值的绝对值)/2
R/4,POINTDOT,COLORFFFF00
R/2,POINTDOT,COLORFFFF00
R/4*3,POINTDOT,COLORFFFF00
-R/4,POINTDOT,COLORFFFF00
-R/2,POINTDOT,COLORFFFF00
-R/4*3,POINTDOT,COLORFFFF00
}
DIFF5:CLOSE的7日指数移动平均 - CLOSE的19日指数移动平均
DEA5:DIFF5的9日指数移动平均