RSI红绿多空波段金叉死叉提示通达信公式 副图 测试图
SJ:=1;
超买:100*SJ,COLORRED,POINTDOT;
超卖:0*SJ,COLOR00FF00,POINTDOT;
LC :=REF(CLOSE,1);
RSI1:SMA(MAX(CLOSE-LC,0)*SJ,7,1)/SMA(ABS(CLOSE-LC),7,1)*100;
RSI2:SMA(MAX(CLOSE-LC,0)*SJ,14,1)/SMA(ABS(CLOSE-LC),14,1)*100;
{股票指标网 }
IF(RSI1<=REF(RSI1,1),RSI1,DRAWNULL),LINETHICK2,COLORGREEN;
IF(RSI1>=REF(RSI1,1),RSI1,DRAWNULL),LINETHICK2,COLORRED;
IF(RSI2<=REF(RSI2,1),RSI2,DRAWNULL),LINETHICK2,COLORGREEN;
IF(RSI2>=REF(RSI2,1),RSI2,DRAWNULL),LINETHICK2,COLORRED;
DRAWTEXT(CROSS(RSI1,RSI2) AND RSI1<35,20,'金叉'),COLORMAGENTA;
DRAWTEXT(CROSS(RSI2,RSI1) AND RSI1>65,60,'死叉'),COLORBLUE;
来函数检测结果如下:
该公式没有未来函数
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
SJ赋值:1
输出超买:100*SJ,画红色,POINTDOT
输出超卖:0*SJ,COLOR00FF00,POINTDOT
LC :=1日前的收盘价
输出RSI1:SMA(收盘价-LC和0较大值*SJ,7,1)/SMA(收盘价-LC的绝对值,7,1)*100
输出RSI2:SMA(收盘价-LC和0较大值*SJ,14,1)/SMA(收盘价-LC的绝对值,14,1)*100
{股票指标网 }
IF(RSI1<=1日前的RSI1,RSI1,DRAWNULL), 线宽为2,画绿色
IF(RSI1>=1日前的RSI1,RSI1,DRAWNULL), 线宽为2,画红色
IF(RSI2<=1日前的RSI2,RSI2,DRAWNULL), 线宽为2,画绿色
IF(RSI2>=1日前的RSI2,RSI2,DRAWNULL), 线宽为2,画红色
DRAWTEXT(RSI1上穿RSI2 AND RSI1<35,20,'金叉'),画洋红色
DRAWTEXT(RSI2上穿RSI1 AND RSI1>65,60,'死叉'), 画蓝色