您現在的位置:程序化交易>> 期貨公式>> 交易開拓者(TB)>> 開拓者知識>>正文內容

國外成熟策略R-Breaker分享,提供翻譯后的TB源碼,日內系統 [開拓者 TB]

  • 咨詢內容: 本帖最后由 穿堂風 于 2011-6-27 17:25 編輯

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

     

  • TB技術人員: 先上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. input:notbef(715),notaft(1229);
    9. var:{input:}f1(.35),f2(0.07),f3(.25),reverse(2.00),
    10. rangemin(1.15),xdiv(3);

    11. var:ssetup(0),bsetup(0),senter(0),benter(0),bbreak(0),sbreak(0),
    12. ltoday(0),hitoday(9999),startnow(0),div(0),
    13. rfilter(false);


    14. if currentbar=1 then startnow=0;
    15. div=maxlist(xdiv,1);
    16. if d>d[1] then begin

    17. startnow=startnow+1;

    18. ssetup=hitoday[1]+f1*(c[1]-ltoday[1]);
    19. senter=((1+f2)/2)*(hitoday[1]+c[1])-(f2)*ltoday[1];
    20. benter=((1+f2)/2)*(ltoday[1]+c[1])-(f2)*hitoday[1];
    21. bsetup=ltoday[1]-f1*(hitoday[1]-c[1]);
    22. bbreak=ssetup+f3*(ssetup-bsetup){(1.3625*hitoday[1]+.45*c[1])-.8125*ltoday[1]};
    23. sbreak=bsetup-f3*(ssetup-bsetup){(1.3625*ltoday[1]+.45*c[1])-.8125*hitoday[1]};

    24. hitoday=h;
    25. ltoday=l;

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

    27. end;

    28. if h>hitoday then hitoday=h;
    29. if l<ltoday then ltoday=l;

    30. if t>=notbef and t<notaft and startnow>=2 and rfilter and
    31. date>entrydate(1) then begin

    32. if hitoday>=ssetup and marketposition>-1 then
    33. SELL("Rlev SE") senter+(hitoday-ssetup)/div stop;
    34. if ltoday<=bsetup and marketposition<1 then
    35. BUY("Rlev LE") benter-(bsetup-ltoday)/div stop;

    36. if marketposition=-1 then
    37. BUY("RbUP LE") entryprice+reverse stop;
    38. if marketposition=1 then
    39. SELL("RbDN SE") entryprice-reverse stop;

    40. if marketposition=0 then
    41. BUY("Break LE") bbreak stop;
    42. if marketposition=0 then
    43. SELL("Break SE") sbreak stop;

    44. end;

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

    46. if marketposition=-1 then
    47. EXITSHORT("RbUP SX") entryprice+reverse stop;
    48. if marketposition=1 then
    49. EXITLONG("RbDN LX") entryprice-reverse stop;

    50. EXITSHORT("Late SX") h+.05 stop;
    51. EXITLONG("Late LX") l-.05 stop;
    52. END;
    復制代碼

     

  • TB客服: 本帖最后由 穿堂風 于 2011-6-27 17:28 編輯

    TB源碼
    1. //------------------------------------------------------------------------
    2. // 簡稱: R_Breaker
    3. // 名稱:
    4. // 類別: 公式應用
    5. // 類型: 用戶應用
    6. // 輸出: 穿堂風
    7. //------------------------------------------------------------------------

    8. /*R-Breaker*/


    9. Params
    10. Numeric notbef(9.00);
    11. Numeric notaft(14.55);
    12. Numeric f1(0.35);
    13. Numeric f2(0.07);
    14. Numeric f3(0.25);
    15. Numeric reverse(1.00);
    16. Numeric rangemin(0.2);
    17. Numeric xdiv(3);

    18. Vars
    19. NumericSeries ssetup(0);
    20. NumericSeries bsetup(0);
    21. NumericSeries senter(0);
    22. NumericSeries benter(0);
    23. NumericSeries bbreak(0);
    24. NumericSeries sbreak(0);
    25. NumericSeries ltoday(0);
    26. NumericSeries hitoday(9999);
    27. NumericSeries startnow(0);
    28. NumericSeries div(0);
    29. BoolSeries rfilter(false);
    30. Numeric i_reverse;
    31. Numeric i_rangemin;
    32. Numeric i_vB;
    33. Numeric i_vS;

    34. Begin
    35. i_reverse = reverse*(OpenD(0)/100);
    36. i_rangemin = rangemin*(OpenD(0)/100);
    37. if(BarStatus==0)
    38. {
    39.         startnow=0;
    40.         div=max(xdiv,1);
    41. }

    42. if(Date != Date[1])
    43. {
    44.         SetGlobalVar(0,0);
    45.         SetGlobalVar(1,0);
    46.         startnow=startnow+1;
    47.         ssetup=hitoday[1]+f1*(Close[1]-ltoday[1]);
    48.         senter=((1+f2)/2)*(hitoday[1]+Close[1])-(f2)*ltoday[1];
    49.         benter=((1+f2)/2)*(ltoday[1]+Close[1])-(f2)*hitoday[1];
    50.         bsetup=ltoday[1]-f1*(hitoday[1]-Close[1]);
    51.         bbreak=ssetup+f3*(ssetup-bsetup);
    52.         sbreak=bsetup-f3*(ssetup-bsetup);

    53.         hitoday=High;
    54.         ltoday=Low;

    55.         rfilter=(hitoday[1]-ltoday[1])>=i_rangemin;
    56. }

    57. if(High>hitoday)
    58. {
    59.         hitoday=High;
    60. }
    61. if(Low<ltoday)
    62. {
    63.         ltoday=Low;
    64. }
    65. if(Time*100>=notbef and Time*100<notaft and startnow>=2 and rfilter)
    66. {

    67.         if(Time != GetGlobalVar(1) and GetGlobalVar(1) != 0)
    68.         {
    69.                 SetGlobalVar(1,10000);
    70.         }
    71.         if(hitoday>=ssetup and marketposition>-1 and GetGlobalVar(1)<1)
    72.         {
    73.                 If(Low<=(senter+(hitoday-ssetup)/div))
    74.                 {
    75.                         SellShort(1,senter+(hitoday-ssetup)/div);
    76.                         SetGlobalVar(1,Time);
    77.                         Return;
    78.                 }
    79.         }
    80.         if(ltoday<=bsetup and marketposition<1  and GetGlobalVar(1)<1)
    81.         {
    82.                 If(High>=(benter-(bsetup-ltoday)/div))
    83.                 {
    84.                         Buy(1,benter-(bsetup-ltoday)/div);
    85.                         SetGlobalVar(1,Time);
    86.                         Return;
    87.                 }
    88.         }

    89.         if(marketposition==-1)
    90.         {
    91.                 SetGlobalVar(0,1);
    92.                 if(High-EntryPrice>=i_reverse)
    93.                 {
    94.                         BuyToCover(1,entryprice+i_reverse);
    95.                         Return;
    96.                 }
    97.         }
    98.         if(marketposition==1)
    99.         {
    100.                 SetGlobalVar(0,1);
    101.                 if(EntryPrice-Low>=i_reverse)
    102.                 {
    103.                         Sell(1,entryprice-i_reverse);
    104.                         Return;
    105.                 }
    106.         }

    107.         if(marketposition==0)
    108.         {
    109.                 if(High>=bbreak and GetGlobalVar(0) == 0)
    110.                 {
    111.                         Buy(1,bbreak);
    112.                         Return;
    113.                 }
    114.         }
    115.         if(marketposition==0)
    116.         {
    117.                 if(low<=sbreak  and GetGlobalVar(0) == 0)
    118.                 {
    119.                         SellShort(1,sbreak);
    120.                         Return;
    121.                 }
    122.         }

    123. }

    124. if(Time*100>=notaft and Time<0.1600)
    125. {

    126.         if(marketposition==-1)
    127.         {
    128.                 BuyToCover(1,Open);
    129.         }
    130.         if(marketposition==1)
    131.         {
    132.                 Sell(1,Open);
    133.         }

    134. }
    135. End

    136. //------------------------------------------------------------------------
    137. // 編譯版本        GS2010.12.08
    138. // 用戶版本        2011/06/27 14:29
    139. // 版權所有       
    140. // 更改聲明        TradeBlazer Software保留對TradeBlazer平臺
    141. //                        每一版本的TrabeBlazer公式修改和重寫的權利
    142. //------------------------------------------------------------------------
    復制代碼

     

  • 網友回復: 這個系統本身是用在SP上,多次出現在實盤賽的前列。
    我覺得這個系統的構架和思維非常好,直接拿著套國內商品可能表現很差,不過大家能看到這個系統的核心思想就足夠了,可以借鑒。

     

  • 網友回復: 忘了說了,得用TB V4,要不V3的系列值傳遞那還得接力一下。

 

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

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

 


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

