MQH -- I suppose that means MetaQuotes Header
Open metaeditor.
Create new file, check Include.mqh
Give it a name, Functions.mqh
Paste your code above into the editor.
Delete the line -- #property library -- as it does not belong in an MQH file
Compile it, just to see if there are errors. If so, correct the errors.
---
In your main program:
#include <Functions.mqh>
Compile and run the main program.
---
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 created the the following code and placed it in the library folder, as well as the experst folder. I also renamed it MyLib.mqh, and I also renamed the ex4 resulting from compiling MyLib.mqh. :
Then I created a simple EA with a call to MyLib(.mqh, .mq4, .ex4 (each in turn)):
and I get this error:
'RyanLib.mq4' - cannot open the program file C:\Program Files\MetaTrader - Alpari UK\experts\use library.mq4 (2, 1)
The documentation is very scarce concerning how to create your own libraries. It basically just says that it is possible, and deosn't describe any of the details.
What am I doing wrong?