背离副图指标 公式 源码[其他软件公式]
指标公式代码分析及使用参考说明:
该分析指标公式主要包含了MACD、KDJ和RSI三个技术指标,并且对于这些指标所定义的底背离和顶背离进行了筛选,最终得到底背离选股和顶背离选股结果。
MACD指标是一种趋势指标,用于判断股票价格的涨跌趋势以及价格的强度。它由两条线组成,即快线(DIFF)和慢线(DEA),同时还有一个柱状图(MACD),用于表示快线与慢线之间的差异。MACD底背离出现时,意味着股票价格下跌,但MACD指标却出现上涨趋势,这通常是买入信号。
KDJ指标是一种摆动指标,用于判断股票价格的超买和超卖情况,以及价格的波动性。它由三条线组成,即K线、D线和J线,其中K线表示最近N天内收盘价与最低价之间的比率,D线表示K线的平均值,而J线则是K线和D线的加权平均值。KDJ底背离出现时,意味着股票价格下跌,但KDJ指标却出现上涨趋势,这通常是买入信号。
RSI指标是一种强弱指标,用于判断股票价格的强度和弱点。它通过计算一段时间内股票上涨日和下跌日的平均值,来确定股票的强度。RSI底背离出现时,意味着股票价格下跌,但RSI指标却出现上涨趋势,这通常是买入信号。
根据以上分析,可以使用该分析指标公式来筛选具有底背离或顶背离信号的股票,从而更好地确定股票的买入时机和卖出时机。但需要注意的是,分析指标只是一种工具,不能完全代替投资者自身的思考和决策。同时,应该结合其他技术指标和基本面分析来进行综合判断。
源码:
{背离副图}
DIFF:EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:EMA(DIFF,9),colorFF;
MACD:2*(DIFF-DEA),COLORSTICK;
D1:=EMA(CLOSE,3)-EMA(CLOSE,8);
D2:=EMA(OPEN,3)-EMA(OPEN,8);
D3:=EMA(HIGH,3)-EMA(HIGH,8);
D4:=EMA(LOW,3)-EMA(LOW,8);
STICKLINE(D1>=D2,D1,D2,7,1),Color0080FF;
STICKLINE(D1<=D2,D1,D2,7,1),colorFF00;
A1:=BARSLAST(REF(CROSS("MACD.DIFF"(12,26,9),"MACD.DEA"(12,26,9)),1));
B1:=REF(CLOSE,A1+1)>CLOSE AND REF("MACD.DIFF"(12,26,9),A1+1)<"MACD.DIFF"(12,26,9) AND CROSS("MACD.DIFF"(12,26,9),"MACD.DEA"(12,26,9));
MACD底背离:=FILTER(B1>0,5);DRAWTEXT(MACD底背离,0.30,'MACD\n底\n背\n离'),colorFF00;
A2:=BARSLAST(REF(CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3)),1));
B2:=REF(CLOSE,A2+1)>CLOSE AND REF("KDJ.K"(9,3,3),A2+1)<"KDJ.K"(9,3,3) AND CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3));
KDJ底背离:=FILTER(B2>0,5);DRAWTEXT(KDJ底背离,0.20,'KDJ\n底\n背\n离'),colorFFFF;
A3:=BARSLAST(REF(CROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24)),1));
B3:=REF(CLOSE,A3+1)>CLOSE AND REF("RSI.RSI1"(6,12,24),A3+1)<"RSI.RSI1"(6,12,24) AND CROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24));
RSI底背离:=FILTER(B3>0,5);DRAWTEXT(RSI底背离,0.34,'RSI\n底\n背\n离'),colorFFCC66;C1:=BARSLAST(REF(CROSS("MACD.DEA"(12,26,9),"MACD.DIFF"(12,26,9)),1));
D1:=REF(CLOSE,C1+1)<CLOSE AND REF("MACD.DIFF"(12,26,9),C1+1)>"MACD.DIFF"(12,26,9) AND CROSS("MACD.DEA"(12,26,9),"MACD.DIFF"(12,26,9));
MACD顶背离:=FILTER(D1>0,5);DRAWTEXT(MACD顶背离,0.33,'MACD\n顶\n背\n离'),color66FF;
C2:=BARSLAST(REF(CROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3)),1));
D2:=REF(CLOSE,C2+1)<CLOSE AND REF("KDJ.K"(9,3,3),C2+1)>"KDJ.K"(9,3,3) AND CROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3));
KDJ顶背离:=FILTER(D2>0,5);DRAWTEXT(KDJ顶背离,0.31,'KDJ\n顶\n背\n离'),ColorF8F343;
C3:=BARSLAST(REF(CROSS("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24)),1));
D3:=REF(CLOSE,C3+1)<CLOSE AND REF("RSI.RSI1"(6,12,24),C3+1)>"RSI.RSI1"(6,12,24) AND CROSS("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24));RSI顶背离:=FILTER(D3>0,5),colorFF00FF;
DRAWTEXT(RSI顶背离,0.32,'RSI\n顶\n背\n离'),colorFF00FF;
底背离选股:(MACD底背离 OR KDJ底背离 OR RSI底背离)/3.5;
顶背离选股:(MACD顶背离 OR KDJ顶背离 OR RSI顶背离)/3.5;
A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
B1:=REF(C,A1+1)>C AND REF(DIFF,A1+1)<DIFF AND CROSS(DIFF,DEA);
A2:=BARSLAST(REF(CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3)),1));
B2:=REF(C,A2+1)>C AND REF("KDJ.K"(9,3,3),A2+1)<"KDJ.K"(9,3,3) AND CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3));
A3:=BARSLAST(REF(CROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24)),1));
B3:=REF(C,A3+1)>C AND REF("RSI.RSI1"(6,12,24),A3+1)<"RSI.RSI1"(6,12,24) AND CROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24));
C1:=BARSLAST(REF(CROSS(DEA,DIFF),1));
D1:=REF(C,C1+1)<C AND REF(DIFF,C1+1)>DIFF AND CROSS(DEA,DIFF);
C2:=BARSLAST(REF(CROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3)),1));
D2:=REF(C,C2+1)<C AND REF("KDJ.K"(9,3,3),C2+1)>"KDJ.K"(9,3,3) AND CROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3));
C3:=BARSLAST(REF(CROSS("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24)),1));
D3:=REF(C,C3+1)<C AND REF("RSI.RSI1"(6,12,24),C3+1)>"RSI.RSI1"(6,12,24) AND CROSS("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24));
MACD底背:IF(B1>0,-0.1,0),COLORRED,POINTDOT;
KDJ底背:IF(B2>0,-0.1,0),COLORFF00FF,POINTDOT;
RSI底背:IF(B3>0,-0.1,0),COLORYELLOW,POINTDOT;
MACD顶背:IF(D1>0,0.1,0),COLOR00FF00,POINTDOT;
KDJ顶背:IF(D2>0,0.1,0),COLORFFCC66,POINTDOT;
RSI顶背:IF(D3>0,0.1,0),COLORWHITE,POINTDOT;
STICKLINE(B1>0,0,0.12,6,0),COLORRED;
STICKLINE(B2>0,0,0.12,6,0),COLORFF00FF;
STICKLINE(B3>0,0,0.12,6,0),COLORYELLOW;STICKLINE(D1>0,0,0.12,6,0),COLOR00FF00;
STICKLINE(D2>0,0,0.12,6,0),COLORFFCC66;
STICKLINE(D3>0,0,0.12,6,0),COLORWHITE;
公式导入教程: 【通达信公式源码导入方法教程】 【同花顺公式源码导入方法教程】 【大智慧新一代公式源码导入方法教程】
有思路,想编写各种指标公式,交易模型,选股公式,还原公式的朋友
可联系技术人员 QQ: 262069696 或微信:cxhjy888 进行 有偿收费 编写!(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)
(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)
相关文章
-
没有相关内容