以下是通达信相对macd副图公式

通达信相对macd副图公式

D1:=12;D2:=21;
C1:=26;C2:=34;

MM1:=IF(PERIOD=1,D2,IF(PERIOD=2,D2,IF(PERIOD=3,D2,IF(PERIOD=4,D1,
IF(PERIOD=5,D1,IF(PERIOD=6,D1,IF(PERIOD=7,D1,0)))))));
MM2:=IF(PERIOD=1,C2,IF(PERIOD=2,C2,IF(PERIOD=3,C2,IF(PERIOD=4,C1,
IF(PERIOD=5,C1,IF(PERIOD=6,C1,IF(PERIOD=7,C1,0)))))));

M1:=3;
DIFF:=EMA((EMA(CLOSE,MM1)-EMA(CLOSE,MM2))/EMA(CLOSE,MM2)*1000,M1);
DEA1:=EMA(DIFF,9);
MACD1:=(DIFF-DEA1)/5;
MACD:MACD1,COLORSTICK,COLORRED;
STICKLINE(MACD1<REF(MACD1,1)AND MACD1<0,0,MACD1,0,0),COLORGREEN;
STICKLINE(MACD1<REF(MACD1,1)AND MACD1>=0,0,MACD1,0,0),COLORFFD680;
STICKLINE(MACD1>REF(MACD1,1) AND MACD1<0,0,MACD1,0,0),COLORMAGENTA;

DIF:=(EMA(CLOSE,MM1)-EMA(CLOSE,MM2))/((EMA(CLOSE,MM1)+EMA(CLOSE,MM2))/2)*100;
DEA:=SMA(DIF,5,2);
KDIF:=3*(DIF-DEA);
KDEA:=SMA(KDIF,5,2);
KDEA1:=SMA(KDIF,8,2);

长DIF:KDEA,LINETHICK1;
长DEA:KDEA1,LINETHICK1,COLORFFFF00;
IF(长DEA<REF(长DEA,1),长DEA,DRAWNULL),COLORGREEN,LINETHICK1;
 

 

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。