您现在的位置:程序化交易>> 期货公式>> 交易开拓者(TB)>> 开拓者知识>>正文内容

信号闪现,是什么原因老师回测非常好 [开拓者 TB]

  • 咨询内容: Params
    Numeric ceilingAmt(30);
         Numeric floorAmt(60);
         Numeric bolBandTrig(2);
       
    Vars
         Numeric lookBackDays(20);         
         Numeric todayVolatility(0);
         Numeric yesterDayVolatility(0);
         Numeric deltaVolatility(0);
         NumericSeries buyPoint(0);
         NumericSeries sellPoint(0);
         NumericSeries longLiqPoint(0);
         NumericSeries shortLiqPoint(0);
         Numeric upBand(0);
         Numeric dnBand(0);
         Numeric MidLine(0);
         Numeric Band(0);
    Begin
         todayVolatility = StandardDev(Close[1],30,1);
         yesterDayVolatility = StandardDev(Close[1],30,1);
         deltaVolatility = (todayVolatility - yesterDayVolatility)/todayVolatility;
         lookBackDays = lookBackDays * (1 + deltaVolatility);
         lookBackDays = Round(lookBackDays,0);
         lookBackDays = Min(lookBackDays,ceilingAmt);
         lookBackDays = Max(lookBackDays,floorAmt);
         MidLine = AverageFC(Close[1],lookBackDays);
         Band = StandardDev(Close[1],lookBackDays,bolBandTrig);
         upBand = MidLine + bolBandTrig * Band;
         dnBand = MidLine - bolBandTrig * Band;
         buyPoint = Highest(High[1],lookBackDays);
         sellPoint = Lowest(Low[1],lookBackDays);
         longLiqPoint = Average(Close[1],lookBackDays);
         shortLiqPoint = Average(Close[1],lookBackDays);

    if(Close > upBand)  
    {
        If(CrossOver(high,buyPoint))   
       {
          Buy(1,max( buyPoint, Low ));

       }
    Commentary("多头触发价:"+Text(buyPoint));

    }

    if(Close < dnBand)
    {

        If(CrossUnder(Low,sellPoint ))
        {
           SellShort(1,min( sellPoint , High ));
        }
    Commentary("空头触发价:"+Text(sellPoint));

    }
    if(MarketPosition == 1)
    {  
        If(CrossUnder(Low,longLiqPoint ))
        {
           Sell(1,min( longLiqPoint , High ));
        }
    Commentary("多头退出:"+Text(longLiqPoint));
    }




    if(MarketPosition == -1)

    {
        If(CrossOver(high,shortLiqPoint))   
       {
          BuyToCover(1,max( shortLiqPoint, Low ));
       }
    Commentary("多头退出:"+Text(shortLiqPoint));

    }


    End

 

有思路,想编写各种指标公式,交易模型,选股公式,还原公式的朋友

可联系技术人员 QQ: 262069696  点击在线交流或微信号:cxh99cxh99  进行 有偿收费 编写!

怎么收费,代编流程等详情请点击阅读!

(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)


【字体: 】【打印文章】【查看评论

相关文章

    没有相关内容