顶背离 底背离指标公式源码 测试图[通达信公式]
该指标包含多个技术指标运算,主要用于判断市场进出点和运用背离指标进行交易。
具体运算方法如下:
根据收盘价与前两天的收盘价的大小关系,计算出连续的涨、跌拐点,即cxh1-cxh18;
计算出底部背离条件,当最近一次底部拐点之后的价格低于前一个底部拐点和MACD的DIFF指标低于前一个DIFF拐点时,出现底部背离;
计算出顶部背离条件,当最近一次顶部拐点之后的价格高于前一个顶部拐点和MACD的DIFF指标高于前一个DIFF拐点时,出现顶部背离;
计算出RSV、KDJ等指标,提供市场进出点;
通过压力位和支撑位,寻找交易的进出点;
通过底部和顶部背离指标,提示交易信号。
操作建议:
根据市场走势,选择合适的进出点,尤其需要重视压力位、支撑位和顶部背离等信号;
根据底部和顶部背离指标,结合其他指标,确定买卖点,可以适当地增加持仓;
注意风险控制,确保止损和止盈策略的制定;
结合其他市场信息,例如大盘走势等,进行综合考虑和分析,以减少操作带来的
cxh1:=CLOSE>REF(CLOSE,1) AND CLOSE>REF(CLOSE,2);cxh2:=REF(cxh1,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);cxh3:=REF(cxh2,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);cxh4:=REF(cxh3,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);cxh5:=REF(cxh4,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);cxh6:=REF(cxh5,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);cxh7:=REF(cxh6,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);cxh8:=REF(cxh7,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);cxh9:=REF(cxh8,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);cxhA:=REF(cxh9,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);cxhB:=REF(cxhA,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);cxhC:=REF(cxhB,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);STICKLINE(cxh1 OR cxh2 OR cxh3 OR cxh4 OR cxh5 OR cxh6 OR cxh7 OR cxh8 OR cxh9 OR cxhA OR cxhB OR cxhC,CLOSE,REF(CLOSE,1),3,0),COLORRED;cxhD:=CLOSE<REF(CLOSE,1) AND CLOSE<REF(CLOSE,2);cxhE:=REF(cxhD,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);cxhF:=REF(cxhE,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);cxh10:=REF(cxhF,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);cxh11:=REF(cxh10,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);cxh12:=REF(cxh11,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);cxh13:=REF(cxh12,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);cxh14:=REF(cxh13,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);cxh15:=REF(cxh14,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);cxh16:=REF(cxh15,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);cxh17:=REF(cxh16,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);cxh18:=REF(cxh17,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);STICKLINE(cxhD OR cxhE OR cxhF OR cxh10 OR cxh11 OR cxh12 OR cxh13 OR cxh14 OR cxh15 OR cxh16 OR cxh17 OR cxh18,CLOSE,REF(CLOSE,1),3,0),COLORYELLOW;cxh19:=REF(cxhD OR cxhE OR cxhF OR cxh10 OR cxh11 OR cxh12 OR cxh13 OR cxh14 OR cxh15 OR cxh16 OR cxh17 OR cxh18,1) AND cxh1;STICKLINE(cxh19,REF(CLOSE,1),REF(CLOSE,2),3,0),COLORMAGENTA;cxh1A:=REF(cxh1 OR cxh2 OR cxh3 OR cxh4 OR cxh5 OR cxh6 OR cxh7 OR cxh8 OR cxh9 OR cxhA OR cxhB OR cxhC,1) AND cxhD;STICKLINE(cxh1A,REF(CLOSE,1),REF(CLOSE,2),3,0),COLOR008800;RSV:=(CLOSE-LLV(LOW,13))/(HHV(HIGH,13)-LLV(LOW,13))*100;K:=SMA(RSV,3,1);D:=SMA(K,3,1);J:=3*K-2*D;RSV24:=(CLOSE-LLV(LOW,55))/(HHV(HIGH,55)-LLV(LOW,55))*100;K24:=SMA(RSV24,3,1);D24:=SMA(K24,3,1);J24:=3*K24-2*D24;压力位:IF(CROSS(J24,J),H,REF(H,BARSLAST(CROSS(J24,J)))),COLOR00FF33,LINETHICK1;支撑位:IF(CROSS(J,J24),L,REF(L,BARSLAST(CROSS(J,J24)))),COLORCC33CC,LINETHICK1;支撑价:LLV(LOW,23) ,COLOR7FFF00,LINETHICK2;阻力价:HHV(HIGH,23),COLORFF9900, LINETHICK2;A1:=BARSLAST(REF(CROSS("MACD.DIF","MACD.DEA"),1));DRAWTEXT(REF(C,A1+1)>C AND REF("MACD.DIF",A1+1)<"MACD.DIF" AND CROSS("MACD.DIF","MACD.DEA")>0,L-0.02,3),COLOR00FFFF;{MACD底背离}A2:=BARSLAST(REF(CROSS("KDJ.K","KDJ.D"),1));DRAWTEXT(REF(C,A2+1)>C AND REF("KDJ.K",A2+1)<"KDJ.K" AND CROSS("KDJ.K","KDJ.D"),L-0.10,4),COLORFF00FF;{KDJ底背离}A3:=BARSLAST(REF(CROSS("RSI.RSI1","RSI.RSI2"),1));DRAWTEXT(REF(C,A3+1)>C AND REF("RSI.RSI1",A3+1)<"RSI.RSI1" AND CROSS("RSI.RSI1","RSI.RSI2")>0,L-0.18,5),COLOR0000FF;{RSI底背离};C1:=BARSLAST(REF(CROSS("MACD.DEA","MACD.DIF"),1));DRAWTEXT(REF(C,C1+1)<C AND REF("MACD.DIF",C1+1)>"MACD.DIF" AND CROSS("MACD.DEA","MACD.DIF")>0,H+0.16,3),COLOR00FF00;{MACD顶背离};C2:=BARSLAST(REF(CROSS("KDJ.D","KDJ.K"),1));DRAWTEXT(REF(C,C2+1)<C AND REF("KDJ.K",C2+1)>"KDJ.K" AND CROSS("KDJ.D","KDJ.K")>0,H+0.08,4),COLORFFFFCC;{KDJ顶背离}C3:=BARSLAST(REF(CROSS("RSI.RSI2","RSI.RSI1"),1));DRAWTEXT(REF(C,C3+1)<C AND REF("RSI.RSI1",C3+1)>"RSI.RSI1" AND CROSS("RSI.RSI2","RSI.RSI1")>0,H+0.04,5),COLORFF9900;{RSI顶背离};
公式导入教程: 【通达信公式源码导入方法教程】 【同花顺公式源码导入方法教程】 【大智慧新一代公式源码导入方法教程】
有思路,想编写各种指标公式,交易模型,选股公式,还原公式的朋友
可联系技术人员 QQ: 262069696 或微信:cxhjy888 进行 有偿收费 编写!(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)
(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)
相关文章
-
没有相关内容