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

标题: 【没有】【源码】沪深300股指_日内震荡 [打印本页]

作者: 小平常心    时间: 2014-5-4 10:20:23     标题: 【没有】【源码】沪深300股指_日内震荡

本帖最后由 小平常心 于 2014-5-28 17:26 编辑

沪深300股指_日内震荡_全自动交易系统
5.1后倾情放送学习性代码。
原版弱爆了,哈哈

重要提示:若要实盘,后果自负!
[attach]29153[/attach]
[attach]29149[/attach]

2388        RN1        多头        IF888        2014/04/21 09:27        2205.4        2014/04/21 11:12        2229.4        1        100.00        7100.00        4125780.00        10.73%        5070.69%
2389        RN1        多头        IF888        2014/04/21 14:07        2211.2        2014/04/21 14:21        2206.0        1        100.00        (1660.00)        4124120.00        (2.50%)        5068.18%
2390        RN1        空头        IF888        2014/04/21 14:21        2206.0        2014/04/21 15:10        2179.0        1        100.00        8000.00        4132120.00        12.09%        5080.27%
2391        RN1        多头        IF888        2014/04/22 13:25        2175.8        2014/04/22 13:32        2170.6        1        100.00        (1660.00)        4130460.00        (2.54%)        5077.73%
2392        RN1        空头        IF888        2014/04/22 13:32        2170.6        2014/04/22 13:53        2175.8        1        100.00        (1660.00)        4128800.00        (2.55%)        5075.18%
2393        RN1        多头        IF888        2014/04/22 13:53        2175.8        2014/04/22 15:10        2192.6        1        100.00        4940.00        4133740.00        7.57%        5082.75%
2394        RN1        空头        IF888        2014/04/23 10:30        2191.8        2014/04/23 15:10        2185.2        1        100.00        1880.00        4135620.00        2.86%        5085.61%
2395        RN1        空头        IF888        2014/04/24 10:30        2193.4        2014/04/24 15:10        2179.8        1        100.00        3980.00        4139600.00        6.05%        5091.66%
2396        RN1        空头        IF888        2014/04/25 09:27        2191.8        2014/04/25 15:10        2169.2        1        100.00        6680.00        4146280.00        10.16%        5101.81%
2397        RN1        多头        IF888        2014/04/28 10:02        2153.6        2014/04/28 10:37        2148.4        1        100.00        (1660.00)        4144620.00        (2.57%)        5099.24%
2398        RN1        空头        IF888        2014/04/28 10:37        2148.4        2014/04/28 15:10        2144.4        1        100.00        1100.00        4145720.00        1.71%        5100.95%
2399        RN1        多头        IF888        2014/04/29 13:39        2141.8        2014/04/29 14:42        2154.8        1        100.00        3800.00        4149520.00        5.91%        5106.87%


作者: 小平常心    时间: 2014-5-4 10:21:42

本帖最后由 小平常心 于 2014-5-4 11:04 编辑

说明
应用商品:IF888
使用周期:7分钟K线,
测试区间:2010.4-2014.04.30
手续费:1手手续费100
滑点设置:程序设置为+-1个最小价位

不相信贴图的话,设置以上参数后进行测试即可。
不多说,一切均在源码中!

[attach]29151[/attach]
[attach]29150[/attach]
[attach]29152[/attach]
作者: 小平常心    时间: 2014-5-4 10:27:26

本帖最后由 小平常心 于 2014-5-14 10:22 编辑

预留,将在这里贴源码:
            
学习要快, 阅后即焚。   


作者: 小平常心    时间: 2014-5-4 10:30:19

本帖最后由 小平常心 于 2014-5-4 10:36 编辑

感谢 xiaowumm 公布的 “TB屠龙刀股指7分钟趋势交易策略”
以上升级版是在此基础上修改的。说明一下出处。

http://bbs.tb18.net/thread-38521-1-1.html

Params   
        Numeric Lots(0.00);
        Numeric splitrate(0.00);   
        Numeric TradeBegin(9.20);  
        Numeric LastTrade(14.56);
        Numeric TradeClose(15.10);
        Numeric DalayTicks(0.00);
