请哪位老师帮忙写一个macd的diff线改变方向即改变颜色的公式 [通达信]
作者:
通达信 来源:
cxh99.com 发布时间:2012年05月30日 点击数:
【
收藏到本网的会员中心】
- 咨询内容:
请哪位老师帮忙写一个macd的diff线改变方向即改变颜色的公式
- 通达信客服:
DIF:=EMA(CLOSE,9)-EMA(CLOSE,18);
DEA:EMA(DIF,7),LINETHICK1,COLORFFFFFF;
MACD:=2*(DIF-DEA);
QDIF:IF(DEA,DIF,DRAWNULL),COLORRED,LINETHICK2;
D:=BACKSET(DIF<REF(DIF,1),2);
RDIF:IF(D,DIF,DRAWNULL),COLOR33FF33,LINETHICK2;
STICKLINE(MACD>=0 AND MACD>=REF(MACD,1),0,MACD,0,0),COLOR0000FF;
STICKLINE(MACD>=0 AND MACD< REF(MACD,1),0,MACD,0,0),COLORFFFF00;
STICKLINE(MACD<0 AND MACD>=REF(MACD,1),0,MACD,0,0),COLORFF99FF;
STICKLINE(MACD<0 AND MACD< REF(MACD,1),0,MACD,0,0),COLORFFFF00;
DRAWICON((CROSS(DIF,DEA) AND DIF<0.3),-0.05,1);
DEA1:=EMA(DIF,9),COLORYELLOW,LINETHICK2;
MACD1:(DIF-DEA1)*2,COLORSTICK;
低位金:=CROSS(DIF,DEA1) AND DIF<-0.1;
STICKLINE(低位金,0,0.15,8,0),COLORYELLOW;
JCCOUNT:=COUNT(CROSS(DIF,DEA1),BARSLAST(DEA1>=0));
二次金:=CROSS(DIF,DEA1) AND DEA1<0 AND COUNT(JCCOUNT=2,34)=1;
STICKLINE(二次金,0,0.1,8,0),COLORFF80FF;
DRAWICON(二次金,DEA1*0.85,1) ;
A1:=BARSLAST(REF(CROSS(DIF,DEA1),1));
底背离:=REF(CLOSE,A1+1)>CLOSE AND DIF>REF(DIF,A1+1) AND CROSS(DIF,DEA1);
STICKLINE(底背离,0,0.05,8,0),COLORGREEN;
DRAWLINE(A1=0,DEA1,底背离,DEA1,0),COLORGREEN,LINETHICK2;
A2:=BARSLAST(REF(CROSS(DEA1,DIF),1));
顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIF,A2+1)>DIF AND CROSS(DEA1,DIF);
DRAWLINE(A2=0,DEA1,顶背离,DEA1,0),COLORGREEN,LINETHICK2;
强:IF(DIF>=DEA1,DIF,DRAWNULL),COLORRED,LINETHICK2;