通達信微分MACD指標公式
- 指標類別: 通達信指標公式
- 授權方式: 免費版
- 指標評級: ★★★★★
- 指標分類: 趨勢
- 畫線方法: 副圖
- 日期:2022-10-13 來源:互聯(lián)網(wǎng)
通達信微分MACD指標公式:
DIF12:=(EMA(CLOSE,12)-EMA(CLOSE,26))/((EMA(CLOSE,12)+EMA(CLOSE,26))/2)*1000;
DEA12:=EMA(DIF12,9);
{相對MACD:2*(DIF12-DEA12),STICK,COLORRED;}
KDIF12:=3*(DIF12-DEA12);{KDIF12:=2*(DIF12-DEA12)};
KDEA12:=SMA(KDIF12,5,2);
買賣力道:2*(KDIF12-KDEA12),COLORLIRED,LINETHICK1;
{相對DIF:DIF12,COLORMAGENTA,LINETHICK2;
相對DEA:DEA12,COLORGREEN,LINETHICK2;}
微分DIF:KDIF12,COLORYELLOW,LINETHICK2;
微分DEA:KDEA12,COLORLIGRAY,LINETHICK1;
微分MACD:2*(KDIF12-KDEA12),STICK,,LINETHICK2,COLORBLUE;
B11:微分MACD>REF(微分MACD,1) AND 微分MACD>REF(微分MACD,2) AND
REF(微分MACD,2)>REF(微分MACD,1) AND REF(微分MACD,2)/REF(微分MACD,1)>0,NODRAW;
B12:=EXIST(B11,15)=1 AND 微分MACD<REF(微分MACD,1) AND REF(微分MACD,1)>REF(微分MACD,2);
B121:B12 AND BARSLAST(B11)>BARSLAST(B12) AND COUNT(B12,BARSLAST(B11))=1,NODRAW;
{以下為MACD變色的代碼}
_紅柱:IF(微分MACD>REF(微分MACD,1),微分MACD,DRAWNULL),STICK,COLORRED;
IF(B11,微分MACD,DRAWNULL),STICK,COLORYELLOW,LINETHICK7;
IF(B121,微分MACD,DRAWNULL),STICK,COLORGREEN,LINETHICK7;
綠柱:IF(微分MACD<REF(微分MACD,1),微分MACD,DRAWNULL),STICK,COLORYELLOW;
_抄底:=((CROSS(微分DIF,微分DEA)
&&微分DEA<=-0.07)*微分DIF)*1.50,COLORLIMAGENTA;
_DIF:=微分DIF,COLORWHITE;
_DEA:=微分DEA,COLORYELLOW;
__強度:=IF(_DIF>_DEA,_DIF,DRAWNULL),COLORRED,LINETHICK2;
_強度:=IF(_DEA<_DIF,_DEA,DRAWNULL),COLORMAGENTA,LINETHICK2;
0;
{統(tǒng)計買入后漲幅};
ZF:=C/(REF(C,BARSLAST(B11)))*100-100,NODRAW;
本輪漲幅1:=IF(B121=1,ZF,DRAWNULL);
本輪漲幅:IF(C/(REF(C,BARSLAST(B11)))=0,1,本輪漲幅1);
漲跌算術和1:SUM(本輪漲幅,0);
{ZFF:=1*本輪漲幅/100;
首輪漲后:1*(1+REF(ZFF,BARSSINCE(B121)) );
N1輪漲:首輪漲后*REF(本輪漲幅,BARSSINCEN(B121,COUNT(B121,0)-1));
總漲倍率1:=(本輪漲幅*REF(本輪漲幅,BARSLAST(B121)))/10000,NODRAW;
總漲倍率:IF(B121=1,總漲倍率1,DRAWNULL);};
通達信微分MACD指標公式實例圖解:
通達信微分MACD指標公式