自动画MACD背离线通达信指标公式源码
- 格式:doc
- 大小:510.50 KB
- 文档页数:2
自动画MACD背离的指标:一共两个指标,一个是通达信用的,一个是大智慧用的
{通达信自动划MACD指标背离线}
DIFF:EMA(CLOSE,12) - EMA(CLOSE,26);
DEA:EMA(DIFF,9);
MACD:2*(DIFF-DEA), COLORSTICK;
A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
底背离:=REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA); STICKLINE(底背离,0,0.1,8,0),COLORRED;
DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,LINETHICK2;
A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));
顶背离:=REF(CLOSE,A2+1)
{大智慧自动划MACD指标背离线
(适用于大智慧新一代)}
DIF:EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:EMA(DIF,9);
MACD:(DIF-DEA)*2,COLORSTICK;
A:=SUMBARS(CROSS(DEA,DIF),2);
B:=SUMBARS(CROSS(DEA,DIF),1);
E:=REF(DIF,LLVBARS(DIF,A)) CROSS(DIF,DEA); F:=COUNT(BACKSET(E,LLVBARS(DIF,A)+1),LLVBARS(DIF,A)+1)=1; G:=COUNT(BACKSET(E,LLVBARS(DIF,B)+1),LLVBARS(DIF,B)+1)=1; DRAWLINE(F,DIF,G,DIF,0),COLOERED;