Vars
        NumericSeries a0;
        NumericSeries a1;
        NumericSeries a2;
        NumericSeries a3;
        NumericSeries a4;
        NumericSeries a5;
        NumericSeries a6;
        NumericSeries a7;
        NumericSeries a8;
        NumericSeries a9;
        NumericSeries a10;
        NumericSeries a11;
        NumericSeries a12;
        NumericSeries a13;
        NumericSeries a14;
        NumericSeries a15;
        NumericSeries a16;
        NumericSeries a17;
        NumericSeries a18;
        NumericSeries a19;
        NumericSeries a20;
        NumericSeries a21;
        NumericSeries a22;
        NumericSeries a23;
        NumericSeries a24;
        NumericSeries a25;
        NumericSeries a26;
        NumericSeries a27;
        String s0("a");
        String s1("b");
        String s2("c");
        String s3("d");
        String s4("e");
        String s5("f");
        String s6("g");
        String s7("h");
        String s8("i");
        String s9("j");
        String s10("k");
        String s11("l");
        String s12("m");
        String s13("n");
        String s14("o");
        String s15("p");
        String s16("q");
        String s17("r");
        String s18("s");
        String s19("t");
        String s20("u");
        String s21("v");
        String s22("w");
        String s23("x");
        String s24("y");
        String s25("z");
        String s26("0");
        String s27("1");
        String s28("2");
        String s29("3");
        String s30("4");
        String s31("5");
        String s32("6");
        String s33("7");
        String s34("8");
        String s35("9");
        String s36("10");
        String s37("11");
        String s38("12");
        String s39("13");
        String s40("14");
        String s41("15");
        String s42("16");
        String s43("17");
        String s44("18");
        String s45("19");
        String s46("20");
        String s47("21");
        String s48("22");
        String s49("23");
        String s50("24");
        String s51("25");
        String s52("26");
        String s53("27");
        String s54("28");
        String s55("29");
        String s56("30");
        String s57("31");
        String s58("_");
        Bool Bo_101;
        Numeric xx_1010;
        Numeric xx_1020;
        Bool Bo_102;
        Bool Bo_103;
        Bool Bo_104;
        Numeric xx_1040;
        Numeric xx_1070;
        Numeric xx_1030;


