将同化顺macd分时背离指标改成通达信可用
2020/1/13 18:42:13
公式编写说明:
Dif:=EMA(NEW,6) - EMA(NEW,21);diff:=EMA(dif,6);dea:=MA(diff,6);zero:0;MB:=dea-REF(dea,1);PARTLINE(dea,dea>REF(dea,1),RGB(255,0,255),dea<REF(dea,1),RGB(0,255,255),1);A1:=BARSLAST(REF(CROSS(Mb,0),1));b1:=REF(NEW,A1+1)>NEW AND REF(dEA,A1+1)<DEA AND CROSS(Mb,0) AND diff<0;DRAWTEXT(IF(b1>0,1,0),dea,'macd底背'),colorcyan;c1:=BARSLAST(REF(CROSS(0,Mb),1));d1:=REF(NEW,c1+1)<NEW AND REF(DEA,c1+1)>dEA AND CROSS(0,Mb) AND diff>0;DRAWTEXT(IF(d1>0,1,0),dea,'macd顶背'),colormagenta;
公式源码回答:
DIF:=EMA(C,6) - EMA(C,21);
DIFF:=EMA(DIF,6);
DEA:MA(DIFF,6),COLORFFFF00;
IF(DEA>REF(DEA,1),DEA,DRAWNULL),colorred;
ZERO:0;
MB:=DEA-REF(DEA,1);
A1:=BARSLAST(REF(CROSS(MB,0),1));
B1:=REF(C,A1+1)>C AND REF(DEA,A1+1)<DEA AND CROSS(MB,0) AND DIFF<0;
DRAWTEXT(IF(B1>0,1,0),DEA,'MACD底背'),colorcyan;
C1:=BARSLAST(REF(CROSS(0,MB),1));
D1:=REF(C,C1+1)<C AND REF(DEA,C1+1)>DEA AND CROSS(0,MB) AND DIFF>0;
DRAWTEXT(IF(D1>0,1,0),DEA,'MACD顶背'),colormagenta;
投股 票网 www.tou1 8.cn
股市公式下载推荐