波段指标 super

楼主  收藏   举报   帖子创建时间:  2019-05-05 05:00 回复:0 关注量:713
USDJPYM30.png

  1. //+------------------------------------------------------------------+
  2. //|                                                super-signals.mq4 |
  3. //|                 Copyright @2006, Nick Bilak, beluck[AT]gmail.com |
  4. //+------------------------------------------------------------------+
  5. #property copyright "下载更多外汇EA,外汇指标,交易系统,就到【外汇EA之家】"
  6. #property link      "http://www.eazhijia.com"

  7. #property indicator_chart_window
  8. #property indicator_buffers 2
  9. #property indicator_color1 Red
  10. #property indicator_width1 2
  11. #property indicator_color2 Lime
  12. #property indicator_width2 2

  13. input int SignalGap = 4;

  14. int dist=24;
  15. double b1[];
  16. double b2[];

  17. void onInit(void)
  18.   {
  19.    SetIndexStyle(0,DRAW_ARROW,STYLE_SOLID,1);
  20.    SetIndexStyle(1,DRAW_ARROW,STYLE_SOLID,1);
  21.    SetIndexArrow(1,233);
  22.    SetIndexArrow(0,234);
  23.    SetIndexBuffer(0,b1);
  24.    SetIndexBuffer(1,b2);
  25. }

  26. int onCalculate(const int rates_total,
  27.                 const int prev_calculated,
  28.                 const datetime &time[],
  29.                 const double &open[],
  30.                 const double &high[],
  31.                 const double &low[],
  32.                 const double &close[],
  33.                 const long &tick_volume[],
  34.                 const long &volume[],
  35.                 const int &spread[])
  36.   {
  37.    int i,limit,hhb,llb;
  38.    if(rates_total<=SignalGap)
  39.       return(0);

  40.    limit=rates_total-prev_calculated;
  41.    if(prev_calculated>0)
  42.       limit++;
  43.    for (i=limit;i>=0;i--)   {
  44.       hhb = Highest(NULL,0,MODE_HIGH,dist,i-dist/2);
  45.       llb = Lowest(NULL,0,MODE_LOW,dist,i-dist/2);

  46.       if (i==hhb)
  47.          b1[i]=High[hhb]+SignalGap*Point;
  48.       if (i==llb)
  49.          b2[i]=Low[llb]-SignalGap*Point;
  50.    }
  51.    return(rates_total);
  52. }

打赏