How to include mql5 files in an mqproj:
"The case when a custom indicator in the OnInit function creates one or more instances of itself requires separate consideration (if this technical solution itself seems strange, we will give a practical example after the introductory examples)."
Yes, thanks! It works by using:
#resource "\\Indicators\\Examples\\RSI.ex5"
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I have a mqproject (consisting of a MyEa.mq5 and a .mqproj file within the folder called "custom") and would like to use indicators from MQL5/Indicators/Examples in my EA.
With a simple EA without embedding it in a .mqproj, indicators can be loaded successfully without the need to include them. However, indicators from the MQL root cannot be loaded from a MQPROJ. The project compiles successfully, but when running in MT5, the log displays the message "Unable to load indicator 'Relative Strength Index' [4302]."
I also tried explicitly including the file in my MQL5 file:
#include "..\..\Indicators\Examples\RSI.mq5"
However, I receive the compiler error "Function 'OnInit' already defined and has a different return type." This is understandable, as there are now two MQL5 files in my MQPROJ file (the second one is RSI.mq5 which also has an void OnInit()). How can I import this indicator as a dependency in my MQPROJ?