Normally Arrays are extended to the right
[1] --> [1,2] --> [1,2,3] ...
Why you want to make it the other way round?
Florian Riedrich #: Normally Arrays are extended to the right
- Arrays are not extended to the right or to the left. The direction of higher indexes are only in the mind of the coder.
If value 3 is at position two, You want to extend to higher indexes. Easy:
TYPE Array[]; TYPE function(){ // get value int iLast = ArraySize(Array); // End ArrayResize(Array,iLast+1); // Make room Array[iLast] = value; // Store at new
- Cromo: Then next a new data 3 comes. [3,2,1]If the value 3 is at index zero, you want to extend and shift (a deque or stack). You need just three extra lines.
TYPE Array[]; TYPE function(){ // get value int iLast = ArraySize(Array); // End // This enlarges the arr and shifts values B[2]=B[1]; B[1]=B[0]; B[0]=prob 0. bool isSeries = ArrayGetAsSeries(Array); ArraySetAsSeries(Array, !isSeries); ArrayResize(Array,iLast+1); // Make room ArraySetAsSeries(Array, isSeries); Array[iLast] = value; // Store at new
Thank you!
Let me study this. You teach me many things. Arigatou.
William Roeder #:
Interesting. Thanks
- Arrays are not extended to the right or to the left. The direction of higher indexes are only in the mind of the coder.
If value 3 is at position two, You want to extend to higher indexes. Easy:
- If the value 3 is at index zero, you want to extend and shift (a deque or stack). You need just three extra lines.

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
I want to ask someone how to code below.
New data 1 comes.
I want to add into Array.
[1]
Then next a new data 3 comes.
[2,1]
Then next a new data 3 comes.
[3,2,1]
etc...
Can you help?