大伊人青草狠狠久久-大伊香蕉精品视频在线-大伊香蕉精品一区视频在线-大伊香蕉在线精品不卡视频-大伊香蕉在线精品视频75-大伊香蕉在线精品视频人碰人

您現在的位置:程序化交易>> 期貨公式>> 交易開拓者(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.weiqiv.net.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  有需要幫忙請點擊這里留言!!!進行 有償 編寫!不貴!點擊查看價格!


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

相關文章

    沒有相關內容
主站蜘蛛池模板: 美女洗澡一级毛片 | 日韩 欧美 国产 亚洲 中文 | 一级毛片免费视频 | 高清国产美女在线观看 | 99国产高清久久久久久网站 | 久久亚洲国产伦理 | 欧美激情特级黄aa毛片 | 99久久免费国产精精品 | 男人的天堂久久香蕉国产 | 天天爽天天干天天操 | 亚洲欧美高清 | 久久综合久久综合久久综合 | 视频一区在线免费观看 | 日本在线不卡免费视频一区 | 九九在线免费观看视频 | 欧美 日产 国产精选 | 乱人伦精品一区二区 | 久久99免费视频 | 视频一区日韩 | 国产伊人自拍 | 久久中文字幕久久久久 | 91精品成人免费国产 | 全部免费毛片在线 | 亚洲欧美日韩国产精品久久 | 亚洲综合亚洲 | 欧美日韩第二页 | 午夜精品久久久久久久90蜜桃 | 久久这里只有精品6 | 精品中文字幕久久久久久 | 我想看一级毛片 | 色伊人网| 久久精品免观看国产成人 | 色久激情 | 色综合久久综合 | 五月激情综合 | 国产精品5 | 色综合欧美亚洲另类久久 | 日批视频网址免费观看 | 男人的天堂一区二区视频在线观看 | 亚洲欧美成人永久第一网站 | 99r在线精品|