同花顺短线精灵副图指标 提示顶部底部危险信号 源码
VAR1:=((CLOSE-MA(CLOSE,6))/MA(CLOSE,6)*100+(CLOSE-MA(CLOSE,24))/MA(CLOSE,24)*100+(CLOSE-MA(CLOSE,32))/MA(CLOSE,32)*100)/3;
持币区域:IF(VAR1<0,ABS(VAR1),0),COLORFEDCBA;
持股区域:IF(VAR1>0,VAR1,0),colorred;
STICKLINE(VAR1>9 AND FILTER(VAR1<REF(VAR1,1),5),VAR1+2,0,5,0),colorblue;//短顶
DRAWTEXT(VAR1>9 AND FILTER(VAR1<REF(VAR1,1),5),VAR1+2,'---短顶'),colorblue;
STICKLINE(VAR1>20 AND FILTER(VAR1<REF(VAR1,1),5),VAR1+8,0,7,0),colorgreen;//大顶
DRAWTEXT(VAR1>20 AND FILTER(VAR1<REF(VAR1,1),5),VAR1+8,'---大顶'),colorgreen;
VAR2:=HHV(VAR1>20,10);
STICKLINE(VAR2 AND CROSS((REF(HIGH,1)+REF(LOW,1))/2,MA(CLOSE,20)+2*STD(CLOSE,20)),VAR1+15,0,4,0),colorcyan;//危险
DRAWTEXT(VAR2 AND CROSS((REF(HIGH,1)+REF(LOW,1))/2,MA(CLOSE,20)+2*STD(CLOSE,20)),VAR1+15,'---危险'),colorcyan;
STICKLINE(VAR2 AND FILTER(VAR1<REF(VAR1,1),6) AND CROSS(MA(CLOSE,5),MA(CLOSE,2)),VAR1+6,0,3,0),colorgray;//注意止损
DRAWTEXT(VAR2 AND FILTER(VAR1<REF(VAR1,1),6) AND CROSS(MA(CLOSE,5),MA(CLOSE,2)),VAR1+6,'---止损'),colorgray;
STICKLINE(VAR1<-9 AND VAR1>REF(VAR1,1),VAR1-2,0,3,0),colorred;//短底
DRAWTEXT(VAR1<-9 AND VAR1>REF(VAR1,1),VAR1+8,'---短底'),colorred;
STICKLINE(VAR1<-20 AND FILTER(VAR1>REF(VAR1,1),5),VAR1-8,0,7,0),coloryellow;//大底
DRAWTEXT(VAR1<-20 AND FILTER(VAR1>REF(VAR1,1),5),VAR1-8,'---大底'),coloryellow;
买入准备:IF(VAR1<-9 AND VAR1>REF(VAR1,1),1,0),colorblue;
来函数检测结果如下:
该公式没有未来函数
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
VAR1赋值:((收盘价-收盘价的6日简单移动平均)/收盘价的6日简单移动平均*100+(收盘价-收盘价的24日简单移动平均)/收盘价的24日简单移动平均*100+(收盘价-收盘价的32日简单移动平均)/收盘价的32日简单移动平均*100)/3
输出持币区域:IF(VAR1<0,VAR1的绝对值,0),COLORFEDCBA
如果VAR1>0返回VAR1否则返回0
STICKLINE(VAR1>9 AND FILTER(VAR1<1日前的VAR1,5),VAR1+2,0,5,0), 画蓝色
//短顶DRAWTEXT(VAR1>9 AND FILTER(VAR1<1日前的VAR1,5),VAR1+2,'---短顶'), 画蓝色
STICKLINE(VAR1>20 AND FILTER(VAR1<1日前的VAR1,5),VAR1+8,0,7,0),画绿色
//大顶DRAWTEXT(VAR1>20 AND FILTER(VAR1<1日前的VAR1,5),VAR1+8,'---大顶'),画绿色
VAR2赋值:10日内VAR1>20最高值
STICKLINE(VAR2 AND CROSS((1日前的最高价+1日前的最低价)/2,收盘价的20日简单移动平均+2*收盘价的20估算标准差),VAR1+15,0,4,0),画青色
//危险DRAWTEXT(VAR2 AND CROSS((1日前的最高价+1日前的最低价)/2,收盘价的20日简单移动平均+2*收盘价的20估算标准差),VAR1+15,'---危险'),画青色
STICKLINE(VAR2 AND FILTER(VAR1<1日前的VAR1,6) AND CROSS(收盘价的5日简单移动平均,收盘价的2日简单移动平均),VAR1+6,0,3,0),COLORGRAY
//注意止损DRAWTEXT(VAR2 AND FILTER(VAR1<1日前的VAR1,6) AND CROSS(收盘价的5日简单移动平均,收盘价的2日简单移动平均),VAR1+6,'---止损'),COLORGRAY
STICKLINE(VAR1<-9 AND VAR1>1日前的VAR1,VAR1-2,0,3,0),画红色
//短底DRAWTEXT(VAR1<-9 AND VAR1>1日前的VAR1,VAR1+8,'---短底'),画红色
STICKLINE(VAR1<-20 AND FILTER(VAR1>1日前的VAR1,5),VAR1-8,0,7,0),画黄色
//大底DRAWTEXT(VAR1<-20 AND FILTER(VAR1>1日前的VAR1,5),VAR1-8,'---大底'),画黄色
输出买入准备:IF(VAR1<-9 AND VAR1>1日前的VAR1,1,0), 画蓝色