Indicators: Consecutive Bars (with history) indicator for MT5

 

Consecutive Bars (with history) indicator for MT5:

An oscillator that shows 2 line studies: 1 for consecutive up bars, and 1 for consecutive down bars.

Consecutive Bars (with history) indicator for MT5

Author: Ryan L Johnson

 

The original version of this indicator has been entirely replaced.

2 moving averages (1 for consecutive up bars, and 1 for consecutive down bars) have been added in version 1.20.

 

All previous versions of this indicator have been entirely replaced.

Fixed a stack overflow error in version 1.30.

 
Ryan L Johnson #:
Fixed a stack overflow error in version 1.30.

In version 1.30 I see only one custom function. I doubt there were many more in previous versions. How did you manage to get stack overflow?😁

I'd be very curious to see an implementation that can produce stack overflow. Could you please attach it here?

 
Vladislav Boyko #:

In version 1.30 I see only one custom function. I doubt there were many more in previous versions. How did you manage to get stack overflow?😁

I'd be very curious to see an implementation that can produce stack overflow. Could you please attach it here?

Sorry. I don't save mq5 files that freeze MT5.😂

As I recall, the issue only arose when I selected EMA or SMMA as the moving average mode. Version 1.30 is completely new code.

Maybe someone who downloaded the buggy version (within the few hours that it was actually posted) will see your post and send it to you. Good luck, I guess.

 
The indicator's moving averages formerly included 0 values in their calculations which distorted the sum of actual up bar counts and down bar counts, respectively. Fixed in version 1.40.
 
The indicator's general efficiency has been improved in version 1.50.