How about this one?
void Shift(double &array[], double element) { int array_size = ArrayRange(array, 0); for(int j = array_size - 1; j > 0; j--) { array[j] = array[j - 1]; } array[0] = element; }
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
all indexes positions receive the same value, i think this will be a problem if i make the sort in other direction (array[j+1]=array[j]) but this way i cant find a reason