int uppity() { int sum = 0; for ( int bar = 1; bar <= 20; bar++ ) { if ( Close[ bar ] > Open[ bar ] ) { sum += 1; } } return( sum ); }The function uppity() above tells you how many of the prior 20 bars, not including the one currently being formed, have their close price above their open price.
richplank wrote:
Thank you ,richplank. That's all ok. int uppity() { int sum = 0; for ( int bar = 1; bar <= 20; bar++ ) { if ( Close[ bar ] > Open[ bar ] ) { sum += 1; } } return( sum ); }The function uppity() above tells you how many of the prior 20 bars, not including the one currently being formed, have their close price above their open price.
Kang
I see. thanks.
Hello, Folks,
can I use this also for an indicator, who count, how many of the last bars are potove to the former bar?
T. Bopp
Germany
can I use this also for an indicator, who count, how many of the last bars are potove to the former bar?
T. Bopp
Germany
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
How to count the bars of which Close > Open within 20 period ?
thanks regards
Kang