Pedro Henrique Vieira:
Hello everyone, I have a simple problem (not for a beginner like me. LOL).
I want to create a function that calculate the average of any of the OHLC values for a N period, and be called within the "OnCalculate" function .
The Function i programmed is the follow :
Inside the int OnCalculate function i call it using the code:
The MT5 compiler pop up the erros:
'high' - parameter conversion not allowed
'high' - array required
'low' - array required
Where is my mistake?
Thank you all!
Here is the problem:
Average(high[i],low[i],12,aver);
The input is an array, not a single double value, so you need to write it like:
Average(high,low,12,aver);
Ehsan Tarakemeh:
Here is the problem:
The input is an array, not a single double value, so you need to write it like:
Wow! So simple.
Thanks a lot!!!

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
I want to create a function that calculate the average of any of the OHLC values for a N period, and be called within the "OnCalculate" function .
The Function i programmed is the follow :
Inside the int OnCalculate function i call it using the code:
The MT5 compiler pop up the erros:
'high' - parameter conversion not allowed
'high' - array required
'low' - array required
Where is my mistake?
Thank you all!