4评论

1收藏

BollTrade_Ron_MT4.mq4

avatar 老王吧 | 3053 人阅读 | 4 人评论 | 2016-04-25

XAUUSDM30.png

  1. //+-----------+
  2. //| TwoPerBar |
  3. //+-----------+
  4. #property copyright "Ron Thompson"
  5. #property link      "http://www.lightpatch.com/forex/"

  6. #property indicator_chart_window
  7. #property indicator_buffers 2
  8. #property indicator_color1 DodgerBlue
  9. #property indicator_color2 Magenta

  10. extern double BDistance    =      14;    // plus how much
  11. extern int    BPeriod      =      15;    // Bollinger period
  12. extern int    Deviation    =       2;    // Bollinger deviation

  13. //---- buffers
  14. double val1[];
  15. double val2[];

  16. //+----------------+
  17. //| Custom DE-init |
  18. //+----------------+
  19. // Called ONCE when EA is removed from chart

  20. int deinit()
  21.   {
  22.    int    i;
  23.    string o;

  24.    //remove the old objects
  25.    for(i=0; i<Bars; i++)
  26.      {
  27.       o=DoubleToStr(i,0);
  28.       ObjectDelete("myx"+o);
  29.      }
  30.    Print("DE-Init happened ",CurTime());
  31.    Comment(" ");
  32.   }



  33. //+------------------------------------------------------------------+
  34. //| Custom indicator initialization function                         |
  35. //+------------------------------------------------------------------+
  36. int init()
  37.   {
  38.    IndicatorBuffers(2);
  39.    
  40.    SetIndexStyle(0,DRAW_ARROW);
  41.    SetIndexArrow(0,233);
  42.    SetIndexBuffer(0,val1);
  43.    
  44.    SetIndexStyle(1,DRAW_ARROW);
  45.    SetIndexArrow(1,234);
  46.    SetIndexBuffer(1,val2);
  47.   }
  48.   
  49.   
  50. //+-----+
  51. //| TPB |
  52. //+-----+
  53. int start()
  54.   {   
  55.    
  56.    int i;
  57.    int mybars=2000;

  58.    double bup=iBands(Symbol(),0,BPeriod,Deviation,0,PRICE_OPEN,MODE_UPPER,0);
  59.    double bdn=iBands(Symbol(),0,BPeriod,Deviation,0,PRICE_OPEN,MODE_LOWER,0);

  60.       
  61.    for (i=mybars; i>=0; i--)
  62.      {
  63.       bup=iBands(Symbol(),0,BPeriod,Deviation,0,PRICE_OPEN,MODE_UPPER,i);
  64.       bdn=iBands(Symbol(),0,BPeriod,Deviation,0,PRICE_OPEN,MODE_LOWER,i);

  65.       if( High[i]>=bup+(14*Point) )
  66.         {
  67.          val2[i]=bup+(15*Point);         
  68.          //ObjectDelete ("myx"+DoubleToStr(objtick,0));
  69.          //ObjectCreate ("myx"+DoubleToStr(objtick,0), OBJ_TEXT, 0, Time[i], High[i]+(7*Point));
  70.          //ObjectSetText("myx"+DoubleToStr(objtick,0),"X",15,"Arial",Red);
  71.          //objtick++;
  72.         }
  73.       if( Low[i]<=bdn-(14*Point) )
  74.         {
  75.          val1[i]=bdn-(15*Point);         
  76.          //ObjectDelete ("myx"+DoubleToStr(objtick,0));
  77.          //ObjectCreate ("myx"+DoubleToStr(objtick,0), OBJ_TEXT, 0, Time[i], High[i]+(7*Point));
  78.          //ObjectSetText("myx"+DoubleToStr(objtick,0),"X",15,"Arial",Red);
  79.          //objtick++;
  80.         }

  81.      }//for
  82.    
  83.    //Comment(DoubleToStr(mybars,0)+" bars with usable ="+DoubleToStr(objtick,0)+" and unusable="+DoubleToStr(noobj,0)+" maxTR="+DoubleToStr(maxTR,4));
  84.   
  85.   }//start
  86.   
复制代码


[i]BollTrade_Ron_MT4.zip
""
还没有人打赏,支持一下

评论|共 4 个

chzhf

发表于 2019-5-12 12:41:42 | 显示全部楼层

学习了                          

义阳

发表于 2020-7-2 10:02:34 | 显示全部楼层

:lol不错

雪人有眼泪

发表于 2020-7-2 22:35:54 | 显示全部楼层

我是来刷分的,嘿嘿

possion

发表于 2021-7-15 21:32:05 | 显示全部楼层

您需要登录后才可以回帖 登录 | 注册 微信登录

EA之家评论守则