Begin
        if (((Time == 0.0915) or (Time == 0.0916)))         
        {
         SetGlobalVar(20,0);
        }
        if ((CurrentDate >= 20130811) and (GetGlobalVar(20) <> 1) and (H > 0) and (Time >= 0.1455))         
        {
                 PlotString("DQ","",(H * 1.008),Yellow,15);
                 SetGlobalVar(20,1);
        }
        
        Bo_101=(BarsSinceToday() == 0);
        if (Bo_101)         
        {
                a26=0;
        }

        a9=AverageFC(Close[1],6);
        a10=AverageFC(Close[1],23);
        a11=AverageFC(Close[1],6);
        a12=AverageFC(Close[1],25);
        a3=AverageFC(Close[1],17);
        a4=StandardDev(Close[1],17,2);
        a1=((a4 * 1.88) + a3);
        a2=(a3 - (a4 * 1.88));
        a18=Summation(Max(Max((High - Low),Abs((High - Close[1]))),Abs((Low - Close[1]))),23);
        a19=(High - High[1]);
        a20=(Low[1] - Low);
        a21=Summation(IIF((a19 > 0) and (a19 > a20),a19,0),23);
        a22=Summation(IIF((a20 > 0) and (a20 > a19),a20,0),23);
        a23=((a21 * 100) / a18);
        a24=((a22 * 100) / a18);
        a25=Average(((Abs((a24 - a23)) / (a24 + a23)) * 100),12);
        if ((0 == 1))         
        {
                 PlotNumeric("1",a9);
                 PlotNumeric("2",a10);
                 PlotNumeric("3",a11);
                 PlotNumeric("4",a12);
                 PlotNumeric("5",a1);
                 PlotNumeric("6",a2);
        }
        Bo_102=CrossOver(a9,a10);
        Bo_101=CrossUnder(a9,a10);
        Bo_103=CrossOver(a11,a12);
        Bo_104=CrossUnder(a11,a12);
        xx_1040=GetGlobalVar(0);
        xx_1070=GetGlobalVar(1);
        if ((BarStatus == 2) and (xx_1040 <> Time))         
        {
                  xx_1040=Time;  
                  xx_1070=0;  
        }
        if ((Time == (TradeClose / 100)) and (MarketPosition <> 0))         
        {
                 if ((MarketPosition == -1))         
                 {
                        BuyToCover(Abs(CurrentContracts),((PriceScale * (MinMove * splitrate)) + Open));
                 }
                 if ((MarketPosition == 1))         
                 {
                        Sell(Abs(CurrentContracts),(Open - (PriceScale * (MinMove * splitrate))));
                 }
        }
        else
        {
                if ((Time >= (TradeBegin / 100)))         
                {
                        if ((MarketPosition == 0) and (a4 >= 1.9) and (Time <= (LastTrade / 100)) and (a26 < 6))         
                        {
                                if ((High[1] > a1) and (Open > (a1 - 3.8)) and (Open <= High[1]))         
                                {
                                        SellShort(Lots,(Open - (PriceScale * (MinMove * splitrate))));
                                }
                   else
                   {   
                                if ((Low[1] < a2) and (Open < (a2 + 3)) and (a25[1]   < 42))         
                                {
                                        Buy(Lots,((PriceScale * (MinMove * splitrate)) + Open));
                                }
                   }
        }
作者: 小平常心    时间: 2014-5-4 10:30:36

else
        {   
                if ((MarketPosition == 1) and (BarsSinceLastEntry >= 1))         
                {
                        a13=(Open - EntryPrice);  
                        if (Bo_104 or (Close[1] < (AvgEntryPrice - 13.8)))         
                        {      
                                if ((Close[1] < (AvgEntryPrice - 13.8)))         
                                {
                                        Sell(Abs(CurrentContracts),(Open - (PriceScale * (MinMove * splitrate))));         
                                        if ((0 == 5))         
                                        {
                                                Commentary("平多=" + Text(1));         
                                        }
                                        a26=(a26 + 1);
                                        if ((xx_1070 == 0))         
                                        {
                                                xx_1070=1;  
                                        }
                                        else
                                        {      
                                                if ((xx_1070 < DalayTicks))         
                                                {
                                                        xx_1070=(xx_1070 + 1);  
                                                }
                                                else
                                                {        
                                                        if ((Time <= (LastTrade / 100)) and (a26 < 6) and ((a2[1]   - a2) <= 5))         
                                                        {
                                                                SellShort(Lots,(Open - (PriceScale * (MinMove * splitrate))));         
                                                        }
                                                        if ((0 == 5))         
                                                        {
                                                                Commentary("开空=" + Text(2));         
                                                        }
                                                }
                                        }
                                }
                 else
                 {      
                        if ((a13 >= 0))         
                        {
                                Sell(Abs(CurrentContracts),(Open - (PriceScale * (MinMove * splitrate))));         
                                if ((0 == 5))         
                                {
                                        Commentary("平多=" + Text(2));         
                                }
                                a26=0;
                        }
                        else
                        {      
                                if ((a13 < 0))         
                                {
                                        Sell(Abs(CurrentContracts),(Open - (PriceScale * (MinMove * splitrate))));         
                                        if ((0 == 5))         
                                        {
                                                Commentary("平多=" + Text(3));         
                                        }
                                        a26=(a26 + 1);
                                        if ((xx_1070 == 0))         
                                        {
                                                xx_1070=1;  
                                        }
                                        else
                                        {        
                                                if ((xx_1070 < DalayTicks))         
                                                {
                                                        xx_1070=(xx_1070 + 1);  
                                                }
                                        else
                                        {         
                                                if ((Time <= (LastTrade / 100)) and (a26 < 6) and ((a2[1]   - a2) <= 5))         
                                                {
                                                        SellShort(Lots,(Open - (PriceScale * (MinMove * splitrate))));         
                                                }
                                                if ((0 == 5))         
                                                {
                                                        Commentary("开空=" + Text(3));         
                                                }
                                        }
                                }
                   }
                  }
                 }
                }      
作者: 小平常心    时间: 2014-5-4 10:30:50

else
                {        
                 if (Bo_101 and (Close[1] > AvgEntryPrice))         
                 {
                  Sell(Abs(CurrentContracts),(Open - (PriceScale * (MinMove * splitrate))));         
                  if ((0 == 5))         
                  {
                   Commentary("平多=" + Text(4));         
                  }
                  a26=0;

                 }
                }        
           }
           else
           {    if ((MarketPosition == -1) and (BarsSinceLastEntry > 1))         
                {
           
                  a13=(EntryPrice - Open);  
                  if ((Close[1] > (AvgEntryPrice + 13.8)) or Bo_103)         

        {      
                  if ((Close[1] > (AvgEntryPrice + 13.8)))         
                  {  
                   BuyToCover(Abs(CurrentContracts),((PriceScale * (MinMove * splitrate)) + Open));         
                   if ((0 == 5))         
                   {
                        Commentary("平空=" + Text(1));         
                   }
                   a26=(a26 + 1);
                   if ((xx_1070 == 0))         
                   {
                        xx_1070=1;  
                   }
                   else
                   {        if ((xx_1070 < DalayTicks))         
                        {
                         xx_1070=(xx_1070 + 1);  
                        }
                        else
                        {         if ((Time <= (LastTrade / 100)) and (a26 < 6) and ((a1 - a1[1]  ) <= 5.6))         
                         {
                          Buy(Lots,((PriceScale * (MinMove * splitrate)) + Open));         
                         }
                         if ((0 == 5))         
                         {
                          Commentary("开多=" + Text(2));         
                         }
                        }
                   }
                  }
                  else
                  {       if ((a13 >= 1.4))         
                   {
                        BuyToCover(Abs(CurrentContracts),((PriceScale * (MinMove * splitrate)) + Open));         
                        if ((0 == 5))         
                        {
                         Commentary("平空=" + Text(2));         
                        }
                        a26=0;

                   }
                   else
                   {        if ((a13 < 1.4))         
                        {
                         BuyToCover(Abs(CurrentContracts),((PriceScale * (MinMove * splitrate)) + Open));         
                         if ((0 == 5))         
                         {
                          Commentary("平空=" + Text(3));         
                         }
                         a26=(a26 + 1);

                         if ((xx_1070 == 0))         
                         {
                          xx_1070=1;  
                         }
                         else
                         {          if ((xx_1070 < DalayTicks))         
                          {
                           xx_1070=(xx_1070 + 1);  
                          }
                          else
                          {           if ((Time <= (LastTrade / 100)) and (a26 < 6) and ((a1 - a1[1]  ) <= 5.6))         
                           {
                                Buy(Lots,((PriceScale * (MinMove * splitrate)) + Open));         
                           }
                           if ((0 == 5))         
                           {
                                Commentary("开多=" + Text(3));         
                           }
                          }
                         }
                        }
                   }
                  }
                 }      


                 else
                 {        
                  if (Bo_102 and (Close[1] < AvgEntryPrice))         
                  {
                   BuyToCover(Abs(CurrentContracts),((PriceScale * (MinMove * splitrate)) + Open));         
                   if ((0 == 5))         
                   {
                        Commentary("平空=" + Text(4));         
                   }
                   a26=0;
                  }
                 }        
                }
           }
          }
          if ((MarketPosition == 1) and (BarsSinceEntry == 0))         
          {
                a14=High;  

          }
          if ((MarketPosition == 1) and (BarsSinceEntry >= 1))         
          {
                a14=Max(a14,High);  

          }
          if ((MarketPosition == -1) and (BarsSinceEntry == 0))         
          {
                a15=Low;  

          }
          if ((MarketPosition == -1) and (BarsSinceEntry >= 1))         
          {
                a15=Min(a15,Low);  

          }
作者: 小平常心    时间: 2014-5-4 10:31:05


if ((BarsSinceEntry >= 1) and (MarketPosition == 1))         
          {
                 a13=(a14[1]   - EntryPrice);  

           if ((BarsSinceEntry >= 5) and ((Close[5] - Open[5]) < 0) and ((Close[4] - Open[4]) < 0) and ((Close[3] - Open[3]) < 0) and (a13 >= 12))         
           {
                Sell(Abs(CurrentContracts),(Open - (PriceScale * (MinMove * splitrate))));
                if ((0 == 5))         
                {
                 Commentary("平多=" + Text(21));
                }
                a26=0;
           }
           if((BarsSinceEntry >= 2) and (((High[2] - Max(Close[2],Open[2])) / Abs((Close[2] - Open[2]))) > 27) and (Abs((Close[2] - Open[2])) > 0) and (a13 >= 12))
           {
                Sell(Abs(CurrentContracts),(Open - (PriceScale * (MinMove * splitrate))));
                if ((0 == 5))         
                {
                 Commentary("平多=" + Text(22));
                }
                a26=0;
           }
           if ((BarsSinceEntry > 3) and (a13 < 2) and (Close[1] < EntryPrice))         
           {
                Sell(Abs(CurrentContracts),(Open - (PriceScale * (MinMove * splitrate))));
                if ((0 == 5))         
                {
                 Commentary("平多=" + Text(23));
                 Commentary("myopenprofit23=" + Text(a13));
                }
                a26=(a26 + 1);

                if ((xx_1070 == 0))         
                {
                 xx_1070=1;  
                }
                else
                {     if ((xx_1070 < DalayTicks))         
                 {
                  xx_1070=(xx_1070 + 1);  
                 }
                 else
                 {      if ((Time <= (LastTrade / 100)) and (a26 < 6) and ((a2[1]   - a2) <= 5))         
                  {
                   SellShort(Lots,(Open - (PriceScale * (MinMove * splitrate))));
                  }
                  if ((0 == 5))         
                  {
                   Commentary("开空=" + Text(231));
                  }
                 }
                }
           }
           if ((BarsSinceEntry >= 2) and (((High[1] - Low[4]) * 0.25) > 21.6))         
           {
                Sell(Abs(CurrentContracts),(Open - (PriceScale * (MinMove * splitrate))));
                if ((0 == 5))         
                {
                 Commentary("平多=" + Text(24));
                }

                a26=0;
           }
           if((BarsSinceEntry >= 2) and (a13 > 28) and ((Close[2] - Open[2]) > 3.4) and (Open[1] >= Close[2]) and ((Min(Close[2],Open[2]) - Close[1]) > 2.8))
           {

                Sell(Abs(CurrentContracts),(Open - (PriceScale * (MinMove * splitrate))));
                if ((0 == 5))         
                {
                 Commentary("平多=" + Text(25));
                }
         
                a26=0;
           }
           if ((BarsSinceEntry > 4) and (a13 >= 29) and (Low <= (EntryPrice + 19)))         
           {
                  Sell(Abs(CurrentContracts),((EntryPrice + 19) - (PriceScale * (MinMove * splitrate))));
                if ((0 == 5))         
                {
                 Commentary("平多=" + Text(252));
                }

           }
          }
          else
          {   if ((BarsSinceEntry >= 1) and (MarketPosition == -1))         
           {
               
                 a13=(EntryPrice - a15[1]  );  

                if ((BarsSinceEntry >= 3) and ((Close[5] - Open[5]) > 0) and ((Close[4] - Open[4]) > 0) and ((Close[3] - Open[3]) > 0) and (a13 >= 26))         
                {

                 BuyToCover(Abs(CurrentContracts),((PriceScale * (MinMove * splitrate)) + Open));
                 if ((0 == 5))         
                 {
                  Commentary("平空=" + Text(31));
                 }

                 a26=0;
                }
                if((((Min(Close[1],Open[1]) - Low[1]) / Abs((Close[1] - Open[1]))) > 25) and (((Min(Close[1],Open[1]) - Low[1]) / (High[1] - Max(Close[1],Open[1]))) > 2.1) and (Abs((Close[1] - Open[1])) > 0) and (a13 >= 26))
                {

                 BuyToCover(Abs(CurrentContracts),((PriceScale * (MinMove * splitrate)) + Open));
                 if ((0 == 5))         
                 {
                  Commentary("平空=" + Text(32));
                 }
         
                 a26=0;
                }
                if ((BarsSinceEntry >= 5) and (a13 < 0) and ((Close[1] - EntryPrice) > 0))         
                {

                 BuyToCover(Abs(CurrentContracts),((PriceScale * (MinMove * splitrate)) + Open));
                 if ((0 == 5))         
                 {
                  Commentary("平空=" + Text(33));
                  Commentary("myopenprofit33=" + Text(a13));
                 }
                 a26=(a26 + 1);

                 if ((xx_1070 == 0))         
                 {
                  xx_1070=1;  
                 }
                 else
                 {      if ((xx_1070 < DalayTicks))         
                  {
                   xx_1070=(xx_1070 + 1);  
                  }
                  else
                  {       if ((Time <= (LastTrade / 100)) and (a26 < 6) and ((a1 - a1[1]  ) <= 5.6))         
                   {
         
                        Buy(Lots,((PriceScale * (MinMove * splitrate)) + Open));
                   }
                   if ((0 == 5))         
                   {
                        Commentary("开多=" + Text(331));
                   }
                  }
                 }
                }
                if ((BarsSinceEntry > 6) and ((Open[1] + 2.4) < Close[1]) and (((High[4] - Low[2]) / 3) > 15))         
                {
         
                 BuyToCover(Abs(CurrentContracts),((PriceScale * (MinMove * splitrate)) + Open));
                 if ((0 == 5))         
                 {
                  Commentary("平空=" + Text(34));
                 }
           
                 a26=0;
                }
                if ((BarsSinceEntry > 5) and ((High - EntryPrice) > 18) and (a13 >= 9))         
                {
         
                 BuyToCover(Abs(CurrentContracts),((PriceScale * (MinMove * splitrate)) + (EntryPrice + 19)));
                 if ((0 == 5))         
                 {
                  Commentary("平空=" + Text(35));
                 }
                 a26=(a26 + 1);
         
                }
                if ((BarsSinceEntry > 5) and (a13 >= 30) and (High >= (EntryPrice - 16)))         
                {

                 BuyToCover(Abs(CurrentContracts),((PriceScale * (MinMove * splitrate)) + (EntryPrice - 16)));
                 if ((0 == 5))         
                 {
                  Commentary("平空=" + Text(352));
                 }

                 a26=0;
                }
                if ((BarsSinceEntry > 7) and (Close[1] >= EntryPrice) and (a13 >= 23))         
                {
         
                 BuyToCover(Abs(CurrentContracts),((PriceScale * (MinMove * splitrate)) + Open));
                 if ((0 == 5))         
                 {
                  Commentary("平空=" + Text(36));
                 }
                 a26=(a26 + 1);

                }
                if ((BarsSinceEntry >= 3) and ((Close[5] - Open[5]) > 2) and ((Close[4] - Open[4]) > 1.4) and ((Close[3] - Open[3]) > 7) and ((Close[1] - EntryPrice) > 3) and (a13 > 2))         
                {

                 BuyToCover(Abs(CurrentContracts),((PriceScale * (MinMove * splitrate)) + Open));
                 if ((0 == 5))         
                 {
                  Commentary("平空=" + Text(37));
                 }
                a26=0;
                }
           }
          }

         }
        }

