您現(xiàn)在的位置:程序化交易>> 期貨公式>> 交易開拓者(TB)>> 開拓者公式>>正文內(nèi)容

國外成熟策略R-Breaker分享,提供翻譯后的TB源碼,日內(nèi)系統(tǒng)[開拓者公式]

  • 內(nèi)容: R-Breaker這個系統(tǒng),可能很多人比我熟悉,也更為了解,有錯誤處還請諒解
    另外我并沒實盤驗證,在信號那加入了一個邏輯鎖,用于控制實盤時有信號,但又不會多次滿足反復(fù)開倉,這個邏輯鎖我很多系統(tǒng)都會有,實戰(zhàn)很好用。

     這個系統(tǒng)本身是用在SP上,多次出現(xiàn)在實盤賽的前列。
    我覺得這個系統(tǒng)的構(gòu)架和思維非常好,直接拿著套國內(nèi)商品可能表現(xiàn)很差,不過大家能看到這個系統(tǒng)的核心思想就足夠了,可以借鑒。忘了說了,得用TB V4,要不V3的系列值傳遞那還得接力一下

  • TB源碼:
    1. //------------------------------------------------------------------------

    2. // 簡稱: R_Breaker

    3. // 名稱:

    4. // 類別: 公式應(yīng)用

    5. // 類型: 用戶應(yīng)用

    6. // 輸出: 穿堂風(fēng)分享(平臺: www.tumamayizhan.com )

    7. //------------------------------------------------------------------------

    8.  

    9. /*R-Breaker*/

    10.  //程序化交易 www.tumamayizhan.com

    11.  

    12. Params

    13. Numeric notbef(9.00);

    14. Numeric notaft(14.55);

    15. Numeric f1(0.35);

    16. Numeric f2(0.07);

    17. Numeric f3(0.25);

    18. Numeric reverse(1.00);

    19. Numeric rangemin(0.2);

    20. Numeric xdiv(3);

    21.  

    22. Vars

    23. NumericSeries ssetup(0);

    24. NumericSeries bsetup(0);

    25. NumericSeries senter(0);

    26. NumericSeries benter(0);

    27. NumericSeries bbreak(0);

    28. NumericSeries sbreak(0);

    29. NumericSeries ltoday(0);

    30. NumericSeries hitoday(9999);

    31. NumericSeries startnow(0);

    32. NumericSeries div(0);

    33. BoolSeries rfilter(false);

    34. Numeric i_reverse;

    35. Numeric i_rangemin;

    36. Numeric i_vB;

    37. Numeric i_vS;

    38.  

    39. Begin

    40. i_reverse = reverse*(OpenD(0)/100);

    41. i_rangemin = rangemin*(OpenD(0)/100);

    42. if(BarStatus==0)

    43. {

    44.         startnow=0;

    45.         div=max(xdiv,1);

    46. }

    47.  

    48. if(Date != Date[1])

    49. {

    50.         SetGlobalVar(0,0);

    51.         SetGlobalVar(1,0);

    52.         startnow=startnow+1;

    53.         ssetup=hitoday[1]+f1*(Close[1]-ltoday[1]);

    54.         senter=((1+f2)/2)*(hitoday[1]+Close[1])-(f2)*ltoday[1];

    55.         benter=((1+f2)/2)*(ltoday[1]+Close[1])-(f2)*hitoday[1];

    56.         bsetup=ltoday[1]-f1*(hitoday[1]-Close[1]);

    57.         bbreak=ssetup+f3*(ssetup-bsetup);

    58.         sbreak=bsetup-f3*(ssetup-bsetup);

    59.  

    60.         hitoday=High;

    61.         ltoday=Low;

    62.  

    63.         rfilter=(hitoday[1]-ltoday[1])>=i_rangemin;

    64. }

    65.  

    66. if(High>hitoday)

    67. {

    68.         hitoday=High;

    69. }

    70. if(Low<ltoday)

    71. {

    72.         ltoday=Low;

    73. }

    74. if(Time*100>=notbef and Time*100<notaft and startnow>=2 and rfilter)

    75. {

    76.  

    77.         if(Time != GetGlobalVar(1) and GetGlobalVar(1) != 0)

    78.         {

    79.                 SetGlobalVar(1,10000);

    80.         }

    81.         if(hitoday>=ssetup and marketposition>-1 and GetGlobalVar(1)<1)

    82.         {

    83.                 If(Low<=(senter+(hitoday-ssetup)/div))

    84.                 {

    85.                         SellShort(1,senter+(hitoday-ssetup)/div);

    86.                         SetGlobalVar(1,Time);

    87.                         Return;

    88.                 }

    89.         }

    90.         if(ltoday<=bsetup and marketposition<1  and GetGlobalVar(1)<1)

    91.         {

    92.                 If(High>=(benter-(bsetup-ltoday)/div))

    93.                 {

    94.                         Buy(1,benter-(bsetup-ltoday)/div);

    95.                         SetGlobalVar(1,Time);

    96.                         Return;

    97.                 }

    98.         }

    99.  

    100.         if(marketposition==-1)

    101.         {

    102.                 SetGlobalVar(0,1);

    103.                 if(High-EntryPrice>=i_reverse)

    104.                 {

    105.                         BuyToCover(1,entryprice+i_reverse);

    106.                         Return;

    107.                 }

    108.         }

    109.         if(marketposition==1)

    110.         {

    111.                 SetGlobalVar(0,1);

    112.                 if(EntryPrice-Low>=i_reverse)

    113.                 {

    114.                         Sell(1,entryprice-i_reverse);

    115.                         Return;

    116.                 }

    117.         }

    118.  

    119.         if(marketposition==0)

    120.         {

    121.                 if(High>=bbreak and GetGlobalVar(0) == 0)

    122.                 {

    123.                         Buy(1,bbreak);

    124.                         Return;

    125.                 }

    126.         }

    127.         if(marketposition==0)

    128.         {

    129.                 if(low<=sbreak  and GetGlobalVar(0) == 0)

    130.                 {

    131.                         SellShort(1,sbreak);

    132.                         Return;

    133.                 }

    134.         }

    135.  

    136. }

    137.  

    138. if(Time*100>=notaft and Time<0.1600)

    139. {

    140.  

    141.         if(marketposition==-1)

    142.         {

    143.                 BuyToCover(1,Open);

    144.         }

    145.         if(marketposition==1)

    146.         {

    147.                 Sell(1,Open);

    148.         }

    149.  

    150. }

    151. End

    152.  

    153. //------------------------------------------------------------------------

    154. // 編譯版本        GS2010.12.08

    155. // 用戶版本        2011/06/27 14:29

    156. // 版權(quán)所有       

    157. // 更改聲明        TradeBlazer Software保留對TradeBlazer平臺

    158. //                        每一版本的TrabeBlazer公式修改和重寫的權(quán)利

    159. //------------------------------------------------------------------------

     












 

  • TS源碼:
    1. {R-Breaker}

    2. {***********SystemSetup*******************

    3. Trading between 9:15 and 14:29 ChicagoTime only

    4. MMStop $1000

    5. Close End of Day

    6. 10 min Time Frame

    7. ******************************************}

    8.  

    9.  

    10. input:notbef(715),notaft(1229);

    11. var:{input:}f1(.35),f2(0.07),f3(.25),reverse(2.00),

    12. rangemin(1.15),xdiv(3);

    13.  

    14. var:ssetup(0),bsetup(0),senter(0),benter(0),bbreak(0),sbreak(0),

    15. ltoday(0),hitoday(9999),startnow(0),div(0),

    16. rfilter(false);

    17.  

    18.  

    19. if currentbar=1 then startnow=0;

    20. div=maxlist(xdiv,1);

    21. if d>d[1] then begin

    22.  

    23. startnow=startnow+1;

    24.  

    25. ssetup=hitoday[1]+f1*(c[1]-ltoday[1]);

    26. senter=((1+f2)/2)*(hitoday[1]+c[1])-(f2)*ltoday[1];

    27. benter=((1+f2)/2)*(ltoday[1]+c[1])-(f2)*hitoday[1];

    28. bsetup=ltoday[1]-f1*(hitoday[1]-c[1]);

    29. bbreak=ssetup+f3*(ssetup-bsetup){(1.3625*hitoday[1]+.45*c[1])-.8125*ltoday[1]};

    30. sbreak=bsetup-f3*(ssetup-bsetup){(1.3625*ltoday[1]+.45*c[1])-.8125*hitoday[1]};

    31.  

    32. hitoday=h;

    33. ltoday=l;

    34.  

    35. rfilter=hitoday[1]-ltoday[1]>=rangemin;

    36.  

    37. end;

    38.  

    39. if h>hitoday then hitoday=h;

    40. if l<ltoday then ltoday=l;

    41.  

    42. if t>=notbef and t<notaft and startnow>=2 and rfilter and

    43. date>entrydate(1) then begin

    44.  

    45. if hitoday>=ssetup and marketposition>-1 then

    46. SELL("Rlev SE") senter+(hitoday-ssetup)/div stop;

    47. if ltoday<=bsetup and marketposition<1 then

    48. BUY("Rlev LE") benter-(bsetup-ltoday)/div stop;

    49.  

    50. if marketposition=-1 then

    51. BUY("RbUP LE") entryprice+reverse stop;

    52. if marketposition=1 then

    53. SELL("RbDN SE") entryprice-reverse stop;

    54.  

    55. if marketposition=0 then

    56. BUY("Break LE") bbreak stop;

    57. if marketposition=0 then

    58. SELL("Break SE") sbreak stop;

    59.  

    60. end;

    61.  

    62. if t>=notaft and t<>sess1endtime then begin

    63.  

    64. if marketposition=-1 then

    65. EXITSHORT("RbUP SX") entryprice+reverse stop;

    66. if marketposition=1 then

    67. EXITLONG("RbDN LX") entryprice-reverse stop;

    68.  

    69. EXITSHORT("Late SX") h+.05 stop;

    70. EXITLONG("Late LX") l-.05 stop;

    71. END;
    復(fù)制代碼

     

 

 

