importing mqh from the same EA folder

 

I have my EA which I have split into some files for readability.

So I have one main .mq5 file and 2 secondary mqh files that I import into the main .mq5 file.

While this is OK, in order to make this work, I need to have my main .mq5 file in the MQL5\Experts\Advisors folder, and the imported .mqh files inside Includes folder so that they can be imported via #Include <xxxx.mqh>

This makes not easy to keep a git version control in place.

How can I manage, if possible, to have my own folder with both mq5 and mqh files inside Advisors, say something like MQL5\Experts\Advisors\MyEA and still make the import of the mqh be imported from this same folder?

Example folder structure:


------  MQL5\Experts\Advisors\MyEA

          ..... myEa.mq5

          ..... mymqh1.mqh

          ..... mymqh2.mqh


With this structure, using  #Include <mymqh1.mqh>  in myEa.mq5 won't work.

 

You don't have to have them in the Include folder. You can have them in the same folder as the EA.

#include "file_name"

When in doubt, please always reference the documentation first before posting.

"If the file name is enclosed in quotation marks, the search is made in the current directory (which contains the main source file). The standard directory is not included in the search."
     

    Yes, figured it out myself after reading the docs, my bad.

     But thanks anyway for answering!