double var=new_val;
if(var!=arr[0])
{
arr[1]=arr[0];
arr[0]=var;
}
FourX:
Me to!
I was hoping for LOTS of detailed and informative feedback on Arrays.
Ask specific questions... Or u can read about it -> https://book.mql4.com/variables/arrays.
arr[1]=arr[0]; arr[0]=var;However, if you're writing an Indicator, then the arrays automatically adjust themselves
double TempBuffer[]; int init() { IndicatorBuffers(6); SetIndexBuffer(5,TempBuffer); //...

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
How do i store the the current value of a variable in array element location 0 and the previous bar's value of the same variable in element location 1 of the array?
thks.