作者: 小平常心    时间: 2014-5-4 10:31:17

   xx_1010=AvgEntryPrice;
        if ((BarsSinceEntry >= 1) and (MarketPosition > 0) and (Low < (AvgEntryPrice - 19)) and ((PositionProfit+(Lots * 5700)) < 0) and (Time >= (TradeBegin / 100)) and (Time <= (LastTrade / 100)))         
        {
                  xx_1030=(xx_1010 - 19);  
         Sell(Abs(CurrentContracts),(Min(Open,xx_1030) - (PriceScale * (MinMove * splitrate))));
         if ((0 == 5))         
         {
          Commentary("平多=" + Text(51));
         }
         a26=(a26 + 1);

         a0=(a0 + 1);

         if ((xx_1070 == 0))         
         {
          xx_1070=1;  
         }
         else
         {  if ((xx_1070 < DalayTicks))         
          {
           xx_1070=(xx_1070 + 1);  
          }
          else
          {   if ((a26 < 6) and ((a2[1]   - a2) <= 5))         
           {
                SellShort(Lots,(Min(Open,xx_1030) - (PriceScale * (MinMove * splitrate))));
                if ((0 == 5))         
                {
                 Commentary("开空=" + Text(52));
                }
           }
          }
         }
        }
        else
        { if ((BarsSinceEntry >= 1) and (MarketPosition < 0) and (High > (AvgEntryPrice + 19)) and ((PositionProfit+(Lots * 5700)) < 0) and (Time >= (TradeBegin / 100)) and (Time <= (LastTrade / 100)))         
         {
                   xx_1030=(xx_1010 + 19);      
           BuyToCover(Abs(CurrentContracts),(Max(Open,xx_1030) + (PriceScale * (MinMove * splitrate))));
          if ((0 == 5))         
          {
           Commentary("平空=" + Text(53));
          }
          a26=(a26 + 1);
          a0=(a0 + 1);
          if ((xx_1070 == 0))         
          {
           xx_1070=1;  
          }
          else
          {   if ((xx_1070 < DalayTicks))         
           {
                xx_1070=(xx_1070 + 1);  
           }
           else
           {    if ((a26 < 6) and ((a1 - a1[1]  ) <= 5.6))         
                {
                 Buy(Lots,(Max(Open,xx_1030) + (PriceScale * (MinMove * splitrate))));
                }
                if ((0 == 5))         
                {
                 Commentary("开多=" + Text(54));
                }
           }
          }
         }
        }
        if ((0 == 5))         
        {
         Commentary("FailSafecnt=" + Text(a0));
         Commentary("浮盈=" + Text(ContractProfit));
         Commentary("PositionProfit=" + Text(PositionProfit));
         if (Bo_103)         
         {
          Commentary("金叉a3a4");
         }
         if (Bo_102)         
         {
          Commentary("金叉a1a2");
         }
         if (Bo_104)         
         {
          Commentary("死叉a3a4");
         }
         if (Bo_101)         
         {
          Commentary("死叉a1a2");
         }
         Commentary("Portfolio_TotalProfit=" + Text(Portfolio_TotalProfit));
         Commentary("Portfolio_NetProfit=" + Text(Portfolio_NetProfit));
        }
        SetGlobalVar(0,xx_1040);
        SetGlobalVar(1,xx_1070);

