通达信【智能箱体】炒股竟如此简单 主图指标 源码
VAR1:=EMA(CLOSE,3);
VAR2:=EMA(((SLOPE(CLOSE,22)*20)+CLOSE),55);
VAR3:=MA(VAR2,1);
VAR4:=(OPEN+HIGH+LOW)/3;
VAR5:=EMA(VAR4,4);
VAR8:=EMA(CLOSE,8);
VAR9:=NOT(REF(VAR1>REF(VAR3,1),1));
智能黄金线:VAR5,COLORYELLOW,LINETHICK1;
DRAWTEXT(VAR1>REF(VAR3,1) AND VAR9,VAR8*0.97,'★买'),COLOR00FF00;
箱顶:MA(REF(HHV(C,30),1),2),COLORD9D919,LINETHICK1;
箱底:MA(REF(LLV(C,30),1),2),COLORFFFFFF,LINETHICK1;
DRAWTEXT(L<箱底 AND VAR5>REF(VAR5,1) AND C<O,LOW*0.95,'★加仓'),COLOR00FFFF;
涨:IF(VAR1>REF(VAR3,1),VAR5,DRAWNULL),COLORRED,LINETHICK2;
平:IF(VAR1=REF(VAR3,1),VAR5,DRAWNULL),COLORRED,LINETHICK2;
跌:IF(VAR1<REF(VAR3,1),VAR5,DRAWNULL),COLORGREEN,LINETHICK2;
来函数检测结果如下:
该公式没有未来函数
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
VAR1赋值:收盘价的3日指数移动平均
VAR2赋值:EMA(((SLOPE(收盘价,22)*20)+收盘价),55)
VAR3赋值:VAR2的1日简单移动平均
VAR4赋值:(开盘价+最高价+最低价)/3
VAR5赋值:VAR4的4日指数移动平均
VAR8赋值:收盘价的8日指数移动平均
VAR9赋值:NOT(1日前的VAR1>VAR3,1))
输出智能黄金线:VAR5,画黄色,LINETHICK1
DRAWTEXT(VAR1>1日前的VAR3 AND VAR9,VAR8*0.97,'★买'),COLOR00FF00
输出箱顶:MA(REF(30日内C最高值,1),2),COLORD9D919,LINETHICK1
输出箱底:MA(REF(30日内C最低值,1),2),COLORFFFFFF,LINETHICK1
DRAWTEXT(L<箱底 AND VAR5>1日前的VAR5 AND C
输出涨:IF(VAR1>1日前的VAR3,VAR5,DRAWNULL),画红色, 线宽为2
输出平:IF(VAR1=1日前的VAR3,VAR5,DRAWNULL),画红色, 线宽为2
输出跌:IF(VAR1<1日前的VAR3,VAR5,DRAWNULL),画绿色, 线宽为2