![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Hello! I'm having trouble with a simple index counter in loop. I have tried every way to get it to work. * I have moved this function out of the OnTick section and called it as a separate function from there. * I have tried to include the moments of data array changes based on indexes when the index gets a new element using same- and separate loops. * I have tried a bool variable as an additional condition that would provide additional confirmation * I have even made a static timestamp[] array and indexed the data there to compare. In other words, I've been trying every way for weeks and I'm absolutely at a loss because I can't get anything to work unless I can actually read data even in such simple functions. Some more competent people please help me, I'm really in trouble... I put a simple example code where I try to get the consecutiveHigh and consecutiveLow counters to work, but they give random answers.
dear friends, I hope for your help