End
作者: 小平常心    时间: 2014-5-4 11:03:21

好东西不要错过,此源码属学习程序化,骗人,居家必备利器!
作者: 天空之城    时间: 2014-5-4 18:39:54

楼主好样的。
作者: yebenli    时间: 2014-5-4 18:51:15

顶一个
作者: 89578251    时间: 2014-5-4 19:14:37

是参数优化后的结果?
作者: 趋势跟踪    时间: 2014-5-4 20:00:33

学习了。
楼主大公无私贴出源码,可敬!
作者: 天空之城    时间: 2014-5-4 21:34:58

话说,看到帖子的名字下意识想到“屠龙宝刀,点击就送!”......
作者: 还在路上    时间: 2014-5-4 22:19:02

  if ((BarsSinceEntry >= 1) and (MarketPosition > 0) and (Low <= (AvgEntryPrice - 05)) and ((PositionProfit+(Lots * 1500)) < 0))
作者: pozzipang    时间: 2014-5-5 10:48:54

屠龙宝刀,爆仓利器,杀人于无形之中!
作者: cjqh661143    时间: 2014-5-5 14:15:27

本帖最后由 cjqh661143 于 2014-5-5 15:24 编辑

大赞!


顺便提个意见

         if ((BarsSinceEntry >= 1) and (MarketPosition < 0) and (High >= (AvgEntryPrice + 05)) and ((PositionProfit+(Lots * 1500)) < 0))         
         {
                 xx_1030=(xx_1010 + 05);      
                 BuyToCover(Lots,(Max(Open,xx_1030) + i_offset));

                if (((UpLine - UpLine[1]  ) <= 5.6) and (Time <= 0.1456))         
                 {
                Buy(Lots,(Max(Open,xx_1030) + i_offset));
                 }
         }

