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


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

相關文章

    沒有相關內容
主站蜘蛛池模板: 在线观看午夜 | 高h喷水荡肉爽文np肉色文 | 夜夜爽夜夜叫夜夜高潮漏水 | 久久国产精品伦理 | 在线视频日韩欧美 | 国产成人精品福利站 | 国产精品一区二区在线观看 | 久久久7777888精品 | 综合在线视频精品专区 | 特大一级aaaaa毛片 | 狠狠干综合网 | 久久黄色一级片 | 成人中文在线 | 一级一级一级毛片免费毛片 | 亚洲码一区二区三区 | 亚洲最色网站 | 国产成人精品综合网站 | 免费人成在线观看69式小视频 | 国内自拍欧美 | 国产女人视频免费观看 | 国产高清不卡一区二区 | 色天使久久综合给合久久97色 | 国产成人精品亚洲2020 | 日韩精品一区二区三区毛片 | 天天干天天干天天干天天干天天干 | 一级香蕉视频在线观看 | 亚洲精品专区 | 久草免费资源视频 | 日本三级香港三级人妇99 | 欧美福利第一页 | 毛茸茸free牲交 | 一本加勒比dvd波多野结衣 | 99热精品一区 | 一级片在线免费播放 | 海角社区hjb08真实 | 中文字幕无线码 | 97久久人人爽人人爽人人 | 二区在线视频 | 成年人免费视频观看 | 国产成人久久精品激情 | 美女很黄很黄 |