You need to read about the usage of arrays and the examples
i read it but i don't understand where i wrong
- Set the array as series before populating it.
clos[k]=iMAOnArray(clos,0,period,0,method,1);
What average do you think you are calculating?
WHRoeder:
- Set the array as series before populating it.
- What average do you think you are calculating
1. thank you
2. Simple averange with 12 period or i'm wronging?
duddas90: 2. Simple averange with 12 period or i'm wronging?
Simple average of what? clos has no values. If it does you then clobber the array by assigning the iMA to it so subsequent iMAs are meaningless.
WHRoeder:
Simple average of what? clos has no values. If it does you then clobber the array by assigning the iMA to it so subsequent iMAs are meaningless.
oooh!! now i understand imaonarray what mean really!!! i tought that it was moving averange in 1 array!!
I need moving averange value in K (500) candles
i must to use iMA process to populate array right??
![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
Good morning
I'm a newbie in mql4 and i still don't understand how put value of moving averange in array. I get always some errors (like array out of range)
I just need and alert when the value of moving averange in the previous candle is more high then actual candle in OnCalculate process.
Can someone make me this little piece of code?
however thank you
Donato