代码中平仓反手部分
PositionProfit应用上涉及未来函数
信号闪烁
作者: 趋势跟踪    时间: 2014-5-5 17:57:08

本帖最后由 趋势跟踪 于 2014-5-5 18:00 编辑
cjqh661143 发表于 2014-5-5 14:15
大赞!


今天测试了一下,平仓反手时确实信号闪烁,请楼主再修改一下。

作者: 89578251    时间: 2014-5-5 21:15:24

趋势跟踪 发表于 2014-5-5 17:57
今天测试了一下,平仓反手时确实信号闪烁,请楼主再修改一下。

是的,我测试了,的确会信号闪烁。望楼主再修改一下。
作者: 89578251    时间: 2014-5-6 10:05:20

cjqh661143 发表于 2014-5-5 14:15
大赞!

你修正一下吧。
作者: 趋势跟踪    时间: 2014-5-7 07:20:20

小平常心 发表于 2014-5-4 10:27
预留,将在这里贴源码:
            
学习要快, 阅后即焚。   

请问楼主,这两个参数”Numeric Nnn1(5);  Numeric Nnn2(20);“在主程序里没用到呀?
作者: gentlly    时间: 2014-5-7 21:06:37

本帖最后由 gentlly 于 2014-5-7 21:19 编辑

