人人爽天天爽夜夜爽qc-人人爽天天爽夜夜爽曰-人人天天爱天天做天天摸-人人天天夜夜-色网站在线-色网站在线看

您現在的位置:程序化交易>> 期貨公式>> 交易開拓者(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.kzuj.com.cn

    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  有需要幫忙請點擊這里留言!?。? title=進行 有償 編寫!不貴!點擊查看價格!


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

相關文章

    沒有相關內容
主站蜘蛛池模板: 免费精品一区二区三区在线观看 | 欧美成人精品一级高清片 | 欧美 韩国 精品 另类 综合 | 精品国产91久久久久 | 我要看一级大片 | 中文字幕日韩理论在线 | 插鸡视频在线观看 | 久久久午夜视频 | www.伦理片 | 国产caonila在线观看 | 欧美大片大片播放网站 | www.伊人网 | 麻豆回家视频区一区二 | 福利网站在线观看 | 日韩国产欧美成人一区二区影院 | 亚洲一区二区视频在线观看 | 麻豆精品国产剧情在线观看 | 男无遮挡吃奶gift动态图 | 精品亚洲福利一区二区 | 久久午夜影院 | 欧美伊人激情 | 欧美国产伦久久久久 | 黄色三级一级片 | 天天摸日日 | 在线观看一夜七次郎国产 | avtt亚洲天堂| 最近最新视频中文字幕4 | 一级片免费视频 | 日本免费大黄 | 日本三级香港三级人妇网站 | 射射射综合网 | www.黄色网址 | 中文字幕25页 | 一区二区三区免费在线观看 | 在线观看 中文字幕 | 欧美xx视频 | 一个人看的www在线高清 | 狠狠色欧美亚洲狠狠色五 | 一区二区三区四区视频在线观看 | 午夜成人免费影院 | 欧美日韩一区二区视频免费看 |