相關文章

    指定的模型還沒有相關內容!
主站蜘蛛池模板: 中文字幕久久久| 亚洲欧美日韩天堂在线观看| 香蕉久久国产精品免| 国产精品自在拍一区二区不卡| 一本大道加勒比久久| 无遮掩60分钟从头啪到尾| 乱人伦xxxx国语对白| 欧美日韩精品国产一区二区| 免费人成无码大片在线观看| 美女裸免费观看网站| 国产区卡一卡二卡三乱码免费| 中文网丁香综合网| 国产精品视频二区不卡| aisaobi| 巨肉超污巨黄h文小短文| 久久久久久久久久久久福利| 日韩精品欧美激情国产一区| 亚洲免费综合色在线视频| 欧美黑人疯狂性受xxxxx喷水| 伊人久久精品无码麻豆一区| 美女尿口免费影视app| 国产三级精品三级在专区| 高潮毛片无遮挡高清免费视频 | 亚洲视频网站在线观看| 精品第一国产综合精品蜜芽| 国产乱人伦app精品久久| 麻豆天美精东果冻星空| 国产最新在线视频| 亚洲精品短视频| 国产精品嫩草影院在线播放| 888亚洲欧美国产VA在线播放| 国精产品wnw2544a| 99热国产精品| 在线视频国产99| 99自拍视频在线观看| 天天天天做夜夜夜做| japanese国产高清麻豆| 女性成人毛片a级| www.插插插| 太深了灬太大了灬舒服| jlzz大全高潮多水老师|