个人觉得有点偷价格的嫌疑
作者: liuzifanok    时间: 2014-5-16 10:37:21

谢谢
作者: liv_13    时间: 2014-5-26 17:24:48

还在路上 发表于 2014-5-4 22:19
if ((BarsSinceEntry >= 1) and (MarketPosition > 0) and (Low

(Low <= (AvgEntryPrice - 05)) 和 ((PositionProfit+(Lots * 1500)) < 0) 想表达的意思应该一样,都是每手止损5个点,但PositionProfit+(Lots * 1500)) < 0) 这个条件是按close价格来计算的PositionProfit,其实有Low<=(AvgEntryPrice-5)就完全够了,加上这个有点故意的嫌疑,修正之后根本没法用。。。
不过前面一系列a参数倒是值得学习
作者: bobrow    时间: 2014-5-28 10:35:55

此人编码能力很低,逻辑混乱,东拼西凑。
作者: 小平常心    时间: 2014-5-28 16:52:06

bobrow 发表于 2014-5-28 10:35
此人编码能力很低,逻辑混乱,东拼西凑。

真热情,潜水这么多年,你终于安奈不住冒了个泡。

问一下,源码你看到没有?

要不你给大家分享一个高水平的原创策略代码吧,让大家开一下眼界?
作者: 小平常心    时间: 2014-5-28 16:53:55

[attach]29480[/attach]
作者: 小平常心    时间: 2014-5-28 17:05:28

