通达信双布林MACD主图指标公式
2020/5/9 18:34:53
N:=20;M:=50;
DP:=(H+L+2*C)/4;
MID:= MA(DP,N);
20中轨:MID,COLORWHITE,POINTDOT,LINETHICK2;
{以下为通达信、同花顺均可用的变色K线
STICKLINE(MID>REF(MID,1),MID*1.01,REF(MID,1),4,1),COLORRED;
STICKLINE(MID<=REF(MID,1),MID,REF(MID,1),4,0),COLOR00FF00;}
DRAWBAND(MID,RGB(225,0,0),REF(MID,2),RGB(00,255,00));
20上轨:MID +1.96*STD(DP,N),COLORYELLOW;
20下轨:MID-1.96*STD(DP,N),COLORFF0000;
M2:=MA(DP,M);
50中轨:IF(M2>=REF(M2,1),M2,DRAWNULL),COLORFF00FF,CIRCLEDOT;
IF(M2<REF(M2,1),M2,DRAWNULL),COLORFFB560,POINTDOT,LINETHICK4;
50上轨:M2+2.1*STD(DP,M),LINETHICK2,COLORRED;
50下轨:M2-2.1* STD(DP,M),LINETHICK2,COLOR00FF00;
ZDF:=(C-REF(C,1))/REF(C,1)*100;
STICKLINE(ZDF>9.8,O,C,3,0),COLORRED;
STICKLINE(ZDF<-9.8,O,C,3,0),COLORBLUE;
DIF:=EMA(DP,12);
DEA:=EMA(DP,26);
MACD:=(DIF-DEA);
XH:=EMA(MACD,9);
AC:=2*(MACD-XH);
AO1:=REF(MACD,1);
AC1:=REF(AC,1);
KK:=IF(AC>AC1 AND MACD>AO1,5,IF(AC<AC1 AND MACD<AO1,-5,0));
STICKLINE(KK=5,H,L,0.1,0),COLORRED;
STICKLINE(KK=5 AND C>O,C,O,4,1),COLORRED;
STICKLINE(KK=5 AND C<O,C,O,4,0),COLORRED;
STICKLINE(KK=0,H,L,0.1,0),COLORFFFF00;
STICKLINE(KK=0 AND C<O,C,O,4,0),COLORFFFF00;
STICKLINE(KK=0 AND C>O,C,O,4,1),COLORFFFF00;
STICKLINE(KK=-5,H,L,0.1,0),,COLORFF0000;
STICKLINE(KK=-5 AND C>O,C,O,4,1),COLORFF0000;
STICKLINE(KK=-5 AND C<O,C,O,4,0),COLORFF0000;
DRAWTEXT_FIX(1,0.5,0,0,'红色K线为多头区域'),COLORRED;
DRAWTEXT_FIX(1,0.5,0.04,0,'青色K线为混沌区域'),COLORFFFF00;
DRAWTEXT_FIX(1,0.5,0.08,0,'蓝色K线为空头区域'),COLORFF0000;
DRAWTEXT_FIX(1,0.5,0.12,0,'红色建仓,青色减仓!'),COLORFF00FF;
看股吧 公式 www.kanguba.c om
其它股票公式列表