Hi, when we limit the number of bars in the chart, the Buffer stays static, with a new bar the value of array [0] not turn array[1] and is overwritten.
Is there a simple way to inhibit this, or is necessary to transpose the array using ArrayCopy or copy one value by one value?
Thanks
Hi, when we limit the number of bars in the chart, the Buffer stays static, with a new bar the value of array [0] not turn array[1] and is overwritten.
Is there a simple way to inhibit this, or is necessary to transpose the array using ArrayCopy or copy one value by one value?
Thanks
The easiest way to make this work is with reverse indexing so instead of the entire array shifting when a new bar comes in you simple add one element to the end. If you're in MQL4 this means you need to use
ArraySetAsSeries(array,false);
on all the arrays you'll be working with.
- 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, when we limit the number of bars in the chart, the Buffer stays static, with a new bar the value of array [0] not turn array[1] and is overwritten.
Is there a simple way to inhibit this, or is necessary to transpose the array using ArrayCopy or copy one value by one value?
Thanks