Is there a way to get the 'price base' used for &price[] in the short version of OnCalculate()?

 

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():

int OnInit() { 

   hMA = iMA(NULL, 0, varPeriods, 0, MODE_SMA, PRICE_CLOSE);

}

 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).

 int OnCalculate(const int rates_total,

                const int prev_calculated,

                const int begin,

                const double &price[])     <<<<<<  Already comes from a 'price base' (PRICE_CLOSE, PRICE_OPEN, PRICE_HIGH, etc.)

  {

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. 

Reason: