tnjf1216 发表于 2018-1-30 16:47:10

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



#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Red
extern int ReversPoint=80;
double RBuffer[];
int Trend=1,InTrend,ttime;
double Points,Last_High, Last_Low;
int init()
{
   string short_name;
   Points=MarketInfo (Symbol(), MODE_POINT);
   SetIndexStyle(0,DRAW_SECTION,EMPTY,1,Red);
   SetIndexBuffer(0,RBuffer);
   SetIndexEmptyValue(0,0);
   short_name="RPoint";
   IndicatorShortName(short_name);
   SetIndexLabel(0,short_name);
   SetIndexDrawBegin(0,100);
   ArrayInitialize(RBuffer,0);
   return(0);
}
int deinit()
{
   return(0);
}
int start()
{
   int    counted_bars=IndicatorCounted(),i,shift;
   i=(Bars-counted_bars)-1;
   for(shift=i; shift>=0;shift--)
   {
      if (Time!=ttime) InTrend=InTrend+1;
      ttime=Time;
      RBuffer=0;
      if (High>Last_High && Trend==1)InTrend=1;
      if (Low<Last_Low   && Trend==0)   InTrend=1;
      if (High>Last_High) Last_High=High;
      if (Low<Last_Low)   Last_Low=Low;
      if (Trend==1 && Low<Last_High-ReversPoint*Points && InTrend>1)
      {
         Trend=0;
         RBuffer=High;
         Last_High=Low;
         Last_Low=Low;
         InTrend=1;
      }
      if (Trend==0 && High>Last_Low+ReversPoint*Points && InTrend>1)
      {
         Trend=1;
         RBuffer=Low;
         Last_Low=High;
         Last_High=High;
         InTrend=1;
      }
   }
   return(0);
}



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

{:1_181:}

shangm4589 发表于 2021-7-11 14:47:25

支持下

田坝子的狗 发表于 2021-7-27 22:37:16

谢谢
页: [1] 2
查看完整版本: 高低点折线图画法学习参考