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
Hello everyone, and thanks for taking the time to read this.
To the point, I'm programming a custom indicator which uses the standard indicator for MA (Moving Averages), the one we have in the mql5 library. And, I'm using the short version of OnCalculate() because all I need is the price.
The problem is:
1) I need to initialize the handler of the standard MA indicator in OnInit():
2) As you can see, we have to set the specific 'price base' up (in this case PRICE_CLOSE from ENUM_APPLIED_PRICE). BUT THE SHORT VERSION OF OnCalculate() ALREADY HAS A 'PRICE BASE' SET UP (When you launch a custom indicator you have to pick up the 'price base' from a drop-down list).
So, is there a way where I can initialize the handler iMA (in the OnInit() function of course) with the 'price base' used for the variable &price[] of OnCalculate()? Maybe the 'price base' used to initialize the custom indicator is saved in some global constant, à la _Digits or _Point.
Anyway, I will really appreciate any help you could give me, or for pointing me to the right direction.
Thanks in advance,
Multi.