Hello you can separate them by using:
ORDER_MAGIC |
ID of an Expert Advisor that has placed the order (designed to ensure that each Expert Advisor places its own unique number) |
long |
See: https://www.mql5.com/en/docs/constants/tradingconstants/orderproperties

- www.mql5.com
When I use AccountInfoDouble(ACCOUNT_BALANCE), it returns the total balance of
4.EAs and each order is calculated based on the balance.
Correction Here, It isnt showing total balance of 4 EAs it is showing the account info with respect to the ACCOUNT_BALANCE. even if you remove all 4 EAs
the AccountInfoDouble returned values will never be affected.
in simple terms you are using the wrong function.
what
you want is to either
1. Divide the Account Balance into Number of EAs, hold each in maybe an array or in a structure.
double EA_Balance[4]; input balance_1 = 0.25, balance_2=0.25,balance_3 = 0.4; //Inside some function EA_Balance[0]= balance_1*ACCOUNT_BALANCE EA_Balance[1]= balance_2*ACCOUNT_BALANCE //etc then have #include Trade CTrade m_trade[4]; //inside Init m_trade[0].setMagic(EA_1_Magic); //etc
Correction Here, It isnt showing total balance of 4 EAs it is showing the account info with respect to the ACCOUNT_BALANCE. even if you remove all 4
EAs the AccountInfoDouble returned values will never be affected.
in simple terms you are using the wrong
function.
what you want is to either
1. Divide the Account Balance into Number of EAs, hold each in
maybe an array or in a structure.
Thank you for the reply. I understand that I should initially divide the Account Balance into Numbers of EAs, but after that I really don't know how to hold the separated balance.
Even if I set an array like "EA_Balance[0]= balance_1*ACCOUNT_BALANCE", I don't think that I can hold the EA_Balance[0] independently.
For example, I need only EA_Balance[0] is effected by EA_1's order and deal.
Hello you can separate them by using:
ORDER_MAGIC |
ID of an Expert Advisor that has placed the order (designed to ensure that each Expert Advisor places its own unique number) |
long |
See: https://www.mql5.com/en/docs/constants/tradingconstants/orderproperties
Thank you for the reply.
Even if I can separate each EA's order, I think it doesn't mean that I can hold separated balance individully.
Am I wrong?
Thank you for the reply. I understand that I should initially divide the Account Balance into Numbers of EAs, but after that I really don't know how to hold the separated balance.
Even if I set an array like "EA_Balance[0]= balance_1*ACCOUNT_BALANCE", I don't think that I can hold the EA_Balance[0] independently.
For example, I need only EA_Balance[0] is effected by EA_1's order and deal.
What?
EA1 uses MAgicNumber 1 also uses EA_Balance[0] for balance and also you will adjust EA_Balance[0] based on the
Profit or Loss that EA1 encounters
can you please explain this code I sent above here.
Though what I sent isnt complete code and has million erors the idea I beleive is clear.
when you say
hold separated balance individully.
what do you mean
what is it that you want to do exactly
link will
get you someone thatcan write the code for you and you analyse the code and see where you was going wrong

- www.mql5.com
What?
EA1 uses MAgicNumber 1 also uses EA_Balance[0] for balance and also you will adjust EA_Balance[0] based on
the Profit or Loss that EA1 encounters
can you please explain this code I sent above here.
Though what I sent isnt complete code and has million erors the idea I beleive is clear.
when you say
what do you mean
what is it that you want to do exactly
link will
get you someone thatcan write the code for you and you analyse the code and see where you was going wrong
Thank you again. I understand your idea that adjusting EA_Balance[0] based on the Profit or Loss that EA1 encounters, but how is it possible?
Everytime I send an order, take profit and cut loss, should I call EA_Balance[0] and add or subtract to that?
Thank you for the reply.
Even if I can separate each EA's order, I think it doesn't mean that I can hold separated balance individully.
Am I wrong?
You can then filter all positions and calculate profit / loss for every EA individually.
What are you trying to do exactly ?

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
When I use AccountInfoDouble(ACCOUNT_BALANCE), it returns the total balance of
4.EAs and each order is calculated based on the balance.
That’s not what I want. I
I want to separate balance of each EA virtually so that I can calculate the position-sizing based on the separated balance of each EA(function).
For example, if I run EA_1 and EA_2 on the same EA, I want to have a virtual balance for EA_1 and another virtual balance for EA_2.
.
Each balance must be independent.
Could anyone help me to solve this problem?
I would appreciate any information you could give me.
Thanks