How to create simple moving average (100 period) of OnBalanceVolumes data passed by array?
Please edit your (original) post and use the CODE
button (Alt-S)! (For large amounts of code, attach it.)
General rules and best pratices of the Forum. - General - MQL5 programming forum
Messages Editor
General rules and best pratices of the Forum. - General - MQL5 programming forum
Messages Editor
Hello guys, i hope that someone can please help me, cause i am (at this moment) at a dead end...
I want to create an array of the SMA (Period 100) of the On Balance Volumes (TICK_TYPE) data passed by iOBV function.
In other words, the new value of sma_Array at every candle formation must contain the sum of last 100 OBV values/100. The problem is that i am not able to use iMA for data different from prices.
I know that perhaps i have to use OnCalculate() function, but i am not able, i have try with this code, which i had found here in another post, but on execution it doesn't work.
Please, if everyone can help me with this, i would be really grateful. This is the code i have tried, i only need to make works and understand this part.
I pass the handle with:Then i have a function NewCandle() to verify output at new candle formation, for example live on M1. Thanks :)