iFractals() calculates 2 bars after the fact. So when a lower low/higher high is formed on the current bar, it cancels the lowest/highest of 2 bars back. Also known as redrawing.
Hi pipPod,
After some days triyng to implement what you have said I think I have made it. The only question is if you work with the current bar or you check the Lower low/higher high after the close of the current bar...
At the moment I'm doing:
Control_Bars = Bars - UpperBarIndex; //UpperBarIndex its the bar number where it occured the last fractal (higher high in this case). Its the middle bar. if(High[Control_Bars] > High[Control_Bars+2] && High[Control_Bars] >= High[Control_Bars+1] && High[Control_Bars] >= High[Control_Bars-1] && High[Control_Bars] > High[Control_Bars-2])
The result of my code is the same output of the indicator.
The code goes in attachment. Probably it isn't the best way to do it, but thanks.
Hi pipPod,
After some days triyng to implement what you have said I think I have made it. The only question is if you work with the current bar or you check the Lower low/higher high after the close of the current bar...
At the moment I'm doing:
The result of my code is the same output of the indicator.
The code goes in attachment. Probably it isn't the best way to do it, but thanks.
Bar number goes up as they get older starting by bar 0 at the right.
So if you skip bar 0 and calculate up until the highest bar you are scanning backwards in time from bar 1 to the outer bar on the left side, the one with the biggest number.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
I have used iFractal function in an EA and when it detects a fractal it prints an up/down arrow on the bar. the problem is when tester finish testing it displays the fractal indicator and the and arrow doesn't match with the indicator!
I think that iFractal its well configured the For cycle is only for the two last candles...
Previous_Bars is zero in "OnInit" :
the result is this:
Whats wrong??