MetaTrader4
Mastering Martingale: Optimizing Your EA on MetaTrader 4
Hey there, fellow traders! Today, let’s dive into the world of Expert Advisors (EAs) and how you can optimize your Martingale strategy on MetaTrader 4.
This EA is designed to execute a set of N trades, and here's how it works:
Scaling Up: If all trades in the set result in consecutive losses, the EA will scale up the lot size. Once you experience a set of consecutive wins, it resets back to the original lot size.
Set Size: You can adjust the number of trades per set using the parameter (N_trades_per_set).
Maintaining Lot Size: If you encounter fewer consecutive wins or losses, the EA will maintain the previous lot size for the new set.
The goal here is to increase the N_trades_per_set to enhance the EA’s safety. A good starting point is to test it in the strategy tester with N set to 3, then gradually increase it if the EA isn’t performing as expected.
Keep in mind, the effectiveness of your settings will hinge on factors like the currency pair you're trading and your take profit (TP) to stop loss (SL) ratio. A TP and SL of around 50 pips (for 4-digit pips) is a solid starting point, but don’t hesitate to try 100 pips as well.
When it comes to scaling, the martingale method typically involves doubling your lot size, for example, 2x. As for your initial lot size, it’s calculated based on your equity: for instance, $1,000 divided by $100,000 gives you a lot size of 0.01, and $3,000 divided by $100,000 will give you 0.03.
USDJPY backtest without closing trades on equity control points
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Now, let’s talk about the second EA file: the N trades per set Martingale + close and reset on equity increase. This version includes an additional parameter, and from what I’ve seen, it tends to be more consistent and stable than the previous one.
The default setting for this EA is to close trades and reset if your equity increases by $10 compared to the previous highest equity.
Here’s a backtest result for USDJPY using standard settings for the N trades per set Martingale + close and reset on equity increase from 2016 to 2019, starting with an equity of $2,000.
2019.11.09