开拓者期货期权程序化系统交易论坛

标题: dual thrust 策略源码有问题求指点 [打印本页]

作者: zs5608    时间: 2019-6-8 12:06:44     标题: dual thrust 策略源码有问题求指点

回测螺纹钢5分钟,从2010--2018年,㫫示年化收益率为400%以上,肯定不可能,但就是找不到问题点,
求帮忙,哪位大神帮忙看看程序有什问题?谢谢!

Params
        Numeric K1(0.7);                               
        Numeric K2(0.15);                          
        Numeric Mday(1);         
        Numeric Nday(1);
        Numeric lost(1);
        Numeric offset(0);
Vars
        Numeric BuyRange(0);                       
        Numeric SellRange(0);
        Numeric BuyTrig (0);
        Numeric SellTrig(0);
        Numeric HH;
        Numeric LL;
        Numeric HC;
        Numeric LC;
        Numeric i_offset;
        Numeric BuyPosition;
        Numeric SellPosition;

Begin

        // 集合竞价和小节休息过滤
        If(!CallAuctionFilter()) Return;
       
        If(CurrentBar > 44*Max(Mday,Nday))
                       
         {
                i_offset = offset*MinMove*PriceScale;
                HH = Highest(HighD(1),Mday);
                HC = Highest(CloseD(1),Mday);
        LL = Lowest(LowD(1),Mday);
        LC = Lowest(CloseD(1),Mday);
               
      If ( ( HH - LC ) >= ( HC - LL ))
        {
                SellRange = HH - LC;
                               
           } Else  
              {
                     SellRange = HC - LL;                       
              }
            HH = Highest(HighD(1),Nday);
                HC = Highest(CloseD(1),Nday);
        LL = Lowest(LowD(1),Nday);
        LC = Lowest(CloseD(1),Nday);
          
          If ( ( HH - LC ) >= ( HC - LL ))
        {
                BuyRange = HH - LC;
                               
           } Else  
              {
                     BuyRange = HC - LL;                       
              }
          
                BuyTrig = K1*BuyRange;
                SellTrig = K2*SellRange;
                BuyPosition = OpenD(0)+ BuyTrig;
                SellPosition = OpenD(0)- SellTrig;
               
                PlotNumeric("BuyPosition",BuyPosition);
                PlotNumeric("SellPosition",SellPosition);
                       
             If( High >= BuyPosition)
                       {
                              Buy(lost,Max(Open,SellPosition)+i_offset);  // Buy(lost,Max(Open,SellPosition)+i_offset);[1]
                                  Return;
                    }  
                     If( Low <= SellPosition )
                                {
                                 SellShort(lost,Min(Open,SellPosition)-i_offset);  //SellShort(lost,Min(Open,SellPosition)-i_offset);[1]
                                Return;
                                }  
               
          }
            
       
       
        End




[attach]38078[/attach][attach]38077[/attach][attach]38076[/attach][attach]38075[/attach][attach]38075[/attach][attach]38074[/attach][attach]38073[/attach][attach]38072[/attach][attach]38071[/attach][attach]38070[/attach][attach]38069[/attach][attach]38068[/attach][attach]38067[/attach][attach]38066[/attach]



作者: tradefish    时间: 2019-7-23 17:16:15

未来函数啊老哥
作者: zs5608    时间: 2019-7-23 20:53:23

tradefish 发表于 2019-7-23 17:16
未来函数啊老哥

求指教,帮忙,未来函数在哪? 谢谢!
作者: chao1989106    时间: 2019-7-24 17:49:39

If( High >= BuyPosition)
                       {
                              Buy(lost,Max(Open,SellPosition)+i_offset);  // Buy(lost,Max(Open,SellPosition)+i_offset);[1]
                                  Return;
                    }  
                     If( Low <= SellPosition )
                                {
                                 SellShort(lost,Min(Open,SellPosition)-i_offset);  //SellShort(lost,Min(Open,SellPosition)-i_offset);[1]
                                Return;
                                }  
               
          }当价格突破BuyPosition 你能买到open或者sellposition吗?
作者: zs5608    时间: 2019-8-3 23:37:25

chao1989106 发表于 2019-7-24 17:49
If( High >= BuyPosition)
                       {
                              Buy(lost,Max(Open,Se ...

确实,谢谢!




欢迎光临 开拓者期货期权程序化系统交易论坛 (http://bbs.tb18.net/) Powered by Discuz! X2