How to embed indicator into the final EX4 file ?

 
Hi,

I am trying to release my first EA on this platform. But my EA needs an indicator x (I do have the source file of) to work. The Version tab of the release process states
"The Product may contain only one EX4 file, additional files are not allowed. The name of EX4 file and names of input parameters must be written in Latin characters. To create a user-friendly interface, we recommend you to use Resources."

Since one EX4 file only is required, how do I embed (or compile) my indicator file along with the EX4 file ?
I came across different threads on this topic and I tried out the Resources link as well, but none of them worked for me. Could you help me ?

Note: My EA is coming from a code generator called fxdreema, therefore not sure if that makes any difference.

Regards,
Moussa
 
Moussa Diarra:
Hi,

I am trying to release my first EA on this platform. But my EA needs an indicator x (I do have the source file of) to work. The Version tab of the release process states
"The Product may contain only one EX4 file, additional files are not allowed. The name of EX4 file and names of input parameters must be written in Latin characters. To create a user-friendly interface, we recommend you to use Resources."

Since one EX4 file only is required, how do I embed (or compile) my indicator file along with the EX4 file ?
I came across different threads on this topic and I tried out the Resources link as well, but none of them worked for me. Could you help me ?

Note: My EA is coming from a code generator called fxdreema, therefore not sure if that makes any difference.

Regards,
Moussa

https://www.mql5.com/en/docs/runtime/resources

Documentation on MQL5: MQL5 programs / Resources
Documentation on MQL5: MQL5 programs / Resources
  • www.mql5.com
Resources - MQL5 programs - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 

Just embed the other indicator(s) inside your indicator/EA. Add the CI(s) to your code as a resource.
          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)

 
William Roeder #:

Just embed the other indicator(s) inside your indicator/EA. Add the CI(s) to your code as a resource.
          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)

Thanks for your answer. I have tried out both the Resources directive and the CI directly. In both cases, I got something similar to this.

test on EURUSD,H1
 2020.04.01 09:29:58  cannot open file 'MQL4\indicators\choppinessindex.ex4' [2]
 2020.04.01 09:29:58  cannot open file 'MQL4\indicators\choppinessindex.ex4' [2]
 2020.04.01 09:29:58  cannot open file 'MQL4\indicators\choppinessindex.ex4' [2]
 2020.04.01 09:29:59  cannot open file 'MQL4\indicators\choppinessindex.ex4' [2]
 2020.04.01 09:30:00  cannot open file 'MQL4\indicators\choppinessindex.ex4' [2]
 2020.04.01 09:30:00  cannot open file 'MQL4\indicators\choppinessindex.ex4' [2]
 2020.04.01 09:30:00  cannot open file 'MQL4\indicators\choppinessindex.ex4' [2]
 2020.04.01 09:30:01  cannot open file 'MQL4\indicators\choppinessindex.ex4' [2]
 2020.04.01 09:30:01  cannot open file 'MQL4\indicators\choppinessindex.ex4' [2]
 2020.04.01 09:30:01  cannot open file 'MQL4\indicators\choppinessindex.ex4' [2]
 2020.04.01 09:30:02  cannot open file 'MQL4\indicators\choppinessindex.ex4' [2]
 2020.04.01 09:30:02  cannot open file 'MQL4\indicators\choppinessindex.ex4' [2]
 2020.04.01 09:30:03  cannot open file 'MQL4\indicators\choppinessindex.ex4' [2]
 2020.04.01 09:30:03  cannot open file 'MQL4\indicators\choppinessindex.ex4' [2]
 2020.04.01 09:30:03  cannot open file 'MQL4\indicators\choppinessindex.ex4' [2]
 2020.04.01 09:30:04  cannot open file 'MQL4\indicators\choppinessindex.ex4' [2]
 2020.04.01 09:30:04  cannot open file 'MQL4\indicators\choppinessindex.ex4' [2]
 2020.04.01 09:30:04  cannot open file 'MQL4\indicators\choppinessindex.ex4' [2]
 2020.04.01 09:30:05  cannot open file 'MQL4\indicators\choppinessindex.ex4' [2]
 2020.04.01 09:30:05  cannot open file 'MQL4\indicators\choppinessindex.ex4' [2]
 2020.04.01 09:30:06  cannot open file 'MQL4\indicators\choppinessindex.ex4' [2]
there are no trading operations

I understand the error, but why cannot I link the choppinessindex.ex4 to the main EA like any other programming languages ? I am new in this area, so forgive my ignorance.

Note: On my laptop I can compile the EA without any issues, but the validation process at this site always fails. I just want to link the choppinessindex.ex4 indicator to the EA, so that I won't have to supply the indicator separately.

 
Thanks for replying, my  answer can be found at thread #3.
 
You haven't added the resource properly. Re-read the answers; post the code if you can't.
 

You need to embed it like so:

#resource "\\Indicators\\SampleIndicator.ex5"

Then call it using "::":

handle_ind=iCustom(_Symbol,_Period,"::Indicators\\SampleIndicator.ex5");

At the end of the page https://www.mql5.com/en/docs/runtime/resources there's an example.

Documentation on MQL5: MQL5 programs / Resources
Documentation on MQL5: MQL5 programs / Resources
  • www.mql5.com
Resources - MQL5 programs - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Alexandre Borela #:

You need to embed it like so:

Then call it using "::":

At the end of the page https://www.mql5.com/en/docs/runtime/resources there's an example.

Thanks a million, it works fine. I had many instances of MT4 (MQL editor). The instance I was using was not actually where my indicator resides in.
 
William Roeder #:
You haven't added the resource properly. Re-read the answers; post the code if you can't.
Thanks a million, it works fine. I had many instances of MT4 (MQL editor). The instance I was using was not actually where my indicator resides in.