
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
> would giving a different number in #define MAGICMACD 999998 to each EA solve the problem
Yes
But is much better to have MagicNumber as an extern - gives you the option of changing it, e.g. you want to run two copies of the EA with different settings
So you have
and then the function call becomes
and the order changes to
FWIW
-BB-
If anyone would like to take the time, could you look at the "simple macd" in MT and edit and create a magic nimber there then post it here for me to copy it, thanks to anyone willing to take the time,
Robbo
Hello robbo, maybe attached will be of use.
.
I 'found' a file which I presume is the one you are after. I found in: C:\Program Files\...\experts\samples\MACD Sample.mq4
.
Save in ...\experts folder
Open with editor
Compile
Open terminal - if open and not see the expert listed, close terminal and restart. This should be remedy...
Drag expert to chart
Inputs window will appear. You will see your magic number at top with associated comment string.
.
The added source code has been annotated with a key string, as has the original source code, which has also been commented out.
.
hth
fbj
Thanks for the post - and nearly there
To finish, the line
will need total generated by something like
FWIW
-BB-
LOL... yes, I posted on page.1 but today I did not reread!!!
Just wen snooping on HD and found a file and did quick shove in of extern.
Now, after post I see page.1 has some rather relevant 'added' code... what a laugh!
Oh well, my intentions were there but just not get the whole story - ummm, as per usual :o)
Hi FBJ, it makes thing alot simpler seeing what you have done, thanks, however, Barrowboy had posted in the archive about magic numbers and i did copy it, he has given me a different version to try and this is similar only the text highlighted is not present, only " extern int MagicNumber", so i will try this and comment on what results i have.
Thank you for taking the time though, it is appreciated, Robbo
EDIT
In short though, if i assign this EA to 4 different charts with 4 different currencies, when the criteria is met, a position will open on each one, even if there is a position open on a different currency
E_THIS_TO_ANY_VALUE_IN_THE = "RANGE 1...2147483647";
extern int eiMagicNumber = 12345678;
extern string __ORIGINAL_INPUTS__ = "__ARE BELOW THIS LINE__";
//--fbj/https://forum.mql4.com/24176/page2
extern double TakeProfit = 50;
extern double Lots = 0.1;
extern double TrailingStop = 30;
extern double MACDOpenLevel=3;
extern double MACDCloseLevel=2;
extern double MATrendPeriod=26;extern string CHANG
Hi FBJ, it makes thing alot simpler seeing what you have done, thanks, however, Barrowboy had posted in the archive about magic numbers and i did copy it, he has given me a different version to try and this is similar only the text highlighted is not present, only " extern int MagicNumber", so i will try this and comment on what results i have.
Thank you for taking the time though, it is appreciated, Robbo
E_THIS_TO_ANY_VALUE_IN_THE = "RANGE 1...2147483647";
extern int eiMagicNumber = 12345678;
extern string __ORIGINAL_INPUTS__ = "__ARE BELOW THIS LINE__";
//--fbj/https://forum.mql4.com/24176/page2
extern double TakeProfit = 50;
extern double Lots = 0.1;
extern double TrailingStop = 30;
extern double MACDOpenLevel=3;
extern double MACDCloseLevel=2;
extern double MATrendPeriod=26;extern string CHANG
no probs. As you'll have read above, BB politely told me the full state of affairs. I just did not get right source or complete job requirement - hahaa, pays to read total thread - which I did not.
Have fun.