hi,
I am experiencing problems with the prev calculated variable in indicators for mt4. In the first calculation its returning 10000(for example), in the next one - 0 (so far its normal).But after that it starts looping - one time 0, one time the same 10000, and this is causing the indicator to malfunction.
This is the code, nothing extraordinary :
Thank you
I am using a renko offline chart to calculate some values, and using the code you saw to make a look to process data and go through the renko bars. The issue is that every other OnCalculate event the prev_counted returns 0, although it is not 0.
You should provide all information from the start.
That's most probably due to the Renko generator.
another formula to set this limit is :
int limit = MathMax(rates_total - prev_calculated, 2); for (int i=0; i<limit; i++){ //.... }
You should provide all information from the start.
That's most probably due to the Renko generator.
i have the same issue, then i replace prev_calculated with other variable, it work well, but i would like to know why prev_calculated always reset to 0.
Offline chart is working fine, all update on time.
See How to do your lookbacks correctly #9 … #14 & #19.

- 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 am experiencing problems with the prev calculated variable in indicators for mt4. In the first calculation its returning 10000(for example), in the next one - 0 (so far its normal).But after that it starts looping - one time 0, one time the same 10000, and this is causing the indicator to malfunction.
This is the code, nothing extraordinary :
Thank you