# beginner question - how to split/organise funds for different EAs?

Hi,

If there is £1000 in the balance, and I want to run 2 different EAs for 2 different charts, is there a way I can organise/split the funds, e.g. 1st EA can have £700 and 2nd EA can have £300 to trade? Or do they have to all trade from the total fund of £1000?

I am new to MT5 so would really appreciate any help! I have looked throughout google/youtube but couldn't see a clear solution.

No, that balance is shared by all EAs. You can't split it.

Program your EAs to do proper risk calculation based on stop size and the fractional percentage you set, and you will not have a problem.

Also remember to consider the required margin when evaluating the order volume.

Fernando Carreiro #:

No, that balance is shared by all EAs. You can't split it.

Program your EAs to do proper risk calculation based on stop size and the fractional percentage you set, and you will not have a problem.

Also remember to consider the required margin when evaluating the order volume.

Thank you so much for your reply. Pardon me for being a novice and asking stupid questions, but let's say if both EAs have fixed lot size of 0.01, can I change one to 0.007 and another to 0.003, assuming that they both adjust risk calculation automatically? Also, is 'required margin' considered in case there is any deficit from each EA's allocated funds?

Bo_Master #: Thank you so much for your reply. Pardon me for being a novice and asking stupid questions, but let's say if both EAs have fixed lot size of 0.01, can I change one to 0.007 and another to 0.003, assuming that they both adjust risk calculation automatically? Also, is 'required margin' considered in case there is any deficit from each EA's allocated funds?

The question is unfortunately is a little nonsensical for the following reasons:

1. Most brokers usually only allow a minimum volume of 0.01, so 0.007 and 0.003 may not be viable.
2. Using a fixed lot size on an EA, means that it is not properly adjusting for the risk of the stop-loss. It is however, fixed used margin, but variable risk.
3. Required margin is what you need to cover from your funds while the position is open. It is returned when the position is closed. However, if your load you deposit too much with used margin, then you will not have enough funds to cover your stop-loss risk and you can end up blowing your account.

Fernando Carreiro #:

The question is unfortunately is a little nonsensical for the following reasons:

1. Most brokers usually only allow a minimum volume of 0.01, so 0.007 and 0.003 may not be viable.
2. Using a fixed lot size on an EA, means that it is not properly adjusting for the risk of the stop-loss. It is however, fixed used margin, but variable risk.
3. Required margin is what you need to cover from your funds while the position is open. It is returned when the position is closed. However, if your load you deposit too much with used margin, then you will not have enough funds to cover your stop-loss risk and you can end up blowing your account.
Ah... I see. I appreciate your informative reply! How would you, in simple terms, explain to someone with very limited financial / trading background how to ''program your EAs to do proper risk calculation based on stop size and the fractional percentage you set''?

Bo_Master #:
Ah... I see. I appreciate your informative reply! How would you, in simple terms, explain to someone with very limited financial / trading background how to ''program your EAs to do proper risk calculation based on stop size and the fractional percentage you set''?

I would say ... start here ...

William Roeder, 2023.01.04 13:27

Risk depends on your initial stop loss, lot size, and the value of the symbol. It does not depend on margin and leverage. No SL means you have infinite risk (on leveraged symbols). Never risk more than a small percentage of your trading funds, certainly less than 2% per trade, 6% total.

1. You place the stop where it needs to be — where the reason for the trade is no longer valid. E.g. trading a support bounce, the stop goes below the support.

2. AccountBalance * percent/100 = RISK = OrderLots * (|OrderOpenPrice - OrderStopLoss| * DeltaPerLot + CommissionPerLot) (Note OOP-OSL includes the spread, and DeltaPerLot is usually around \$10/PIP, but it takes account of the exchange rates of the pair vs. your account currency.)

3. Do NOT use TickValue by itself - DeltaPerLot and verify that MODE_TICKVALUE is returning a value in your deposit currency, as promised by the documentation, or whether it is returning a value in the instrument's base currency.
MODE_TICKVALUE is not reliable on non-fx instruments with many brokers - MQL4 programming forum (2017)
Is there an universal solution for Tick value? - Currency Pairs - General - MQL5 programming forum (2018)
Lot value calculation off by a factor of 100 - MQL5 programming forum (2019)

4. You must normalize lots properly and check against min and max.

5. You must also check Free Margin to avoid stop out

6. For MT5, see 'Money Fixed Risk' - MQL5 Code Base (2017)

Most pairs are worth about \$10 per PIP. A \$5 risk with a (very small) 5 PIP SL is \$5/\$10/5 or 0.1 Lots maximum.

Articles

Market math: profit, loss and costs

Evgeniy Ilin, 2022.10.21 11:43

In this article, I will show you how to calculate the total profit or loss of any trade, including commission and swap. I will provide the most accurate mathematical model and use it to write the code and compare it with the standard. Besides, I will also try to get on the inside of the main MQL5 function to calculate profit and get to the bottom of all the necessary values from the specification.

Fernando Carreiro #:

I would say ... start here ...

• Forex Position Sizing
• Calculating Position Sizes
• Know What Your Position Size Will Be
• Tips On Forex Position Sizing
• Position Size Calculator - BabyPips.com