“applied price” Input/Parameters for custom indicator (iCustom)

 

Each indicator has two types of data: Inputs and Parameters.





--------------------------------------------------------------------------------------------------
How to set the parameters ( APPLIED_PRICE ) when using iCustom?
--------------------------------------------------------------------------------------------------

Note1:

int  iCustom(
   string           symbol,     // symbol name
   ENUM_TIMEFRAMES  period,     // period
   string           name        // folder/custom_indicator_name
   ...                          // list of indicator input parameters
   );
iCustom does not have a parameter for the applied price!



Note 2:  applied price exists when the following structure is used in the indicator code.

int OnCalculate(const int rates_total,
                const int prev_calculated,
                const int begin,
                const double &price[])
  {
   ....
  }


 

Please read the documentation — Documentation on MQL5: Technical Indicators / iCustom

In the "Note" section ...

"When you call a custom indicator from mql5-program, the Applied_Price parameter or a handle of another indicator should be passed last, after all input variables of the custom indicator."

There is also an "Example" in the documentation ...

MA_handle=iCustom(NULL,0,"Examples\\Custom Moving Average",
                     MA_Period,
                     MA_Shift,
                     MA_Method,
                     PRICE_CLOSE // using the close prices
                     );
Documentation on MQL5: Technical Indicators / iCustom
Documentation on MQL5: Technical Indicators / iCustom
  • www.mql5.com
iCustom - Technical Indicators - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Yes this works perfectly. Thankful