将飞狐MACD改成通达信
2020/4/26 18:10:32
公式编写说明:
飞狐源码,在通达信上显示不清楚,请老师将飞狐MACD改成通达信,谢谢!MACD公式源码:DIFF1:=(EMA(CLOSE,S) - EMA(CLOSE,P)){/EMA(CLOSE,S)*100};DEA1:=EMA(DIFF1,M);MACD:2*(DIFF1-DEA1){,COLORSTICK},LINETHICK0;MACDHS:=IF(MACD>0 AND MACD>=REF(MACD,1),MACD,0);MACDHX:=IF(MACD>0 AND MACD<=REF(MACD,1),MACD,0);MACDLX:=IF(MACD<0 AND MACD<REF(MACD,1),MACD,0);MACDLS:=IF(MACD<0 AND MACD>REF(MACD,1),MACD,0);STICKLINE(MACDHS>0,0,MACD,9,0),COLOR0000BB;STICKLINE(MACDHS>0,0,MACD,8,0),COLOR0000CC;STICKLINE(MACDHS>0,0,MACD,7,0),COLOR0011CC;STICKLINE(MACDHS>0,0,MACD,6,0),COLOR1122DD;STICKLINE(MACDHS>0,0,MACD,5,0),COLOR2233DD;STICKLINE(MACDHS>0,0,MACD,4,0),COLOR3344EE;STICKLINE(MACDHS>0,0,MACD,3,0),COLOR4455EE;STICKLINE(MACDHS>0,0,MACD,2,0),COLOR5566FF;STICKLINE(MACDHS>0,0,MACD,1,0),COLOR6677FF;STICKLINE(MACDHX>0,0,MACD,9,0),COLOR0077BB;STICKLINE(MACDHX>0,0,MACD,8,0),COLOR0088CC;STICKLINE(MACDHX>0,0,MACD,7,0),COLOR0099CC;STICKLINE(MACDHX>0,0,MACD,6,0),COLOR00AADD;STICKLINE(MACDHX>0,0,MACD,5,0),COLOR00BBDD;STICKLINE(MACDHX>0,0,MACD,4,0),COLOR00CCEE;STICKLINE(MACDHX>0,0,MACD,3,0),COLOR00DDEE;STICKLINE(MACDHX>0,0,MACD,2,0),COLOR00EEFF;STICKLINE(MACDHX>0,0,MACD,1,0),COLOR00FFFF;STICKLINE(MACDLX<0,MACD,0,9,0),COLOR770000;STICKLINE(MACDLX<0,MACD,0,8,0),COLOR881100;STICKLINE(MACDLX<0,MACD,0,7,0),COLOR992200;STICKLINE(MACDLX<0,MACD,0,6,0),COLORAA3300;STICKLINE(MACDLX<0,MACD,0,5,0),COLORBB4400;STICKLINE(MACDLX<0,MACD,0,4,0),COLORCC5500;STICKLINE(MACDLX<0,MACD,0,3,0),COLORDD6600;STICKLINE(MACDLX<0,MACD,0,2,0),COLOREE7700;STICKLINE(MACDLX<0,MACD,0,1,0),COLORFF8800;STICKLINE(MACDLS<0,MACD,0,9,0),COLOR005500;STICKLINE(MACDLS<0,MACD,0,8,0),COLOR007700;STICKLINE(MACDLS<0,MACD,0,7,0),COLOR009900;STICKLINE(MACDLS<0,MACD,0,6,0),COLOR00AA00;STICKLINE(MACDLS<0,MACD,0,5,0),COLOR00BB00;STICKLINE(MACDLS<0,MACD,0,4,0),COLOR00CC00;STICKLINE(MACDLS<0,MACD,0,3,0),COLOR00DD00;STICKLINE(MACDLS<0,MACD,0,2,0),COLOR00EE00;STICKLINE(MACDLS<0,MACD,0,1,0),COLOR00FF00;DIFF:DIFF1,COLOR0000FF;DEA:DEA1,COLORFF0000;
公式源码示例:
S:=12;P:=26;M:=9;
DIFF1:=(EMA(CLOSE,S) - EMA(CLOSE,P));
DEA1:=EMA(DIFF1,M);
MACD:2*(DIFF1-DEA1),NODRAW;
MACDHS:=IF(MACD>0 AND MACD>=REF(MACD,1),MACD,0);
MACDHX:=IF(MACD>0 AND MACD<=REF(MACD,1),MACD,0);
MACDLX:=IF(MACD<0 AND MACD<REF(MACD,1),MACD,0);
MACDLS:=IF(MACD<0 AND MACD>REF(MACD,1),MACD,0);
STICKLINE(MACDHS>0,0,MACD,2,0),COLOR4455EE;
STICKLINE(MACDHS>0,0,MACD,1,0),COLOR5566FF;
STICKLINE(MACDHS>0,0,MACD,0,0),COLOR6677FF;
STICKLINE(MACDHX>0,0,MACD,2,0),COLOR00DDEE;
STICKLINE(MACDHX>0,0,MACD,1,0),COLOR00EEFF;
STICKLINE(MACDHX>0,0,MACD,0,0),COLOR00FFFF;
STICKLINE(MACDLX<0,MACD,0,2,0),COLORDD6600;
STICKLINE(MACDLX<0,MACD,0,1,0),COLOREE7700;
STICKLINE(MACDLX<0,MACD,0,0,0),COLORFF8800;
STICKLINE(MACDLS<0,MACD,0,2,0),COLOR00DD00;
STICKLINE(MACDLS<0,MACD,0,1,0),COLOR00EE00;
STICKLINE(MACDLS<0,MACD,0,0,0),COLOR00FF00;
DIFF:DIFF1,COLOR0000FF,LINETHICK2;
DEA:DEA1,COLORFFFF00,LINETHICK2;
看股吧 公式 www.kanguba .com
其它股票公式列表