iAC & iAO Indicators - Counting Bars

 

How does one count UP Bars versus DOWN Bars and vice versa?

For example X amount of UP bars to enter and Y amount or DOWN bars to exit. ..

Cheers!

 

On an up bar, the Close is greater than the Open price. Count those.
On a down bar, the Close is less than the Open. Count those.

 

I'm back!

Okay so use a For loop to count but I don't quite understand "Close is greater than the Open Price". Do you mean for an up bar Close is greater than the ask price and vice versa for down bar.

Again rookie at keyboard.

Thanks phy!

 

Now I re-read and see you want to count indicator bars (mentioned in title) not chart bars (assumed from body of question)

Use the iAO or iAC shift value to get the value of the indicator for any bar. 0 is the current bar.

find them, examine the value, count them.