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

開拓者TB CXH99反應趨勢交易系統(RTS)即The Reaction Trend System 源碼 [開拓者 TB]

  •  最近市場可能比較震蕩,農產品有許多震蕩交易系統比較適用!所以在研究反應趨勢交易系統(RTS)即The Reaction Trend System 由J.WELLES WILDER發明。本人粗糙簡略地寫了下代碼:


    1. Params

    2.         Numeric NumATRs(1);

    3.         Numeric ATRLength(10);

    4.         //Track Stop Profit or Loss

    5.         Numeric StopATRLength(10);

    6.         Numeric StopLossPcnt(3);     //價格止損控制

    7.         Numeric InitialStop(2);     // 初始止損          

    8.         Numeric BreakEvenStop(2);   // 保本止損         

    9.         Numeric TrailStop(2);       // 追蹤止損,回撤ATR的倍數       

    10.         //PriceOffset

    11.         Numeric Offset(10);       

    12. Vars

    13.         NumericSeries TPrice;

    14.         //Track Stop Loss or Profit

    15.         NumericSeries HigherAfterEntry;

    16.         NumericSeries LowerAfterEntry;

    17.         NumericSeries HighestAfterEntry;

    18.         NumericSeries LowestAfterEntry;

    19.         BoolSeries          bLongTrailingStoped;

    20.         BoolSeries          bShortTrailingStoped;

    21.         Numeric       MyExitPrice;                          // Exit Market Price

    22.         //Stop Position

    23.         Numeric       MyPrice;

    24.         Numeric       MinPoint;               // 一個最小變動單位,也就是一跳

    25.         Numeric       StopLine;

    26.         Numeric       StopLossBuffSet(15);    //止損位Buffer

    27.         NumericSeries ATRValue;               //記錄ATR值

    28.         Numeric       PriceOffset;                          //Buy or Sell Price Buffer

    29.         //RTS Variables

    30.         Numeric HBOP;  //高價突破點

    31.         Numeric LBOP;  //低價突破點

    32.         Numeric SellPoint;  //賣點

    33.         Numeric BuyPoint;  //買點

    34. Begin

    35.         //Price Offset

    36.         PriceOffset = Offset * MinMove * PriceScale;

    37.        

    38.         //Track Stop Profit or Loss

    39.         MinPoint = MinMove*PriceScale;

    40.         ATRValue = AvgTrueRange(StopATRLength);

    41.        //  www.tumamayizhan.com

    42.         //KeltnerChannel Variables

    43.         TPrice = (High[1] + Low[1] + Close[1])/3;

    44.         HBOP = 2 * TPrice - 2 * Low[1] + High[1];

    45.         LBOP = 2 * TPrice - 2 * High[1] + Low[1];

    46.         SellPoint = TPrice * 2 - Low[1];   // Sell Point

    47.         BuyPoint = TPrice * 2 - High[1]; //Buy Point

    48.  

    49.         PlotNumeric("HBOP",HBOP);

    50.         PlotNumeric("LBOP",LBOP);

    51.         PlotNumeric("SellPoint", SellPoint);

    52.         PlotNumeric("BuyPoint", BuyPoint);

    53.        

    54.         If (Open < HBOP And Open > LBOP)

    55.         {

    56.                 //Long Futures High greater than UpperBand

    57.                 If(MarketPosition != 1 And High > BuyPoint)

    58.                 {

    59.                         MyPrice = BuyPoint;

    60.                         If(Open > MyPrice) MyPrice = Open;

    61.                         //Buy(1, Q_BidPrice + PriceOffset);

    62.                         //Buy(1, MyPrice + PriceOffset);

    63.                         SellShort(1, MyPrice - PriceOffset);

    64.                 }

    65.                 //Short Futures Low less than LowerBand

    66.                 If(MarketPosition != -1 And Low < SellPoint)

    67.                 {

    68.                         MyPrice = SellPoint;               

    69.                         If(Open < MyPrice) MyPrice = Open;

    70.                         //SellShort(1, Q_AskPrice - PriceOffset);

    71.                         //SellShort(1, MyPrice - PriceOffset);

    72.                         Buy(1, MyPrice + PriceOffset);

    73.                        

    74.                 }

    75.                

    76.         }  Else If(Open > HBOP) {

    77.                 //Long Futures High greater than UpperBand

    78.                 If(MarketPosition != 1)

    79.                 {

    80.                         MyPrice =  HBOP;

    81.                         If(Open > MyPrice) MyPrice = Open;

    82.                         //Buy(1, Q_BidPrice + PriceOffset);

    83.                         Buy(1, MyPrice + PriceOffset);

    84.                 }

    85.         } Else If(Open < LBOP) {

    86.                 //Short Futures Low less than LowerBand

    87.                 If(MarketPosition != -1)

    88.                 {

    89.                         MyPrice = LBOP;               

    90.                         If(Open < MyPrice) MyPrice = Open;

    91.                         //SellShort(1, Q_AskPrice - PriceOffset);

    92.                         SellShort(1, MyPrice - PriceOffset);

    93.                 }       

    94.         }

    95.  

    96.         /* Set Loss Postion */

    97.         MinPoint = MinMove * PriceScale;

    98.         Myprice = EntryPrice * (1 - StopLossPcnt * 0.01);

    99.         If(MarketPosition==1 and Low <= Myprice and BarsSinceEntry>0)

    100.         {

    101.                 Myprice=Min(Myprice,Open);

    102.                 Sell(0, Myprice - stopLossBuffSet * MinPoint);

    103.                 Commentary("Price Pcnt Stop Loss");

    104.         }

    105.         Myprice = EntryPrice * (1 + StopLossPcnt * 0.01);

    106.         If(MarketPosition==-1 and High>=Myprice and BarsSinceEntry>0)

    107.         {

    108.                 Myprice=Max(Myprice,Open);

    109.                 BuyToCover(0, Myprice + stopLossBuffSet * MinPoint);

    110.                 Commentary("Price Pcnt Stop Loss");

    111.         }

    112.         /* Set Loss Postion */

    113. End

 

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

可聯系技術人員 QQ: 1145508240  有需要幫忙請點擊這里留言!!!進行 有償 編寫!不貴!點擊查看價格!


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

相關文章

    沒有相關內容
主站蜘蛛池模板: 欧美乱子欧美猛男做受视频伦xxxx96| 野花视频在线官网免费1| 教官你的太大了芊芊h| 亚洲国产高清美女在线观看| 美女扒开粉嫩尿口的漫画| 国产福利一区二区在线观看| www天堂在线| 日本人在线看片| 亚洲日韩乱码久久久久久| 精品国产亚洲第一区二区三区| 国产手机在线视频| 97视频资源总站| 成人无码嫩草影院| 久久这里只精品热免费99| 波多野结衣乱码中文字幕| 四虎影视免费永久在线观看 | 欧美日韩高清在线| 午夜影放免费观看| 香蕉视频在线精品| 国产精品情侣呻吟对白视频| 一个人看的www高清频道免费 | 色综合天天综合中文网| 国产欧美视频在线观看| 99久久国产综合精品swag| 性欧美wideos| 久久久精品电影| 欧美亚洲人成网站在线观看| 人人妻人人澡人人爽曰本| 美女福利视频一区二区| 国产尹人香蕉综合在线电影| 538在线视频观看| 天天综合色天天综合| 中文字幕亚洲欧美在线不卡| 日韩亚洲欧美综合| 亚洲一区二区三区在线| 毛片视频免费观看| 免费一级毛片清高播放| 美雪艾莉丝番号| 国产亚洲美女精品久久久| 人人澡人人爽人人| 国产精品美女久久久网av|