-
Please edit your (original) post and use the CODE button (Alt-S)! (For large amounts of code, attach it.)
General rules and best pratices of the Forum. - General - MQL5 programming forum 2019.05.06
Messages Editor -
for (int i=arraySize-1; i>1; i--) array[i]=array[i-1];
No need to keep moving values and then updating array[0] (which your code doesn't do), just add the last to the enlarged array. - xazarlx20: The main problem I have is figuring out how many ticks there are before resizing the array. I am just stumped!!!
Perhaps you should read the manual. ArraySize/ArrayResize. You start with zero size, enlarge it by one for each tick. The size of the array is “how many ticks there are before.”
How To Ask Questions The Smart Way. 2004
How To Interpret Answers.
RTFM and STFW: How To Tell You've Seriously Screwed Up.
Please edit your post and use the code button (Alt+S) when pasting code.
EDIT your original post, please do not just post the code properly in a new post.
SymbolInfoTick(_Symbol,currentTick); int i=ArraySize(ticks); while(--i > 0 && ticks[i].time + duration < currentTick.time); ArrayResize(++i + 1); while(--i >= 0) { ticks[i+1]=ticks[i]; } ticks[0]=currentTick;
Assuming you need an array of tick structs ordered newest first.

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
The main problem I have is figuring out how many ticks there are before resizing the array.
int duration=900; //15 minutes
Do
{
for (int i=arraySize-1; i>1; i--)
{
array[i]=array[i-1];
}
}
while(currentTickTime < firstTickTime + duration )
I am just stumped!!!