You can transfer an array from an old copy of the indicator to a new one.
Thank you. Your solution is a bit circumstantial.
Is there any simpler solution (without those include files) or is it the one and only?
You can transfer an array from an old copy of the indicator to a new one.
OK, but how? I don't want to use OOP which I am not familiar with. Is there any other method?
fxsaber solution is only valid for mql5. In mql4 you could save your array data to a file and re-load it at every new initialization. Regards.
OK, but how? I don't want to use OOP which I am not familiar with. Is there any other method?
fxsaber solution is only valid for mql5.
And MQL4.
An array can also be passed through resources and global variables.
fxsaber solution is only valid for mql5. In mql4 you could save your array data to a file and re-load it at every new initialization. Regards.
And MQL4.
An array can also be passed through resources and global variables.
Yes, in mql4 you can use resources and global variables, but in your code, you use several functions (ChartIndicatorGet(), IndicatorParameters(), IndicatorRelease(), etc) and structures (MqlParam) that don't work in mql4.

- 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 guys,
I have an indicator, which works with an array (not candle's data, but on-the-fly generated). This array is empty at the first starting.
When the indicator runs, this array gets new values.
My problem: when I change an input parameter and refresh the indicator on the chart, my array will be empty and starts to collect data from beginning.
Is it possible somehow to preserve the existing array-data?
(This is not problem for an expert, but problem for an indicator, because when refreshing it takes into account the initial values outside the OnInit() and frees the array.)
Thanks