Compiling doesn't change your code. Period. It didn't include it before, it doesn't include it after.
Compiling creates your executable. Period. The executable has nothing to do with your code.
Thank you for your assistance.
I would like to incorporate the code of the .mqh file rather into the main code of my EA. I have tried but get errors like "function can only be declared in global scope". Can you help me?
Here is the code in the .mqh file
double PipPoint(string Currency) { int CalcDigits = MarketInfo(Currency,MODE_DIGITS); if(CalcDigits == 2 || CalcDigits == 3) double CalcPoint = 0.01; else if(CalcDigits == 4 || CalcDigits == 5) CalcPoint = 0.0001; return(CalcPoint); } int GetSlippage(string Currency, int SlippagePips) { int CalcDigits = MarketInfo(Currency,MODE_DIGITS); if(CalcDigits == 2 || CalcDigits == 4) double CalcSlippage = SlippagePips; else if(CalcDigits == 3 || CalcDigits == 5) CalcSlippage = SlippagePips * 10; return(CalcSlippage); }
and here is part of the code in my EA that uses that code:
int init() { UsePoint = PipPoint(Symbol()); UseSlippage = GetSlippage(Symbol(),Slippage); }
Thank you for your assistance.
I would like to incorporate the code of the .mqh file rather into the main code of my EA. I have tried but get errors like "function can only be declared in global scope". Can you help me?
Here is the code in the .mqh file
and here is part of the code in my EA that uses that code:
May be what you are looking for is 1) a compiled .mqh, that export(s) its (some) functions 2) one (several) EA(s) that import(s) the functions it needs.
Look in your reference of export in the index-tap search-field.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I just want to clear something up about .mqh Include files.
Once I have compiled an EA that uses an Include .mqh file do I still have to distribute this .mqh file to all computers and MT4 's that use this EA or does the code of the EA now include the code of the .mqh files after compilation.
If the answer is Yes I still have to distribute the .mqh file and install it in the Include folder of all computers and MT4's how can I rather insert that code into the actual EA?
Will appreciate any help!