Wednesday, June 3, 2009

AFL to Count Number of Bars Quickly

I wrote this simple AFL some time back to count number of bars quickly between two points on the charts:
if (BeginValue(BarIndex()) != 0 AND EndValue(BarIndex()) != BarCount-1) {
range = EndValue(BarIndex())-BeginValue(BarIndex());
Title += StrFormat("\nRange Bars: %g", range);
}
Just copy paste this at the end of your price afl and use range selection. To select a range, double click in the chart on your 1st bar and then double click again on your last bar. You will see green and red vertical lines and the number of bars is displayed under the title. Double click again on one of the start or end bars to deselect the range.

Bar counting is useful identifying Wolfe Wave patterns and other time-symmetry sensitive patterns.

Example chart below:


2 comments:

renu on June 3, 2009 at 6:13 PM said...

Thanks a lot doji

Renu

Doji (Blog Author) on June 3, 2009 at 6:16 PM said...

You are welcome :)

Post a Comment

 

The Chart Reader Copyright © 2009. Privacy Policy