不多说,直接上效果如图:
► 日线表现
代码评估
技术指标代码评估:
用于通过各种技术指标来分析股市走势。它使用了多个自定义变量(VAR1, VAR2, VAR3, 等等),并且基于这些变量构建了复杂的条件和计算。以下是对关键部分的分析:
VAR1 和 VAR2:这些变量是基于开盘价与前一天开盘价的比较来计算的。如果当天开盘价高于前一天,则VAR1计算当天的最高价与开盘价的差值和开盘价与前一天开盘价的差值之间的最大值。类似地,如果当天开盘价低于前一天,则VAR2计算当天开盘价与最低价的差值和开盘价与前一天开盘价的差值之间的最大值。
VAR3 和 VAR4:这些是对VAR1和VAR2在过去5天的累计求和。
VAR5 和 VAR6:VAR5是一个比率,比较了VAR3和VAR4,并试图通过其差异来反映市场的动态。VAR6是VAR5的移动平均值,用于平滑数据。
指数 和 控盘:这些是条件表达式,用于生成交易信号。它们基于EMA(指数移动平均)的比较,并通过颜色编码(如COLORGREEN, COLORYELLOW)来可视化信号。
买入或持股 和 获利卖出:这些是基于以上计算的条件来确定是否应该买入、持股还是卖出。
K, D, J 指标:这些似乎是类似于随机振荡器(Stochastic Oscillator)的指标,用于衡量价格的动量。它们通过特定的平滑公式(SMA)来计算。
STICKLINE 函数:这似乎是用于绘制特定条件下的线条或标记,以帮助可视化数据和交易信号。
使用技巧
该指标通过一些列的公式计算来评估当前的波动区间,从而判断所处位置的大致风险,对于短线交易来说,是非常友好的。至于用法,长期关注我们量化交易研究所公众号的都了解,还是老规矩,我抛砖引玉,指出其中一两种,其它的大家自行探索。
而且,该指标同样适用于期货交易,
用法示例:
-
底部出现红色柱子作为买入条件
-
出现绿色柱子,作为买入条件
当然,以操作以准。
VAR1:=IF(OPEN<=REF(OPEN,1),0,MAX(HIGH-OPEN,OPEN-REF(OPEN,1)));
VAR2:=IF(OPEN>=REF(OPEN,1),0,MAX(OPEN-LOW,OPEN-REF(OPEN,1)));
VAR3:=SUM(VAR1,5);
VAR4:=SUM(VAR2,5);
VAR5:=IF(VAR3>VAR4,(VAR3-VAR4)/VAR3,IF(VAR3=VAR4,0,(VAR3-VAR4)/VAR4));
VAR6:=MA(VAR5,5);
VAR8:=IF(OPEN<=REF(OPEN,1),0,MAX(HIGH-OPEN,OPEN-REF(OPEN,1)));
VAR9:=IF(OPEN>=REF(OPEN,1),0,MAX(OPEN-LOW,OPEN-REF(OPEN,1)));
VARA:=SUM(VAR8,3);
VARB:=SUM(VAR9,3);
VARC:=IF(VARA>VARB,(VARA-VARB)/VARA,IF(VARA=VARB,0,(VARA-VARB)/VARB));
VARD:=MA(VARC,3);
指数: BARSLAST(EMA(CLOSE,5)<REF(EMA(CLOSE,5),1)), COLORGREEN;
VARE:=HHV(CLOSE,2);
VARF:=BARSLAST(VARE<REF(VARE,2));
VAR10:=IF(VARF>=1,LLV(VARE,VARF),LOW);
VAR11:=VAR10+VAR10*VARF*0.5/100;
VAR12:=IF(VAR11<REF(VAR11,1),MA(LOW,3),VAR11);
VAR13:=VAR10+VAR10*(VARF-1)*1.618/100;
控盘:= COUNT(EMA(CLOSE,5)>REF(EMA(CLOSE,5),1),5),COLORYELLOW;
VAR14:=IF(OPEN<=REF(OPEN,1),0,MAX(HIGH-OPEN,OPEN-REF(OPEN,1)));
VAR15:=IF(OPEN>=REF(OPEN,1),0,MAX(OPEN-LOW,OPEN-REF(OPEN,1)));
VAR16:=SUM(VAR8,3);
VAR17:=SUM(VAR9,3);
VAR18:=IF(VARA>VARB,(VARA-VARB)/VARA,IF(VARA=VARB,0,(VARA-VARB)/VARB));
VAR19:=MA(VARC,3);
买入或持股:= (控盘>0,指数,0,2,0), COLORRED;
STICKLINE(控盘>0,指数,0,2,0), COLORRED;
VAR1A:=IF(OPEN<=REF(OPEN,1),0,MAX(HIGH-OPEN,OPEN-REF(OPEN,1)));
VAR1B:=IF(OPEN>=REF(OPEN,1),0,MAX(OPEN-LOW,OPEN-REF(OPEN,1)));
VAR1C:=SUM(VAR8,3);
VAR1D:=SUM(VAR9,3);
VAR1E:=IF(VARA>VARB,(VARA-VARB)/VARA,IF(VARA=VARB,0,(VARA-VARB)/VARB));
VAR1F:=MA(VARC,3);
获利卖出:= (控盘>0,指数,控盘,2,1), COLORGREEN;
STICKLINE(控盘>0,指数,控盘,2,1), COLORF0F000;
VAR20:=IF(OPEN<=REF(OPEN,1),0,MAX(HIGH-OPEN,OPEN-REF(OPEN,1)));
VAR21:=IF(OPEN>=REF(OPEN,1),0,MAX(OPEN-LOW,OPEN-REF(OPEN,1)));
VAR22:=SUM(VAR8,3);
VAR23:=SUM(VAR9,3);
VAR24:=IF(VARA>VARB,(VARA-VARB)/VARA,IF(VARA=VARB,0,(VARA-VARB)/VARB));
VAR25:=MA(VARC,3);
观望: STICKLINE(控盘=0 AND 指数=0,0,1,4,1), COLORBLUE;
VAR26:=IF(OPEN<=REF(OPEN,1),0,MAX(HIGH-OPEN,OPEN-REF(OPEN,1)));
VAR27:=IF(OPEN>=REF(OPEN,1),0,MAX(OPEN-LOW,OPEN-REF(OPEN,1)));
VAR28:=SUM(VAR8,3);
VAR29:=SUM(VAR9,3);
VAR2A:=IF(VARA>VARB,(VARA-VARB)/VARA,IF(VARA=VARB,0,(VARA-VARB)/VARB));
VAR2B:=MA(VARC,3);
植被:= (控盘<指数,指数,控盘,1,0), COLOR00FF00;
STICKLINE(控盘<指数,指数,控盘,1,0), COLOR00FF00;
VAR2C:=IF(OPEN<=REF(OPEN,1),0,MAX(HIGH-OPEN,OPEN-REF(OPEN,1)));
VAR2D:=IF(OPEN>=REF(OPEN,1),0,MAX(OPEN-LOW,OPEN-REF(OPEN,1)));
VAR2E:=SUM(VAR8,3);
VAR2F:=SUM(VAR9,3);
VAR30:=IF(VARA>VARB,(VARA-VARB)/VARA,IF(VARA=VARB,0,(VARA-VARB)/VARB));
VAR31:=MA(VARC,3);
VAR32:=(CLOSE-LLV(LOW,5))/(HHV(HIGH,5)-LLV(LOW,5))*10;
K:= SMA(SMA(VAR32,2,1),2,1),COLOR00FF00 , ;
D:= SMA(SMA(SMA(VAR32,2,1),2,1),3,1), COLORYELLOW;
J:= (3*SMA(SMA(VAR32,2,1),2,1)-2*SMA(SMA(SMA(VAR32,2,1),2,1),3,1)), COLORF00FF0;
公众号:DRAWNULL,COLOR00FF00;VAR33:=IF(OPEN<=REF(OPEN,1),0,MAX(HIGH-OPEN,OPEN-REF(OPEN,1)));
VAR34:=IF(OPEN>=REF(OPEN,1),0,MAX(OPEN-LOW,OPEN-REF(OPEN,1)));
VAR35:=SUM(VAR8,3);
VAR36:=SUM(VAR9,3);
VAR37:=IF(VARA>VARB,(VARA-VARB)/VARA,IF(VARA=VARB,0,(VARA-VARB)/VARB));
VAR38:=MA(VARC,3);
量化交易研究所:DRAWNULL,COLORRED;
STICKLINE(REF(控盘,1)=0 AND 控盘>0,0,-1,2,0), COLORRED;