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

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

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


    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的倍數(shù)       

    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

 

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

可聯(lián)系技術(shù)人員 QQ: 1145508240  有需要幫忙請點擊這里留言?。。? title=進行 有償 編寫!不貴!點擊查看價格!


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

相關(guān)文章

    沒有相關(guān)內(nèi)容
主站蜘蛛池模板: 亚洲无吗在线视频| 国产农村妇女精品一二区| 人人妻人人澡人人爽欧美一区九九 | 欧美成人三级一区二区在线观看| 国产福利一区二区三区在线视频| 久久久久波多野结衣高潮| 精品国产乱码一区二区三区麻豆| 夜夜偷天天爽夜夜爱| 亚洲国产精品久久网午夜 | 日本人强jizzjizz| 成年黄网站色大免费全看| 亚洲黄网在线观看| 国产精品婷婷久青青原| 在线观看精品国产福利片100 | 深夜福利视频网站| 国产成人精品免费久久久久| 一级片在线播放| 欧美日韩一区二区三区麻豆 | 久久99国产精品久久99果冻传媒 | 免费黄色毛片视频| 老色鬼久久综合第一| 手机在线看片你懂的| 人人妻人人澡人人爽欧美一区| 色戒7分27秒大尺度在线| 在线中文字幕网站| 中国一级特黄特色**毛片| 欧美成人免费在线视频| 免费看一级毛片| 日本亚洲精品色婷婷在线影院| 夜夜偷天天爽夜夜爱| 一级视频免费观看| 日本大片免费一级| 亚洲av综合色区无码一区爱av | 免费的毛片基地| 色www永久免费| 国产大尺度吃奶无遮无挡| www亚洲欲色成人久久精品| 差差漫画页面登录在线看| 亚洲不卡在线观看| 精品国产线拍大陆久久尤物| 国产精品玩偶在线观看|