通达信潜伏操盘副指标支持手机电脑版公式副图源码
VAR1:=MA(C,5);
VAR2:=MA(C,10);
VAR3:=MA(C,20);
VAR4:=MA(C,60);
VAR5:=ABS(VAR1-VAR2)+ABS(VAR2-VAR3)+ABS(VAR1-VAR3);
VAR6:=IF(VAR5/C< 6/100,2,0);
VAR7:=VOL/REF(MA(VOL,5),1);
VAR8:=EMA(CLOSE,12)-EMA(CLOSE,26);
VAR9:=EMA(VAR8,9);
MACD:=2*(VAR8-VAR9);
X_1:=IF(CROSS(VAR8,VAR9) AND MACD>REF(MACD,1),1,0);
X_2:=IF(CROSS(VAR8,VAR9) AND VAR8< 0 AND VAR9< 0 AND MACD>REF(MACD,1),1,0);
X_3:=IF(VAR8>0 AND VAR9>0 AND CROSS(VAR8,VAR9) AND MACD>REF(MACD,1),1,0);
X_4:=IF(VOL< REF(LLV(VOL,150),1),1.5,0);
X_5:=IF(VOL< REF(LLV(VOL,120),1),1.2,0);
X_6:=IF(VOL< REF(LLV(VOL,90),1),0.9,0);
X_7:=IF(VOL< REF(LLV(VOL,60),1),0.6,0);
X_8:=IF(VOL< REF(LLV(VOL,40),1),0.4,0);
X_9:=IF(X_2=1 AND REF(EXIST(X_2=1,40),12) AND (VAR9>REF(VAR9,12) OR VAR9>REF(VAR9,13)
OR VAR9>REF(VAR9,14) OR VAR9>REF(VAR9,15) OR VAR9>REF(VAR9,16) OR VAR9>REF(VAR9,17)
OR VAR9>REF(VAR9,18) OR VAR9>REF(VAR9,19) OR VAR9>REF(VAR9,20) OR VAR9>REF(VAR9,21)
OR VAR9>REF(VAR9,22) OR VAR9>REF(VAR9,23) OR VAR9>REF(VAR9,24) OR VAR9>REF(VAR9,25)
OR VAR9>REF(VAR9,26)),1,0);
X_10:=IF((EXIST(X_4=1.5,12) OR EXIST(X_5=1.2,12) OR EXIST(X_6=0.9,12)) AND X_1,1,0);
X_11:=IF((EXIST(X_4=1.5,12) OR EXIST(X_5=1.2,12) OR EXIST(X_6=0.9,12)) AND X_1,1,0);
X_12:=IF((EXIST(X_5=1.2,10) OR EXIST(X_6=0.9,10) OR EXIST(X_7=0.6,10) OR EXIST(X_8=0.4,10)) AND X_1,1,0);
一潜伏:X_10 AND X_2 AND (X_9 OR REF(X_9,1)) AND VAR7>1,COLORLIRED,NODRAW;
STICKLINE(一潜伏,0,1.5,2,0),COLORLIRED;
二加仓:X_11 AND C< VAR4*1.2 AND VAR7>2.2,COLORRED,NODRAW;
STICKLINE(二加仓,0,1.2,4,0),COLORRED;
SANJ:=(VAR4>REF(VAR4,1) AND REF(VAR4,1)>REF(VAR4,2)) AND (VAR1>REF(VAR1,1) AND VAR2>REF(VAR2,1) AND VAR3>REF(VAR3,1));
三警惕:X_12 AND X_3 AND (VAR6 OR REF(VAR6,1)) AND SANJ AND C>VAR1 AND VAR1>VAR4 AND VAR3>VAR4 AND EXIST(VAR1< VAR3,5) AND VAR7>2,COLORYELLOW,NODRAW;
STICKLINE(三警惕,0,1,6,0),COLORYELLOW;
来函数检测结果如下:
该公式没有未来函数
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
VAR1赋值:C的5日简单移动平均
VAR2赋值:C的10日简单移动平均
VAR3赋值:C的20日简单移动平均
VAR4赋值:C的60日简单移动平均
VAR5赋值:VAR1-VAR2的绝对值+ABS(VAR2-VAR3)+ABS(VAR1-VAR3)
如果VAR5/C< 6/100返回2否则返回0
VAR7赋值:成交量/REF(成交量的5日简单移动平均,1)
VAR8赋值:收盘价的12日指数移动平均-收盘价的26日指数移动平均
VAR9赋值:VAR8的9日指数移动平均
MACD赋值:2*(VAR8-VAR9)
X_1赋值:IF(VAR8上穿VAR9 AND MACD>1日前的MACD,1,0)
X_2赋值:IF(VAR8上穿VAR9 AND VAR8< 0 AND VAR9< 0 AND MACD>1日前的MACD,1,0)
X_3赋值:IF(VAR8>0 AND VAR9>0 AND VAR8上穿VAR9 AND MACD>1日前的MACD,1,0)
X_4赋值:IF(成交量< REF(150日内成交量最低值,1),1.5,0)
X_5赋值:IF(成交量< REF(120日内成交量最低值,1),1.2,0)
X_6赋值:IF(成交量< REF(90日内成交量最低值,1),0.9,0)
X_7赋值:IF(成交量< REF(60日内成交量最低值,1),0.6,0)
X_8赋值:IF(成交量< REF(40日内成交量最低值,1),0.4,0)
X_9赋值:IF(X_2=1 AND 12日前的最近40日存在X_2=1 AND (VAR9>12日前的VAR9 OR VAR9>13日前的VAR9
OR VAR9>14日前的VAR9 OR VAR9>15日前的VAR9 OR VAR9>16日前的VAR9 OR VAR9>17日前的VAR9
OR VAR9>18日前的VAR9 OR VAR9>19日前的VAR9 OR VAR9>20日前的VAR9 OR VAR9>21日前的VAR9
OR VAR9>22日前的VAR9 OR VAR9>23日前的VAR9 OR VAR9>24日前的VAR9 OR VAR9>25日前的VAR9
OR VAR9>26日前的VAR9),1,0)
X_10:=IF((最近12日存在X_4=1.5 OR 最近12日存在X_5=1.2 OR 最近12日存在X_6=0.9) AND X_1,1,0)
X_11:=IF((最近12日存在X_4=1.5 OR 最近12日存在X_5=1.2 OR 最近12日存在X_6=0.9) AND X_1,1,0)
X_12:=IF((最近10日存在X_5=1.2 OR 最近10日存在X_6=0.9 OR 最近10日存在X_7=0.6 OR 最近10日存在X_8=0.4) AND X_1,1,0)
输出一潜伏:X_10 AND X_2 AND (X_9 OR 1日前的X_9) AND VAR7>1,COLORLIRED,NODRAW
当满足条件一潜伏时,在0和1.5之间画柱状线
输出二加仓:X_11 AND C< VAR4*1.2 AND VAR7>2.2,画红色,NODRAW
当满足条件二加仓时,在0和1.2之间画柱状线
SANJ赋值:(VAR4>1日前的VAR4 AND 1日前的VAR4>2日前的VAR4) AND (VAR1>1日前的VAR1 AND VAR2>1日前的VAR2 AND VAR3>1日前的VAR3)
输出三警惕:X_12 AND X_3 AND (VAR6 OR 1日前的VAR6) AND SANJ AND C>VAR1 AND VAR1>VAR4 AND VAR3>VAR4 AND 最近5日存在VAR1< VAR3 AND VAR7>2,画黄色,NODRAW
当满足条件三警惕时,在0和1之间画柱状线