通达信RSI背离副图预警 超级RSI洞察器 源码附图
强弱线:50,LINETHICK2,COLOR858585;
警示线:80,POINTDOT,COLORCYAN;
减仓线:90,COLOR00AA55,LINETHICK2;
清仓线:95,COLOR0000AA,LINETHICK2;
RSI5:SMA(MAX(C-REF(C,1),0),5,1)/SMA(ABS(C-REF(C,1)),5,1)*100,NODRAW,COLORFFAAFF;
RSI10:SMA(MAX(C-REF(C,1),0),10,1)/SMA(ABS(C-REF(C,1)),10,1)*100,NODRAW,COLORDDAADD;
RSI20:SMA(MAX(C-REF(C,1),0),20,1)/SMA(ABS(C-REF(C,1)),20,1)*100,NODRAW,COLORAA99AA;
洞察器1:=BARSLAST(REF(CROSS(RSI20,RSI5),1));
洞察器2:=REF(CLOSE,洞察器1+1)<CLOSE AND REF(RSI5,洞察器1+1)>RSI5 AND CROSS(RSI20,RSI5);
洞察器3:=BARSLAST(REF(CROSS(RSI5,RSI20),1));
洞察器4:=REF(CLOSE,洞察器3+1)>CLOSE AND RSI5>REF(RSI5,洞察器3+1) AND CROSS(RSI5,RSI20);
洞察器5:=REF(RSI5,3)=HHV(RSI5,2*3+1);
洞察器6:=BACKSET(FILTER(洞察器5,3),3+1);
洞察器7:=REF(RSI5,3)=LLV(RSI5,2*3+1);
洞察器8:=BACKSET(FILTER(洞察器7,3),3+1);
洞察器9:=BACKSET(ISLASTBAR,BARSLAST(FILTER(洞察器6,3))+1);
洞察器10:=洞察器9>REF(洞察器9,1);
RSI:=BACKSET(ISLASTBAR,BARSLAST(FILTER(洞察器8,3))+1);
HGW:=RSI>REF(RSI,1);
DRAWBAND(RSI5,RGB(255,0,255),RSI10,RGB(0,255,0));
DRAWBAND(RSI10,RGB(255,0,255),RSI20,RGB(0,255,0));
金叉:CROSS(RSI5,RSI20) AND CROSS(RSI10,RSI20),COLORRED,NODRAW;
死叉:CROSS(RSI20,RSI10) AND CROSS(RSI20,RSI5),COLORGREEN,NODRAW;
顶背离:IF(洞察器2,RSI5,DRAWNULL),CIRCLEDOT,COLORFFCC00;
STICKLINE(洞察器2,RSI5,RSI5*0.9,0,0),COLORFFCC00;
DRAWTEXT(洞察器2,RSI5*0.9,'顶背离'),COLOR00FFFF;
底背离:IF(洞察器4,RSI5,DRAWNULL),CIRCLEDOT,COLOR6699FF;
STICKLINE(洞察器4,RSI5,RSI5*1.1,0,0),COLOR6699FF;
DRAWTEXT(洞察器4,RSI5*1.1,'底背离'),COLOR40FF00;
压力线:DRAWLINE(FILTER(洞察器6,3),RSI5,洞察器10,RSI5,1),LINETHICK1,COLORCC33CC;
支撑线:DRAWLINE(FILTER(洞察器8,3),RSI5,HGW,RSI5,1),COLOR00CCCC;
未来函数检测结果如下:
该公式包含未来函数:BACKSET
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
输出强弱线:50, 线宽为2,COLOR858585
输出警示线:80,POINTDOT,画青色
输出减仓线:90,COLOR00AA55, 线宽为2
输出清仓线:95,COLOR0000AA, 线宽为2
输出RSI5:SMA(C-1日前的C和0较大值,5,1)/SMA(C-1日前的C的绝对值,5,1)*100,NODRAW,COLORFFAAFF
输出RSI10:SMA(C-1日前的C和0较大值,10,1)/SMA(C-1日前的C的绝对值,10,1)*100,NODRAW,COLORDDAADD
输出RSI20:SMA(C-1日前的C和0较大值,20,1)/SMA(C-1日前的C的绝对值,20,1)*100,NODRAW,COLORAA99AA
洞察器1赋值:上次1日前的RSI20上穿RSI5距今天数
洞察器2赋值:洞察器1+1日前的收盘价<收盘价 AND 洞察器1+1日前的RSI5>RSI5 AND RSI20上穿RSI5
洞察器3赋值:上次1日前的RSI5上穿RSI20距今天数
洞察器4赋值:洞察器3+1日前的收盘价>收盘价 AND RSI5>洞察器3+1日前的RSI5 AND RSI5上穿RSI20
洞察器5赋值:3日前的RSI5=2*3+1日内RSI5最高值
洞察器6赋值:BACKSET(洞察器5的3过滤,3+1)
洞察器7赋值:3日前的RSI5=2*3+1日内RSI5最低值
洞察器8赋值:BACKSET(洞察器7的3过滤,3+1)
洞察器9赋值:BACKSET(ISLASTBAR,上次洞察器6的3过滤距今天数+1)
洞察器10:=洞察器9>1日前的洞察器9
RSI赋值:BACKSET(ISLASTBAR,上次洞察器8的3过滤距今天数+1)
HGW赋值:RSI>1日前的RSI
DRAWBAND(RSI5,RGB(255,0,255),RSI10,RGB(0,255,0))
DRAWBAND(RSI10,RGB(255,0,255),RSI20,RGB(0,255,0))
输出金叉:RSI5上穿RSI20 AND RSI10上穿RSI20,画红色,NODRAW
输出死叉:RSI20上穿RSI10 AND RSI20上穿RSI5,画绿色,NODRAW
如果洞察器2返回RSI5否则返回DRAWNULL
当满足条件洞察器2时,在RSI5和RSI5*0.9之间画柱状线
当满足条件洞察器2时,在RSI5*0.9和'顶背离'位置书写文字
如果洞察器4返回RSI5否则返回DRAWNULL
当满足条件洞察器4时,在RSI5和RSI5*1.1之间画柱状线
当满足条件洞察器4时,在RSI5*1.1和'底背离'位置书写文字
输出压力线:DRAWLINE(洞察器6的3过滤,RSI5,洞察器10,RSI5,1),LINETHICK1,COLORCC33CC
输出支撑线:DRAWLINE(洞察器8的3过滤,RSI5,HGW,RSI5,1),COLOR00CCCC