Use the publicly released code

William Roeder  
cape1354: Please recommend a place where you can view the codes using the icustom function, instead of the manual.
Just get the value of the indicator. You should write a self documenting function instead of calling iCustom directly, see Detailed explanation of iCustom - MQL4 forum
Icham Aidibe  
In MQL5, you do it that way :

#resource "\\Indicators\\indicator.ex5" //include the indicator in your file for convenience

int IndicHandle;
IndicHandle=iCustom(NULL,PERIOD_CURRENT,"::Indicators\\indicator.ex5", inputofindicator1, inputofindicator2, inputofindicator3, inputofindicator4, inputofindicator5);
If you don't want to include the custom indicator in your code, you simply specify the path to the indicator without "::".
Joyce Weiss Evans  
Icham Aidibe #:
In MQL5, you do it that way :

#resource "\\Indicators\\indicator.ex5" //include the indicator in your file for convenience

int IndicHandle;
IndicHandle=iCustom(NULL,PERIOD_CURRENT,"::Indicators\\indicator.ex5", inputofindicator1, inputofindicator2, inputofindicator3, inputofindicator4, inputofindicator5);
If you don't want to include the custom indicator in your code, you simply specify the path to the indicator without "::".

Hello

how can i do this in mq4 ?

William Roeder  
Joyce Weiss Evans #: how can i do this in mq4 ?
  1. Perhaps you should read the manual. iCustom - Technical Indicators - MQL4 Reference
       How To Ask Questions The Smart Way. (2004)
          How To Interpret Answers.
             RTFM and STFW: How To Tell You've Seriously Screwed Up.

  2. The use of resources is identical.
              Use the publicly released code - MQL5 programming forum (2017)
              Resources - MQL4 Reference

    Be aware that using resources is 40x times slower than using CIs directly.
              A custom indicator as a resource - MQL4 programming forum (2019)

    Also make use there are no spaces in the path.
              Getting error 4802 when loading custom indicator that loads another custom indicator with iCustom - Technical Indicators - MQL5 programming forum. (2020.07.21)

Alberto Gauer Borrego  
What is the command for the referenced indicator be plotted in a subwindow?

My coder is having some difficulty, when he references the indicator inside the EA it opens on the chart.
Fernando Carreiro  
Alberto Gauer Borrego #What is the command for the referenced indicator be plotted in a subwindow? My coder is having some difficulty, when he references the indicator inside the EA it opens on the chart.
Tell your coder to do their own research, or find someone better. You are paying them, not the other way around.
Fernando Carreiro  
@Alberto Gauer Borrego #: What is the command for the referenced indicator be plotted in a subwindow? My coder is having some difficulty, when he references the indicator inside the EA it opens on the chart.

Any indicator embedded as a resource will behave exactly the same as if they were used normally from an external source. There is no difference.

What dictates how the indicator is displayed, either on the main chart or in the sub window, is the use for one the following two indicator properties within the indicator's code.

Only one is valid at a time ...

#property indicator_chart_window     // Show the indicator in the chart window
#property indicator_separate_window  // Show the indicator in a separate window

EDIT: However, if the inductor uses the primary format of OnCalculate for MQL5 indicators ...

int  OnCalculate(
   const int        rates_total,       // price[] array size
   const int        prev_calculated,   // number of handled bars at the previous call
   const int        begin,             // index number in the price[] array meaningful data starts from
   const double&    price[]            // array of values for calculation
   );

... then that indicator can be applied to another indicator and it will be displayed on the same window as the source indicator, be it the main or sub window (e.g. applying a moving average to the RSI or volume indicator). This is also the same behaviour even if it were not a resource. There is no difference.

Reason: