Unable to use custom indicator

 

Hey everyone,

I am trying to build an EA that uses Detrended Price Oscillator. I am using the iCustom() function. I've read a lot of posts and the documentation as well, but it's not working and I cannot understand something.

In the documentation it says:

iCustom

"[in]  Custom indicator name. If the name starts with the reverse slash '\', the EX5 indicator file is searched for relative to the MQL5\Indicators indicator root directory. Thus, when calling iCustom(Symbol(), Period(), "\FirstIndicator"...), the indicator is downloaded as MQL5\Indicators\FirstIndicator.ex5. If the path contains no file, the error 4802 (ERR_INDICATOR_CANNOT_CREATE) occurs."

What are ex5 files? The indicators in the folders are all .mq5.

Also when I use "\dpo" it should look for the dpo file in the Indicators folder, but the console gives me a warning saying:

'd' - unrecognized character escape sequence    ema_jani.mq5    36    57

This is what I use in my code:

      static int dpo = iCustom(_Symbol,PERIOD_CURRENT,"\dpo",dpo_Period);
      double dpoArray[];
      CopyBuffer(dpo,0,1,3,dpoArray);
      ArraySetAsSeries(dpoArray, true);

And I put them in a comment like this:

Comment("\nSlowMaArray[0]: ", SlowMaArray[0],
              "\nSlowMaArray[1]: ", SlowMaArray[1],
              "\nFastArray[0]: ", FastMaArray[0],
              "\nFastArray[1]: ", FastMaArray[1],
              "\nDPOArray[0]: ", dpoArray[0],
              "\nDPOArray[1]: ", dpoArray[1],
              "\nDPOArray[2]: ", dpoArray[2]);

On the chart the fast and slow MaArrays show up just fine, while using the exact same code, except it's iMa() of course. And DPOArrays are all 0.

I use this custom DPO indicator:

https://www.mql5.com/en/code/27

What am I doing wrong here?

Detrended Price Oscillator (DPO)
Detrended Price Oscillator (DPO)
  • www.mql5.com
The Detrended Price Oscillator eliminates the trend effect of price movement. This simplifies the process of finding out cycles and overbought/oversold levels.
 

Barni Körömi:

What are ex5 files? The indicators in the folders are all .mq5.

Also when I use "\dpo" it should look for the dpo file in the Indicators folder, but the console gives me a warning saying:

'd' - unrecognized character escape sequence    ema_jani.mq5    36    57

  1. The terminal runs EX5 files. You compile MQ5 files into EX5.
  2. Drop the backslash, it's unnecessary.
  3. The backslash is an escape character. If you want to insert a backslash, you must use two.
 
William Roeder #:
  1. The terminal runs EX5 files. You compile MQ5 files into EX5.
  2. Drop the backslash, it's unnecessary.
  3. The backslash is an escape character. If you want to insert a backslash, you must use two.

"dpo" seemed to work!

Just another question. If I just simply tell it "dpo", where will it look for it? \Indicators\dpo.mq5?

Also if I want to send this EA to my friend, they would have to put the indicator in the same place as well, right?

Thank you so much for your help!

 
Barni Körömi #If I just simply tell it "dpo", where will it look for it? \Indicators\dpo.mq5?
No. You must compile it. Then the terminal will look for Indicators\dpo.ex5
Barni Körömi #: Also if I want to send this EA to my friend, they would have to put the indicator in the same place as well, right?
Your EA is depending on that.
Reason: