Forex Zone - Forex Forum

EA Behaviour

Discussion started on MT4 / MT5 EAs

  • Sr. Member
  • Posts: 352
  • Points: 71
  • Likes Received: 150
  • Reputation: +11/-0
I don't know if this is the right part of the forum for this topic.
What would be the effect if I run 2 EA's on 1 account, both trade in completely different ways but will have the same currency pairs.
I want to run Easier EA which Crazyprog coded for me, and the other is one of the grid EA's.
The broker does allow hedging, so being long and short in the same currency won't matter, my concern is, will the grid EA see the other EA's trades and decide to close it because it reached a profit level it was looking for?
Or is this where the magic numbers come in?

Free Grid EA:


Linkback: https://www.forex.zone/mt4-mt5-eas/7/ea-behaviour/152/
#1 - August 07, 2018, 06:58:46 PM
« Last Edit: July 27, 2024, 05:47:15 PM by Admin »

Administrator
  • Hero Member
  • Posts: 5114
  • Points: 29361
  • Likes Received: 5122
  • Reputation: +220/-14
Yes, this is what the Magic Numbers are used for. As long as you use a different Magic Number for each EA running, it will work and they wont interfere with each other. Magic Numbers are used by EA's to recognize and manage their own trades. So an EA will ignore any trades with different magic numbers or with no magic number (eg. manual trades).
#2 - August 07, 2018, 07:04:46 PM

EA Behaviour in MT4 / MT5 EAs_topic=585

  • Sr. Member
  • Posts: 352
  • Points: 71
  • Likes Received: 150
  • Reputation: +11/-0
Thank you
Awesome site, Awesome forum.
#3 - August 07, 2018, 07:49:18 PM

  • Sr. Member
  • Posts: 352
  • Points: 71
  • Likes Received: 150
  • Reputation: +11/-0
What will happen in a case where I run 2 EA's, but 1 doesn't have the option to change the magic nr?
The Easier EA Crazyprog coded has the magic nr option, the Stochastic Martingale EA Admin changed (which is working like a well oiled machine now, thanks again) only shows the expert ID (500), is that the magic nr? 
#4 - August 08, 2018, 07:44:30 AM

Administrator
  • Hero Member
  • Posts: 5114
  • Points: 29361
  • Likes Received: 5122
  • Reputation: +220/-14
What will happen in a case where I run 2 EA's, but 1 doesn't have the option to change the magic nr?
The Easier EA Crazyprog coded has the magic nr option, the Stochastic Martingale EA Admin changed (which is working like a well oiled machine now, thanks again) only shows the expert ID (500), is that the magic nr?
If an EA doesn't have a Magic Number input, most likely it has a set value for the Magic Number hard coded into the EA for some reason. Which means it does have a Magic Number, but you just can't adjust it.

If you are referring to the 'MartingailExpert_v1.0_Stochastic (New Bar Version)', it has 2 Magic Number inputs. They are called 'Magicbuy' and 'Magicsell'. One is for buy orders only and the other is for sell orders only. Whoever coded that EA originally made the EA this way. Maybe you are talking about another EA.
#5 - August 08, 2018, 12:47:52 PM

  • Sr. Member
  • Posts: 352
  • Points: 71
  • Likes Received: 150
  • Reputation: +11/-0
All good.
I do refer to the Martingale Stochastic, so that one's magic nr is sorted.
Thanks
#6 - August 08, 2018, 01:07:31 PM

Administrator
  • Hero Member
  • Posts: 5114
  • Points: 29361
  • Likes Received: 5122
  • Reputation: +220/-14
Just a note, but if you ever do run an EA that doesn't have inputs for Magic Number(s) and you don't have access to the source code, you can still find out the Magic Number used. You can just hover your mouse over one of the EA's trades in the terminal. There should be a number there that shows up. This is the Magic Number. Once you know that, then you can make sure to set a different Magic Number for any other EA's you have running at the same time.
#7 - August 08, 2018, 05:30:16 PM

  • Sr. Member
  • Posts: 352
  • Points: 71
  • Likes Received: 150
  • Reputation: +11/-0
Thanks again.
Would you suggest I give each currency pair it's own magic nr for the same EA.
So if  I trade 2 EA's 
USDCHF on EA 1 has magic nr 123, on EA 2 magic nr 456
USDCHF on EA 2 Has magic nr 888 on EA 2 magic nr 45678
#8 - August 08, 2018, 06:58:40 PM

  • Sr. Member
  • Posts: 352
  • Points: 71
  • Likes Received: 150
  • Reputation: +11/-0
So if  I trade 2 EA's 
USDCHF on EA 1 has magic nr 123, on EA 2 magic nr 456
EURUSD on EA 1 Has magic nr 888 on EA 2 magic nr 45678


#9 - August 08, 2018, 07:00:24 PM

Administrator
  • Hero Member
  • Posts: 5114
  • Points: 29361
  • Likes Received: 5122
  • Reputation: +220/-14
Yes, if you are running multiple EA's on the same chart at the same time, you should use different Magic Numbers. Even if they are not both the same exact EA too.
#10 - August 08, 2018, 07:53:43 PM

  • Newbie
  • Posts: 13
  • Points: 185
  • Likes Received: 6
  • Reputation: +1/-0
The magic numbers have been explained very well here. Good work:)
#11 - August 14, 2018, 10:56:39 PM

Members:

0 Members and 1 Guest are viewing this topic.