9评论

1收藏

高低点折线图画法学习参考

avatar tnjf1216 | 2205 人阅读 | 9 人评论 | 2018-01-30

QQ截图20180130164632.png

  1. #property indicator_chart_window
  2. #property indicator_buffers 1
  3. #property indicator_color1 Red
  4. extern int ReversPoint=80;
  5. double RBuffer[];
  6. int Trend=1,InTrend,ttime;
  7. double Points,Last_High, Last_Low;
  8. int init()
  9.   {
  10.    string short_name;
  11.    Points=MarketInfo (Symbol(), MODE_POINT);
  12.    SetIndexStyle(0,DRAW_SECTION,EMPTY,1,Red);
  13.    SetIndexBuffer(0,RBuffer);
  14.    SetIndexEmptyValue(0,0);
  15.    short_name="RPoint";
  16.    IndicatorShortName(short_name);
  17.    SetIndexLabel(0,short_name);
  18.    SetIndexDrawBegin(0,100);
  19.    ArrayInitialize(RBuffer,0);
  20.    return(0);
  21.   }
  22. int deinit()
  23.   {
  24.    return(0);
  25.   }
  26. int start()
  27.   {
  28.    int    counted_bars=IndicatorCounted(),i,shift;
  29.    i=(Bars-counted_bars)-1;
  30.    for(shift=i; shift>=0;shift--)
  31.      {
  32.       if (Time[shift]!=ttime) InTrend=InTrend+1;
  33.       ttime=Time[shift];
  34.       RBuffer[shift]=0;
  35.       if (High[shift+1]>Last_High && Trend==1)  InTrend=1;
  36.       if (Low[shift+1]<Last_Low   && Trend==0)   InTrend=1;
  37.       if (High[shift+1]>Last_High) Last_High=High[shift+1];
  38.       if (Low[shift+1]<Last_Low)   Last_Low=Low[shift+1];
  39.       if (Trend==1 && Low[shift+1]<Last_High-ReversPoint*Points && InTrend>1)
  40.         {
  41.          Trend=0;
  42.          RBuffer[shift+InTrend]=High[shift+InTrend];
  43.          Last_High=Low[shift+1];
  44.          Last_Low=Low[shift+1];
  45.          InTrend=1;
  46.         }
  47.       if (Trend==0 && High[shift+1]>Last_Low+ReversPoint*Points && InTrend>1)
  48.         {
  49.          Trend=1;
  50.          RBuffer[shift+InTrend]=Low[shift+InTrend];
  51.          Last_Low=High[shift+1];
  52.          Last_High=High[shift+1];
  53.          InTrend=1;
  54.         }
  55.      }
  56.    return(0);
  57.   }
复制代码



高低点折线图.mq4
""
还没有人打赏,支持一下

评论|共 9 个

ainiya1b

发表于 2020-6-7 16:38:31 | 显示全部楼层

小手一抖,积分到手!

drenched

发表于 2020-6-22 15:07:46 | 显示全部楼层

我抢、我抢、我抢沙发~

4tyq857ew07

发表于 2020-6-26 15:15:25 | 显示全部楼层

不错不错,楼主您辛苦了。。。

小宝

发表于 2020-7-1 17:12:18 | 显示全部楼层

写的真的很不错

日满西1房

发表于 2020-7-14 22:32:15 | 显示全部楼层

谢谢楼主分享

w09a5b3v

发表于 2020-8-31 10:31:48 | 显示全部楼层

帮你顶下哈!!

tat12345

发表于 2020-11-14 13:51:44 | 显示全部楼层

shangm4589

发表于 2021-7-11 14:47:25 | 显示全部楼层

支持下

田坝子的狗

发表于 2021-7-27 22:37:16 | 显示全部楼层

谢谢

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

EA之家评论守则