指标: AutoGannAutoTrend

 

AutoGannAutoTrend:

本指标基于最近的之字转向指标峰值来绘制价格通道,斐波那契水平和江恩角度线。

图1. AutoGannAutoTrend 指标

作者: Nikolay Kositsin

 

很棒的指标。为我使用的版本做了一些改动,即为当前和之前的波动添加了江恩扇形 和斐波回撤,并添加了斐波弧线和时区。


 

经过尝试,发现代码中似乎存在错误。

天真地使用之字形时间框架的时间(不知道"// Òàéìôðåéì Çèãçàãà äëÿ ðàñ÷åòà èíäèêàòîðà "是什么意思),使得指标在较低的时间框架下绘制江恩线 等时,起点和终点都不正确。因此,举例来说,如果使用日线 ZigZag 指标,即使价格的最大/最小值在当天的不同时间,江恩线也会从当天的开始点开始。下面的代码块解决了这个问题:

...
          if(UpSign[bar])
           {
            swing_value[found]=UpSign[bar];

            swing_date[found]=TIME[bar];

              {
               MqlRates rates[];
               int copied=CopyRates(Symbol(),Period(),swing_date[found],swing_date[found]+PeriodSeconds(Timeframe),rates);
               if(copied<=0)
                  Print("Error copying price data ",GetLastError());
               for(int i=0; i<copied; i++)
                  if(rates[i].high==swing_value[found])
                    {
                     swing_date[found]=rates[i].time;
                     break;
                    }

              }

            found++;

...

当然,在波段低点上也有类似的代码块,检查 rates[i].low 是否等于值。