Indicators: Fibonacci ZigZag

 

Fibonacci ZigZag:

Zig Zag indicator that relies only on a minimum % of retracement to each previous wave , and optionally , being bigger than a specific size measured in atr units.

Fibonacci ZigZag

Author: Lorentzos Roussos

 

That's a really new zigzag. It brings "quantitativeness" to the zigzag. Nice :-)


There's one small adjustment I made to the code to fix a bug where the indicator doesn't update on new bars (can be seen in the strategy tester).

I modified this:

   if(prev_calculated==0)
     {
      from=1;
      resetSystem();
      //--- set the first bar high and low as high and low
      rollingAtr=(high[0]-low[0])/_Point;
      rollingAtrs=1;
     }

to this:

   if(prev_calculated==0)
     {
      from=1;
      resetSystem();
      //--- set the first bar high and low as high and low
      rollingAtr=(high[0]-low[0])/_Point;
      rollingAtrs=1;
     }
     else{
      from = prev_calculated - 1;
     }

and all seems good 

 
Conor Mcnamara #:

That's a really new zigzag. It brings "quantitativeness" to the zigzag. Nice :-)


There's one small adjustment I made to the code to fix a bug where the indicator doesn't update on new bars (can be seen in the strategy tester).

I modified this:

to this:

and all seems good 

nice catch thanks , i will update