通达信短线超卖低吸副图指标 底背离提示 源码附图
A1:=REF(C,1);
A2:=SMA(MAX(C-A1,0),5,1)/SMA(ABS(C-A1),5,1)*1000;
A3:=BARSLAST(REF(CROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24)),1));
A4:=A2-LLV(A2,10);
A5:=(MA(A4,2)*3+A4*13)/16;
A6:=IF(A5>13,MA(A5,2),A5)/6;
RSI1:=SMA(MAX(C-A1,0),6,1)/SMA(ABS(C-A1),6,1)*100;
RSI2:=SMA(MAX(C-A1,0),12,1)/SMA(ABS(C-A1),12,1)*100;
RSI3:=SMA(MAX(C-A1,0),24,1)/SMA(ABS(C-A1),24,1)*100;
压力:=HHV(MA(RSI2,3),12);
支撑:=LLV(MA(RSI2,3),12);
中间:(HHV(MA(RSI2,3),12)+LLV(MA(RSI2,3),12))/2,COLORRED,LINETHICK2;
STICKLINE(RSI2< 支撑,中间,RSI2,2,0)COLORGREEN;
STICKLINE(RSI2>=支撑 AND RSI2< 中间,中间,RSI2,2,0)COLORLIBLUE;
STICKLINE(RSI2>=中间 AND RSI2< 压力,中间,RSI2,2,0)COLORLIRED;
STICKLINE(RSI2>=压力,中间,RSI2,2,0)COLORRED;
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));
DRAWTEXT(B3,RSI2,'底背');
B1:=RSI1>=RSI2 AND RSI2>=RSI3;
S1:=RSI1< RSI2 AND RSI2< RSI3;
BS1:=NOT(RSI1>=RSI2 AND RSI2>=RSI3)AND NOT(RSI1< RSI2 AND RSI2< RSI3);
STICKLINE(B1,80,82,2,1)COLORRED;
STICKLINE(S1,80,82,2,1)COLORGREEN;
STICKLINE(BS1,80,82,2,1)COLORYELLOW;
短线:IF(CROSS(A6,1) AND (A6< 30)AND RSI2< 35 AND RSI2>=支撑 AND RSI2< 中间,30,20),COLORMAGENTA,LINETHICK2;
来函数检测结果如下:
该公式没有未来函数
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
A1赋值:1日前的C
A2赋值:SMA(C-A1和0较大值,5,1)/SMA(C-A1的绝对值,5,1)*1000
A3赋值:上次REF(CROSS("RSI.RSI1"(6,12,24距今天数,"RSI.RSI2"(6,12,24)),1))
A4赋值:A2-10日内A2最低值
A5赋值:(A4的2日简单移动平均*3+A4*13)/16
A6赋值:IF(A5>13,A5的2日简单移动平均,A5)/6
RSI1赋值:SMA(C-A1和0较大值,6,1)/SMA(C-A1的绝对值,6,1)*100
RSI2赋值:SMA(C-A1和0较大值,12,1)/SMA(C-A1的绝对值,12,1)*100
RSI3赋值:SMA(C-A1和0较大值,24,1)/SMA(C-A1的绝对值,24,1)*100
压力赋值:HHV(RSI2的3日简单移动平均,12)
支撑赋值:LLV(RSI2的3日简单移动平均,12)
输出中间:(HHV(RSI2的3日简单移动平均,12)+LLV(RSI2的3日简单移动平均,12))/2,画红色, 线宽为2
当满足条件RSI2< 支撑时,在中间和RSI2之间画柱状线
当满足条件RSI2>=支撑 AND RSI2< 中间时,在中间和RSI2之间画柱状线
当满足条件RSI2>=中间 AND RSI2< 压力时,在中间和RSI2之间画柱状线
当满足条件RSI2>=压力时,在中间和RSI2之间画柱状线
B3赋值:A3+1日前的C>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))
当满足条件B3时,在RSI2和'底背'位置书写文字
B1赋值:RSI1>=RSI2 AND RSI2>=RSI3
S1赋值:RSI1< RSI2 AND RSI2< RSI3
BS1赋值:NOT(RSI1>=RSI2 AND RSI2>=RSI3)AND NOT(RSI1< RSI2 AND RSI2< RSI3)
当满足条件B1时,在80和82之间画柱状线
当满足条件S1时,在80和82之间画柱状线
当满足条件BS1时,在80和82之间画柱状线
输出短线:IF(A6上穿1 AND (A6< 30)AND RSI2< 35 AND RSI2>=支撑 AND RSI2< 中间,30,20),画洋红色, 线宽为2