有思路,想編寫各種指標公式,程序化交易模型,選股公式,預(yù)警公式的朋友

可聯(lián)系技術(shù)人員 QQ: 262069696  點擊在線交流進行 有償 編寫!不貴!點擊查看價格!

 


【字體: 】【打印文章】【查看評論

相關(guān)文章

    沒有相關(guān)內(nèi)容
  主站蜘蛛池模板: 日韩电影免费在线| 精品国产不卡一区二区三区| 国产精品电影在线| a级片免费视频| 性xxxxfreexxxxx国产| 久久强奷乱码老熟女网站| 欧美人与动性xxxxx杂性| 亚洲精品国产第1页| 秦91在线播放第3集全球直播| 国产一区二区不卡老阿姨| 91香蕉视频成人| 国产精品你懂得| 91看片淫黄大片一级在线观看| 女性特黄一级毛片| 国产一区日韩二区欧美三区| 久久久久亚洲精品无码系列| 樱桃视频高清免费观看在线播放 | 成全动漫视频在线观看免费高清| 久久精品视频7| 欧美18www| 亚洲人成网亚洲欧洲无码| 欧美日韩电影网| 亚洲欧美高清在线| 波多野结衣在线观看一区| 人碰人碰人成人免费视频| 精品一区二区三区自拍图片区| 四名学生毛还没长齐在线视频| 色综合天天综合网站中国| 国产伦精品一区二区免费| 高清国产美女一级毛片| 国产成人h片视频在线观看| 精品久久久久久蜜臂a∨| 国产激情久久久久影院小草 | 亚洲а∨精品天堂在线| 欧美性巨大欧美| 亚洲国产精品白丝在线观看 | 国产又黄又爽又猛的免费视频播放 | 久久久久久久91精品免费观看| 日本边添边摸边做边爱的视频| 久久精品一区二区三区av| 日韩精品人妻系列无码专区|