MT5 Script to run script or loop within script?

 
I have a script which writes data from various indicator buffers to a CSV file given a start date and time, end date and time, list of instruments, timeframes etc.

Because for some reason MT5 only allows this script to run across around 70,000 observations, I want to run the script multiple times and then append the files outside of MT5 (or potentially, inside). The data is there because it is a custom indicator. 

Not sure what is causing this limit. 

Let's say I want to keep the month and day unchanged, and simply loop through the start year from 2015 to 2023, where start year is a script input. How can I call the script to run multiple times in this way using another script with a loop to do so?

Another way of asking this is how do I write a loop which runs the script on a chart with a specified set of inputs (including a variable which is looping) and ensure the script only reopens when the previous instance has finished?

Happy to work on this myself - I am always amazed how knowledgeable the solutions are on here though.
 
samuk1000:
I have a script which writes data from various indicator buffers to a CSV file given a start date and time, end date and time, list of instruments, timeframes etc.

Because for some reason MT5 only allows this script to run across around 70,000 observations, I want to run the script multiple times and then append the files outside of MT5 (or potentially, inside).

Let's say I want to keep the month and day unchanged, and simply loop through the start year from 2015 to 2023, where start year is a script input. How can I call the script to run multiple times in this way using another script with a loop to do so?

Another way of asking this is how do I write a loop which runs the script on a chart with a specified set of inputs (including a variable which is looping) and ensure the script only reopens when the previous instance has finished?

Happy to work on this myself - I am always amazed how knowledgeable the solutions are on here though.
I suggest, you use a service for that instead of a script. Just transfere the content of your current script to a service.

That's what they are made for.
 
I think I have solved this issue by using Bars instead of iBars to give a number of bars to run the script over.