Choosing your first EA! How to calculate the recommended margin for EAs
◆Table of Contents for First MT4 EA◆
2. Compare MT4 accounts by spreads, swaps, and execution power
3.Types of FX automated trading services and differences from MT4 EAs
I want to try FX automated trading, but there are so many options I’m not sure which is best…
If it’s about MT4 EAs, leave it to me! I’ll answer various questions about EA management.
For example, I’d like to have a monthly allowance of about 20,000–30,000 yen, but
is that possible?
Hmmm… to earn 20,000 yen a month with 10,000 units, you’d need to win about 200 pips.
It isn’t impossible, but you’ll need a certain amount of capital.
If you had 1,000,000 yen, then with 100,000 units you could aim for 20 pips per month, which is more realistic.
Just coming up with 1,000,000 yen right away is a bit…
Is there anything you can start with around 300,000 yen?
Of course there is. For example, the margin required to hold USD/JPY at 0.1 lots is around 45,000 yen, so after that, how much initial account funds you need depends on how much loss you can tolerate.
If you have an EA that can hold up to a single position, there are EAs you can run with about 100,000 yen.
However, starting from 100,000 yen, earning 20–30k per month may be risky, so it’s best to first understand how to estimate the recommended margin and what kind of returns you can expect with that capital.
The concept of recommended margin: for EAs, you can gauge it from backtests’ maximum drawdown (the maximum loss during a past period, expressed in money and percent). From that,
<Necessary Margin>+<Maximum Drawdown Amount>+ Alpha
you need to prepare account funds.
Point!
EA Operating Funds (Recommended Margin): roughly the currency pair margin + maximum drawdown × 2.
By the way, on GogoJungle’s EA sales page there is “Recommended Margin.”
Is that calculated from the formula above?
Yes indeed. GogoJungle’s recommended margin is
(Required Margin)+(Maximum Drawdown × 2)
and is calculated that way. However, the amount shown on the sales page is highly influenced by the total forward testing lots or maximum drawdown, so check how many positions and what lots the EA runs with in the overview.
One thing to note is that this applies to compounding EAs. Compounding EAs adjust the held lots according to the account funds, so as the funds grow, the held lots increase, and accordingly the recommended margin also increases.
So the recommended margin isn’t very reliable…
If you change lots or use an account with a different leverage, how should you calculate it?
That’s right. Before operating an EA, you’ll want to know, “How much is really needed to operate this EA safely?” With the right elements in place, it becomes fairly easy to figure out, so listen carefully!
I wanted to make money quickly, but perhaps it isn’t so simple…
No problem! First I’ll teach you how to read EA performance and how to calculate the recommended margin.
For how to read forward performance and backtests, check here.Here—check it out.
How to Read EA Performance and Glossary
※ At minimum, understand how to read performance and the terms!
| Name | Description |
|---|---|
| Profit | Total profit/loss during the period |
| Return (All Periods) | Profit ÷ Recommended Margin |
| Recommended Margin | (Margin required for open positions) + (Maximum drawdown during the period × 2)※1 |
| Profit Factor | Total profit ÷ total loss ※2 |
| Max Open Positions | Maximum number of positions held during the period ※3 |
| Risk-Return Ratio | Total period profit/loss ÷ maximum drawdown |
| Maximum Drawdown (%) | Maximum unrealized loss during the period ÷ account balance ※4 |
| Average Profit | Average winning amount per trade |
| Maximum Profit | Maximum winning amount in a single trade during the period |
| Average Loss | Average losing amount per trade |
| Maximum Loss | Maximum losing amount in a single trade during the period |
| Account Balance | Current account balance |
| Initial Amount | Initial account balance at the start of operation |
| Floating Profit | Current floating profit/loss of open positions |
| Currency | Trading account currency (JPY-denominated or USD-denominated) |
※1 About the Recommended Margin
GogoJungle’s recommended margin is calculated assuming maximum drawdown is about 50% of excess funds.In addition, since the recommended margin depends on the number of open positions and lot size, please check forward-operating lot size and number of positions in the overview.
Also, for martingale and averaging-down EAs, the recommended margin may appear smaller during short-term operation, but as the operation period lengthens and the number of open positions and lots increases, the required margin will grow.
Additionally, the recommended margin changes with the number of open positions and lots; so please check the forward-testing data for the EA you are evaluating.
※2 About the Profit Factor (PF)
Generally, PF above 2 is considered excellent (profit : loss = 2:1).If PF is below 1, losses will grow with each trade.
A higher PF suggests more stable profits, but very high PF isn’t always better. For EAs with high-frequency trading, PF around 1.2 can still accumulate profits over many trades, so consider the EA’s frequency and win rate when referencing PF.
Also, PF of 0 (dash) may indicate either a 100% win rate or a averaging-down martingale EA that hasn’t hit a stop loss yet.
※3 About Risk-Return Ratio
A higher risk-return ratio means you can gain more with less risk.
An EA with a high risk-return ratio tends to have small stops and few positions.
As a rule of thumb, if the risk-return ratio falls below 1.0, meaning the maximum drawdown exceeds the period’s operating profit, you are taking on significant risk.
※4 About Maximum Drawdown
Maximum unrealized loss during the operation period; EAs with large stops or many open positions will have larger max drawdown.
With simple interest, if you have a Stop Loss on an EA, max drawdown can be estimated as: number of open positions × Stop Loss (pips) × Lot size. But be careful: for averaging-down martingale EAs that do not use stops, max drawdown can vary with the forward period. .
More Details! How to Calculate the Recommended Margin for EAs
Elements needed to calculate the recommended margin are as follows.
1) Margin required per 0.1 lot for the currency pair being traded
2) The maximum number of positions the EA can hold
3) The maximum drawdown (amount) in backtests for the reference period
Other operation considerations
1) Can the MT4 from your FX provider support hedging (both long and short)? If so, is the margin required on one side only, or on both sides?
2) Presence of a Stop Level
Margin Calculation Formula (per 0.1 lot)
(Required Margin for the currency pair × Maximum Open Positions) + (Maximum Drawdown per 0.1 lot × 2※)
※ If you assume you won’t exceed 50% of excess funds for unrealized losses. This varies by person, but some use 25% or 30% as well.
Many EAs backtest at 0.1 lot, so first calculate the required margin for operating at 0.1 lot.
1) How to calculate the required margin
Required margin is the collateral needed, for example when ordering USD/JPY at 10,000 units (0.1 lot). Margin varies by currency pair, so please note.
USD/JPY and Crosses
Execution rate × Trade size ÷ Leverage = Required Margin
For example, on an account with 25x leverage, wanting to hold 10,000 units of USD/JPY when the rate is 105 yen.
105×10000÷25=42,000円
If leverage were 100x, that would be 10,500円.
For currency pairs other than JPY, if it’s EURUSD you should use the EURJPY rate as the “execution rate.”
Reference URL:Forex Finest Margin Simulator
2) How to find the maximum open positions for an EA
On GogoJungle’s product page, you can learn about the EA in the “About the Strategy” section.
▲ Example of “Pips_Miner_EA.” Here you can see the currency pair is GBPUSD and the maximum open positions is 3.
3) How to check the maximum drawdown (amount) in backtests
On GogoJungle’s product page, under the product description, in the same column as Forward Testing, there is a “Backtest” tab.
The backtest page contains two data sets: one uploaded by the developer and another generated by GogoJungle using a tool called TDS for long-term backtesting.
Downloads are available, but you can quickly see the max drawdown; just check the necessary items.
▲ In the backtest data, you should check the parameter “Lot” and the maximum drawdown.
Note that you should verify which lot setting the backtest used to obtain that max drawdown, since some backtests are run with 1.0 lot. Please confirm the “Lot = ○○” parameter in the “Parameters” section.
Also, you can see the period for the backtest under “Period.”
In addition, as a note on operation, check whether the backtest covers a long enough period; a period of 1–2 years is too short to be a reliable max DD reference, so choose data with at least 5 years.
Other operational considerations include,
1) Can the FX broker’s MT4 support hedging, and if so, is the margin on one side or both sides required.
To check this, it’s quickest to actually open both a buy and a sell for the same currency pair.
▲ When I bought 10,000 USD/JPY, the required margin was 42,447 yen.
▲ When I added a sell order for 10,000 USD/JPY, the required margin did not double; it remained 42,447 yen.
Thus, when hedging the same pair, one side (the larger lot) can use only that margin; this is called the Hedge Maximization Method Hedge Maximization method式.
Some FX brokers require margin for both the selling and buying sides when hedging, so check your broker’s rules.
2) Presence of a Stop Level
Stop Level is the number of points away from the current price that must exist before a limit order can be placed (for example, 10 points = 1 pip).
To check the Stop Level, right-click on the price quote display and select “Specifications.”
If Stop Level is 0, there is no restriction, but if it is 40 or such, you cannot place new orders unless far from the current price by at least 4 pips, which can disadvantage strategies using limit orders or trailing stops.
Be aware that such a Stop Level can affect orders and profitability for EAs that use limit orders or trailing stop strategies.
EA Margin Calculation by Type
1) EAs operating on multiple currency pairs
{(Margin for the currency pairs being traded) × (Maximum Open Positions) × Number of Currency Pairs} + (Portfolio Maximum DD × 2)
For example, let’s calculate the recommended margin for the following RECOBA Triple Swing M5
GBPJPY, EURJPY, AUDJPY across 3 currency pairs, each with a maximum of 1 position.
For multi-currency EAs, the product page usually includes backtest data for each currency pair in a portfolio, showing typical results.
Even with multiple currency pairs, the max drawdown is not simply additive across pairs.
There are scenarios where simultaneous positions and offsetting profits reduce the overall max drawdown.
In RECOBA’s case, a backtest data set was generated for three currency pairs, so you can use that max drawdown directly in margin calculation.
▲ Max drawdown for three currency pairs running simultaneously was 115,160 yen.
When opening positions, suppose GBPJPY is 137 yen, EURJPY is 125 yen, and AUDJPY is 77 yen.
With 25x leverage, the required margin for holding 10,000 units of each would be,
{(54,800) + (50,000) + (30,800)} + (115,160 × 2) = 365,000 yen
If leverage differs, max drawdown remains the same, but the required margin decreases.
2) For compounding EAs
Parameters with MM=True indicate a compounding-capable EA.
However, to determine lot sizes, there are various methods, such as allocating a percentage of account funds to lots, or
having the lot size correspond to a percentage of account funds per trade, so be sure to check the sales page. For compounding, when looking at backtests, focus on relative drawdown (percent) rather than absolute drawdown (amount). Check the MM percentage to see what the relative drawdown would be, and adjust MM accordingly.
If the relative drawdown is around 30%, it should be safely operable.
▼ See here for more on compounding MM and relative drawdown
Four years of forward performance! A low-risk to high-return capable EA: “Black Panther USDJPY”
So how was it? Do you now have a sense of how to calculate the recommended margin?
For an EA with a single position, the recommended margin is fairly easy to determine, but
what about EAs whose lot sizes increase?
That’s the so-called averaging-down martingale type EA.
In that case, you can manage it once you know the TOTAL lot size.
For example, with up to 4 positions, starting with 0.1 lot, the next positions are 0.2, 0.4, and 0.8, so
0.1+0.2+0.4+0.8 = 1.5 lots
which requires margin for 150,000 units. Then you can determine max drawdown from backtests.
I see! But needing a lot of margin means you’ll need a decent return to stay motivated…
If you’re using 1,000,000 yen and only get 30,000 yen per year, that’s not very inspiring.
Haha. Indeed. Even if annual earnings look like 500,000 yen, if the required margin is 5,000,000 yen, that equates to about a 10% annual return.
In that regard, single-position scalping is appealing because margin requirements are lower and profit potential can be high, making it especially popular.
I’ll talk next time about which types of EA tend to have higher profitability.