通达信实用背离指标公式
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
通达信实用背离指标公式来源:Internet,编辑:股旁网,2017-01-11 {MACD背离}
DIFF:EMA(CLOSE,12) - EMA(CLOSE,26); DEA:EMA(DIFF,9);
MACD:2*(DIFF-DEA),
COLORSTICK,DRAWABOVE;
MACD金
叉:=BARSLAST(REF(CROSS(DIFF,DEA),1)); MACD死
叉:=BARSLAST(REF(CROSS(DEA,DIFF),1)); MACD上次金
叉:=SUMBARS(REF(CROSS(DIFF,DEA),1),2); MACD上次死
叉:=SUMBARS(REF(CROSS(DEA,DIFF),1),2); {MACD底背离}
MACD次低点:=LLV(DIFF,MACD金叉);
MACD最低点:=LLV(DIFF,MACD上次死叉); MACD底背离:=REF(CLOSE,MACD金叉
+1)>CLOSE AND MACD次低点>MACD最低点
AND CROSS(DIFF,DEA);
DRAWLINE(MACD金叉=0,DEA,MACD底背
离,DEA,0),COLORRED,LINETHICK2;
{MACD顶背离}
MACD次高点:=HHV(DIFF,MACD金叉);
MACD最高点:=HHV(DIFF,MACD上次金叉); MACD顶背离:=REF(CLOSE,MACD死叉
+1) DRAWLINE(MACD死叉=0,DEA,MACD顶背 离,DEA,0),COLORGREEN,LINETHICK2; 红面 积:SUM(MACD,BARSLAST(MACD<0))*(MACD>0 ),COLOR0000FF,NODRAW; 绿面 积:SUM(MACD,BARSLAST(MACD>0))*(MACD<0 ),COLORFFFF00,NODRAW; AA:=ROUND(REF(绿面 积,1)*100);BB:=ROUND(REF(红面积,1)*100); DRAWNUMBER(CROSS(0,MACD),0.04,ABS(BB)) ,COLORMAGENTA; DRAWNUMBER(CROSS(MACD,0),-0.01,ABS(AA) ),COLORGREEN; {CCI} TYP:=(HIGH+LOW+CLOSE)/3; CCI:=(TYP-MA(TYP,14))/(0.015*AVEDEV(TYP,1 4)); {BOLL} BOLL:=MA(CLOSE,20); UB:=BOLL+2*STD(CLOSE,20); LB:=BOLL-2*STD(CLOSE,20); {KDJ} RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV (LOW,9))*100; K:=SMA(RSV,3,1); D:=SMA(K,3,1); J:=3*K-2*D; PP:=CCI<-160 AND CLOSE {KDJ中J值在0-90间为黄色,小于0为绿色,大于 90为红色} {显示J值和CCI值} {CCI值小于160且收盘价在BOLL下轨一下,J值小于20为红色箭头,CCI大于160且J值大于100为绿色箭头} DRAWICON(QQ,0,2); DRAWICON(PP,0,1); KDJ金叉:=BARSLAST(REF(CROSS(J,D),1)); KDJ死叉:=BARSLAST(REF(CROSS(D,J),1)); KDJ上次金叉:=SUMBARS(REF(CROSS(J,D),1),2); KDJ上次死叉:=SUMBARS(REF(CROSS(D,J),1),2); {KDJ底背离} AAA1:=BARSLAST(REF(CROSS(J,D),1)); KDJ次低点:=LLV(J,AAA1); KDJ最低点:=LLV(J,KDJ上次死叉); KDJ底背离:=REF(CLOSE,AAA1+1)>CLOSE AND KDJ次低点>KDJ最低点AND CROSS(J,D); DRAWTEXT(KDJ底背离,MACD,'KDJ底 '),COLORRED; STICKLINE(KDJ底背离,MACD,0,2,0),COLORRED; {KDJ顶背离} BBB1:=BARSLAST(REF(CROSS(D,J),1)); KDJ次高点:=HHV(J,AAA1); KDJ最高点:=HHV(J,KDJ上次金叉); KDJ顶背离:=REF(CLOSE,BBB1+1) '),COLORGREEN; STICKLINE(KDJ顶背 离,MACD,0,2,0),COLORGREEN; {九转} A1:=C>=REF(C,4);