There are a few things with your code... but basically, each program is using its own set of variables. With mqh you are reusing code, but that doesn't mean that every EA that includes that mqh has the same instances of variables. Try substituting your includes with the content of the include file... that's basically what happens when compiling.
For such a simple event it would be better to just have it in the EA. If you really need to communicate between different programs check things like EventChartCustom or file functions
- www.mql5.com
here are a few thing
Solution: Bypassed the EA file by declaring and dictionarying (now is THIS even a word?! Well it is now.) all variables in the GlobalNamespace file and called the GlobalNamespace from the module which manages the `SendMail()` statement.
Essentially, the less files you pass control over to, the less likely the information will be lost.
Boom!
- 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 have set out a load of variables which are to be sent out in an informational (is that even a word? It should be a word ;)) email when a position is executed.
Everything works as programmed and an email is indeed sent when a position has been successfully filled by the broker.
However, despite correctly declaring my variables, I'm getting blank spaces in my email where the variables should be.
I don't see any reason whatsoever as to why there are blank spaces where these variables should be placed in the email body, as they are correctly initialised and the appropriate #include files are ...well, included.
Why is Metaeditor refusing go play ball?
It makes no sense.
My MQH `GlobalNamespace.mqh` file is as follows:
My MQL File (EA) is as follows
This is the MQH file which sends the email upon an event:
These variables are used in a number of files, therefore I do not wish to declare them locally.