还在路上 发表于 2014-5-4 22:19
if ((BarsSinceEntry >= 1) and (MarketPosition > 0) and (Low


高手,第一个,一看就看出问题之所在了
作者: 小平常心    时间: 2014-5-28 17:10:22

就一个条件,PositionProfit函数,结果完全不同。

圣杯可以很多,圣杯可以没有!这是一个很好的例子。

所以个人建议,没弄清TB内部函数以前,最好别用。
作者: 小平常心    时间: 2014-5-28 17:14:05

本帖最后由 小平常心 于 2014-5-28 17:19 编辑

5.14 已经删除源码了,

第一次看到xiaowumm 公布的 “TB屠龙刀股指7分钟趋势交易策略”,感到头晕
于是把它化简,把没用的都去掉了。
此策略虽有问题,但策略的入场,出场思路还是值得借鉴的
学习一下还是挺好的。但把模型拿出来卖,来骗人就不好了。仅表个人看法

再次感谢 xiaowumm 公布的 “TB屠龙刀股指7分钟趋势交易策略”
此升级版是在此基础上修改的。说明一下出处。

http://bbs.tb18.net/thread-38521-1-1.html
作者: 小平常心    时间: 2014-5-28 17:27:44

趋势跟踪 发表于 2014-5-7 07:20
请问楼主,这两个参数”Numeric Nnn1(5);  Numeric Nnn2(20);“在主程序里没用到呀? ...

没有用,当初优化参数用的。
作者: 小平常心    时间: 2014-5-28 17:29:08

小平常心 发表于 2014-5-4 11:03
好东西不要错过,此源码属学习程序化,骗人,居家必备利器!

没有了
作者: 小平常心    时间: 2014-5-28 17:30:06

liv_13 发表于 2014-5-26 17:24
(Low

总有人能看到有用的部分
作者: 小平常心    时间: 2014-5-28 17:31:33

bobrow 发表于 2014-5-28 10:35
此人编码能力很低,逻辑混乱,东拼西凑。

总有人没看到、或看也没看、或没看明白就发表高见!
作者: bobrow    时间: 2014-5-29 07:48:03

小平常心 发表于 2014-5-28 16:52
真热情,潜水这么多年,你终于安奈不住冒了个泡。

问一下,源码你看到没有?

自然看过源码,全篇注释、修改过才来发言。我有没有高水平的代码,跟我有没有发言的权利不矛盾吧?潜水多年偶尔来看看更偶尔地回个帖有问题?你用得着这么猴急么?你倒是说说他的代码亮点在什么地方?
作者: 小平常心    时间: 2014-5-29 10:54:09

bobrow 发表于 2014-5-29 07:48
自然看过源码,全篇注释、修改过才来发言。我有没有高水平的代码,跟我有没有发言的权利不矛盾吧?潜水多 ...

有货就直接贴源码。还TM发言的权利,你TM简直是故意找茬。

还“全篇注释”,贴出来瞧瞧(源码中我是一句都没注释的),怀疑此人可能是卖模型的马甲。

我编程能力低,这天机都被你知道了,你知道太多了。你乱讲是权利,我猴急也是TM的权利
作者: 小平常心    时间: 2014-5-29 10:54:47

有货就直接贴源码,废什么话哦:
作者: bobrow    时间: 2014-5-29 10:57:06

本帖最后由 bobrow 于 2014-5-29 10:59 编辑
小平常心 发表于 2014-5-29 10:54
有货就直接贴源码。还TM发言的权利,你TM简直是故意找茬。

还“全篇注释”,贴出来瞧瞧(源码中我是一句 ...


不要发怒。帖部分出来。

小问题:
        1. 判断当天第一根K线的逻辑太绕了,逻辑性不强
        2. 是否显示注释信息的代码效率底下,使用一个变量控制会更好
        3. 第一行用到时间判断的逻辑,在7分钟K线上永远不会生效。还好这不影响策略主题逻辑。
        4. 逻辑判断能力较低。else if可以解决的,他先else再if。再比如“if (Bo_104 or (Close[1] < (AvgEntryPrice - 13.8))) { ”之后的逻辑,冗余繁琐
……
……

大问题:
        1. 变量命名不规范
        2. a25从代码层面看值越大,向上和向下力道差异越大,上下分歧;值越小,上下力道差不多。但用在开多条件上,有些莫名其妙
        3. 多空开仓条件不同,拟合可能性大
        4. 很多逻辑直接用到固定参数,比如均线周期、布林上下轨的1.88倍数,开仓条件里的1.9/3.8/3/42等,拟合可能性大
        5. a9-a12四根均线,a9与a11相同周期,a10与a12相差2。a9与a10,a11与a12,两组均线金叉死叉差异有多少?
……
……

更多的我就不贴了,这策略不能用。
作者: 小平常心    时间: 2014-5-29 11:03:20

哎哟,你打字好快哦,3分钟打怎么多

果然真有心!

有货就直接贴源码,给大伙分享一个,废什么话哦
作者: bobrow    时间: 2014-5-29 11:09:00

小平常心 发表于 2014-5-29 11:03
哎哟,你打字好快哦,3分钟打怎么多

果然真有心!

不多说了,就此结束。
作者: 小平常心    时间: 2014-5-29 11:14:17

我逻辑判断为0,因为我就化简一下下面代码而已,
所以你说的小问题,大问题我不评论,要不你看看化简前的,再TM发言吧
http://bbs.tb18.net/thread-38521-1-1.html

你TM这叫故意,叫针对人不对事,还TM讲什么权利?

有货就直接贴源码吧,给大伙分享一个,
还TM小问题,大问题,谁不知道?!还TM废话怎么多哦
作者: 小平常心    时间: 2014-5-29 11:16:23

bobrow 发表于 2014-5-29 10:57
不要发怒。帖部分出来。

小问题:

收藏一下
作者: 小平常心    时间: 2014-5-29 11:16:36

收藏一下

不要发怒。帖部分出来。

小问题:
        1. 判断当天第一根K线的逻辑太绕了,逻辑性不强
        2. 是否显示注释信息的代码效率底下,使用一个变量控制会更好
        3. 第一行用到时间判断的逻辑,在7分钟K线上永远不会生效。还好这不影响策略主题逻辑。
        4. 逻辑判断能力较低。else if可以解决的,他先else再if。再比如“if (Bo_104 or (Close[1] < (AvgEntryPrice - 13.8))) { ”之后的逻辑,冗余繁琐
……
……

大问题:
        1. 变量命名不规范
        2. a25从代码层面看值越大,向上和向下力道差异越大,上下分歧;值越小,上下力道差不多。但用在开多条件上,有些莫名其妙
        3. 多空开仓条件不同,拟合可能性大
        4. 很多逻辑直接用到固定参数,比如均线周期、布林上下轨的1.88倍数,开仓条件里的1.9/3.8/3/42等,拟合可能性大
        5. a9-a12四根均线,a9与a11相同周期,a10与a12相差2。a9与a10,a11与a12,两组均线金叉死叉差异有多少?
……
……

更多的我就不贴了,这策略不能用。
作者: 小平常心    时间: 2014-5-29 11:17:48

你这叫啥,把我好心当什么来着?
作者: 随水谁    时间: 2014-5-29 16:08:40

小平常心 发表于 2014-5-29 11:17
你这叫啥,把我好心当什么来着?

平常心啊平常心
作者: 小平常心    时间: 2014-5-30 09:06:09

本帖最后由 小平常心 于 2014-5-30 09:55 编辑

恩,就这样吧

阿弥那个陀佛!




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