Keith Watford:
Are you using OnCalculate()?
You should try to avoid the old variables such as IndicatorCounted(). Use prev_calculated instead.
Your problem is possibly due to the chart being updated after you change timeframes.
When prev_calculated ==0, you should use ArrayInitialize() to set all index to EMPTY_VALUE.
Yes I use the OnCalculate() function.
Thank you for the tip with the ArrayInitialize() , i think that was the main problem.
Not the code (in the OnCalculate) looks like this:
if(prev_calculated == 0) //changing TF f.e. { ArrayInitialize(RsiLevelBuffer,EMPTY_VALUE); ArrayInitialize(BBCon1UpBuffer,EMPTY_VALUE); ArrayInitialize(BBCon1DownBuffer,EMPTY_VALUE); } if(rates_total != prev_calculated) { int limit = rates_total - prev_calculated; // Do not check repeated bars //For drawing Indicators for(int i = limit; i >= 1; i--) // Iterate bars from past to present { if(i > Bars -2) continue; // If not enough data... if(BBCondition_1(i)) { continue; } if(BBCondition_2(i)) { continue; } if(BBCondition_3(i)) { continue; } RsiCondition(i); } }
Would oyu solve it differently? Or how do you do it?
Have a nice day, and thank you :)

Está perdiendo oportunidades comerciales:
- Aplicaciones de trading gratuitas
- 8 000+ señales para copiar
- Noticias económicas para analizar los mercados financieros
Registro
Entrada
Usted acepta la política del sitio web y las condiciones de uso
Si no tiene cuenta de usuario, regístrese
CCI_MA. EA a base de una aplicación particular de CCI y MA:
Autor: Andrey