Abdul Arief Bogie Ardianto:
i can get the latest MA value for the last 5 bar using dynamic array. thanks to ArraySetAsSeries(), it reverse it's saving point so that current bar MA will be saved to index 0
Just write your own function to return the correct array item from your stored arrayi can get the latest MA value for the last 5 bar using dynamic array. thanks to ArraySetAsSeries(), it reverse it's saving point so that current bar MA will be saved to index 0
but since i know how much size i need (5), i tried to use the same code. but ArraySetAsSeries() only works on dynamic. this makes MA current bar is stored on index 4. how to achieve the same result.
Abdul Arief Bogie Ardianto #:
Well it is the only way because arrayasseries only works on dynamicyes i know i can manually do that. but that's not what i want to learn and to know
So if you want to learn why don’t you show your attempt at the function and then we can help you
It’s not a hard function to code
Abdul Arief Bogie Ardianto:
i can get the latest MA value for the last 5 bar using dynamic array. thanks to ArraySetAsSeries(), it reverse it's saving point so that current bar MA will be saved to index 0
After copybuffer, call ArrayReverse for 5 element array, it is an insignificant performance penalty.
i can get the latest MA value for the last 5 bar using dynamic array. thanks to ArraySetAsSeries(), it reverse it's saving point so that current bar MA will be saved to index 0
but since i know how much size i need (5), i tried to use the same code. but ArraySetAsSeries() only works on dynamic. this makes MA current bar is stored on index 4. how to achieve the same result.

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
but since i know how much size i need (5), i tried to use the same code. but ArraySetAsSeries() only works on dynamic. this makes MA current bar is stored on index 4. how to achieve the same result.