Combine a trend-following method in USD/JPY with a grid martingale averaging! I tested whether a holy-grail EA can be created
This time, I examined a topic that EA developers have likely thought about at least once.
That is,
“If we combine a trend-following strategy with a counter-trend averaging (Martingale) approach for the USD/JPY, can we create a Holy Grail EA?”
This is the theme.
We aim to profit from trends with a trend-following approach while also accumulating profits through counter-trend averaging.
If this works well, it would become an ideal EA that can profit in both trending and ranging markets.
So, can we actually create such an EA?
To answer succinctly, in this testeven simply combining them into one EA did not yield a Holy Grail EA.
Rather, the strengths of trend-following and counter-trend did not complement each other and ended up canceling each other’s advantages.
This time, I will discuss the contents of that investigation and the approach to EA operation that emerged from it.
USD/JPY is a currency pair where trend-following EAs are relatively easier to develop
As a premise, I feel that USD/JPY tends to work well with trend-following logic.
In fact, I have developed several trend-following EAs and indicators targeting USD/JPY.
For example, representative ones include:
- Two moving average logic using Golden Cross/Dead Cross
- Three moving average logic using Perfect Order
- GMMA trend logic using 12 moving averages
- Range breakouts and breakout-type logics
There are such things.
Of course, it does not mean you can win in any market.
However, when you backtest over the long term, USD/JPY tends to allow trend-following EAs to grow profits especially when a large trend occurs.
In other words, USD/JPY tends to be more profitable when you ride the trend direction rather than trading in a range.
What happens if you combine a USD/JPY trend-following EA with a counter-trend averaging (Martingale) EA?
Here, many people might think:
“If a trend-following EA makes profits in a trending market, wouldn’t combining it with a counter-trend averaging EA that performs well in ranges be advantageous?”
This is a fairly natural notion.
In a trending market, the trend-following EA makes profits.
In a ranging market, the counter-trend averaging EA makes profits.
If so, wouldn’t you be able to create an EA that reliably targets profits regardless of market conditions?
In other words,
Trend-following EA + Counter-trend averaging EA = Holy Grail EA
This is the thinking.
Anyone developing EAs would sooner or later arrive at this idea.
I myself have created many counter-trend EAs.
Among them, one of the more recently developed ones isGrid Rush MT5.
MT4 version Grid Rashis mainly a counter-trend averaging EA targeting EUR/USD, but the MT5 version is designed to hold up to 10 positions at most.
And when tested, this maximum 10-position Martingale logic showed some advantage even for USD/JPY.
A single-position or about 3 positions cannot withstand a deep USD/JPY trend
The key for counter-trend averaging EAs is the design of the number of positions.
Trading counter-trend with only a single position tends to be disadvantageous in a market like USD/JPY that moves strongly in one direction.
Also, even with a maximum of about 3 positions in Martingale, when a deep trend occurs, you may not break even.
In other words, when trading USD/JPY with counter-trend, you need to anticipate movements deeper than shallow pullbacks or retracements to endure long-term backtests.
In contrast, designing for up to 10 positions, like Grid Rush, allows you to endure to some extent in backtests even on USD/JPY.
Of course, there are risks with Martingale.
If a strong one-way trend appears, you may face a large floating loss.
Nevertheless, by stacking multiple positions progressively rather than using a single simplified counter-trend approach, you can aim to profit on the retracements.
Trend-following logic also yields profits. Counter-trend averaging also yields profits. So what if you combine them?
From this result, many traders would think this way.
In USD/JPY, backtests for trend-following logic show positive results.
Moreover, even with up to 10 positions for counter-trend averaging, backtests show profits.
Then, if you combine these two into one EA, wouldn’t it become even stronger?
I also explored several patterns for this.
For example,
- Make a single EA that contains both trend-following and counter-trend logic and run it
- Enter based on trend-following conditions and use counter-trend logic as the exit condition
- Only use trend-following to pyramid while counter-trend averaging is ongoing
- Manage long and short positions with hedging
- Adjust maximum positions and entry conditions
We tested various combinations in this form.
However, the result was that it did not work well.
1+1=2 does not occur. Instead, they offset and weaken the overall power
The strongest realization from this investigation is that EA logic is not simply strengthened by adding numbers.
Trend-following EAs can be profitable on their own.
Counter-trend averaging EAs can also be profitable on their own.
But that does not mean combining them into one EA will double the profits.
Rather, their logics clash and cancel each other’s strengths.
Trend-following may push profits up, while counter-trend may hold positions in the opposite direction.
When counter-trend aims to profit from a retracement, trend-following may place unnecessary entries.
As a result, the logics clash and the overall performance does not improve.
This is the major point revealed by the test.
The following asset chart shows backtest results of an EA that combines USD/JPY trend-following and counter-trend logic.
In other words,
Even if you combine winning logics, the resulting EA is not necessarily profitable
as a guarantee.
Does the Holy Grail EA exist?
From this test, one realization is that the so-calledHoly Grail EAis extremely hard to create with a single logic.
Many EA creators seek the Holy Grail by combining various methods.
Trend-following, trend reversal, Martingale, breakout, pullback buying, retracement selling, anomalies, multi-time-frame analysis.
If you combine such logics, you might think you can create an EA that wins in any market.
However, when you actually try it, it often doesn’t work well.
A strong logic in trending markets tends to lose in ranges.
A strong logic in ranges tends to lose significantly in trends.
Trying to fully control this characteristic within one EA inevitably leads to strain.
This is where this test clearly showed the issue.
So, how should you think to win in FX?
What matters here is,
not that there is no Holy Grail EA = you cannot win in FX
but rather
that the important thing in EA operation is not to cram all logics into one EA, but to think in terms of a portfolio of independently functioning EAs.portfolio as independent EAs.
In other words, rather than trying to make one EA handle all trend and range markets, think of combining multiple EAs with different roles.
For example, run a trend-following EA on USD/JPY.
Meanwhile, run a counter-trend averaging EA that is strong in ranges on EUR/USD.
Or manage USD/JPY trend-following and counter-trend averaging EAs asseparate EAs.
I think this is a realistic way of thinking.
Reasons why it’s better to operate separately than to consolidate into one EA
If you combine trend-following and counter-trend averaging EAs into one, their logics may interfere with each other.
However, if run as separate EAs, you can more easily leverage each of their characteristics.
Trend-following EAs aim to profit in trending markets.
Counter-trend averaging EAs aim to profit in ranging markets.
By dividing roles like this, you do not force a single EA to decide everything.
Of course, just having a portfolio does not guarantee profits.
However, rather than stuffing everything into one EA, it makes sense to understand each EA’s characteristics and allocate funds and currencies accordingly.
USD/JPY and EUR/USD require different profitable logics
In my experience developing EAs, the currency pairs that matter areUSD/JPY and EUR/USD.
Crosses like GBP/JPY or EUR/JPY are also appealing.
However, considering spreads, price movement volatility, and trading volume, USD/JPY and EUR/USD are more practical for EA operation.
In particular, USD/JPY has a characteristic where trend-following EAs tend to perform well.
On the other hand, EUR/USD often exhibits ranging behavior, making simple trend-following logics harder to implement effectively.
In practice, applying a profitable USD/JPY trend-following logic directly to EUR/USD often does not yield good results.
The following asset chart shows backtest results of a trend-following EA with USD/JPY applied to EURUSD.
Results of looking for trend-following EAs in EUR/USD
So, I investigated whether a trend-following EA could be created for EUR/USD or whether there were existing logics that could be used.
MQL5.com hosts a large amount of EA source code for MT4 and MT5.
These are often free EA source codes.
Together, MT5 and MT4 conceal more than 2,000 EAs.
However, finding truly usable EAs among these is like searching for a grain of sand in a desert.
So, I asked OpenAI Codex, an AI agent, to search for EAs that could be used as trend-following logics for EUR/USD.
As a result, several candidates emerged.
However, when actually tested,
- EA that does not trade at all
- Counter-trend EA that aims to reverse from MACD overbought/oversold rather than trend-following
- EA that runs on a daily chart but has low practicality
- EA with no performance growth
these were the results.
In other words, specifying trend-following EAs for EUR/USD still may incorporate counter-trend logics or fail to trade properly.
Of course, if you examine each one carefully, you might find trend-following EAs usable for EUR/USD.
From my experience, I found it difficult to identify clearly effective swing-type trend-following EAs for EUR/USD.
EUR/USD is more amenable to counter-trend and range logics
Compared to USD/JPY, EUR/USD tends to be more range-bound in the long term.
Therefore, in EUR/USD, it is easier to construct counter-trend or range-based logics such as mean-reversion strategies.
Based on this idea,Grid Rushwas developed.
Grid Rushis an EA that mainly implements counter-trend averaging for EUR/USD.
In ranging markets, profits can accumulate gradually, but strong one-directional trends require caution.
In other words, it carries the so-called “gradual profit then a big surge” risk.
Nevertheless, in EUR/USD, counter-trend EAs tend to perform well, I believe.
Is buying on dips and selling on rallies a form of counter-trend?
Here, I’d like to clarify the concepts of buying on dips and selling on rallies.
Buying on dips means buying during temporary pulls in an uptrend.
Selling on rallies means selling during temporary rallies in a downtrend.
In the short term, this may look like a counter-trend approach.
However, on a higher timeframe, entries align with the trend, so fundamentally this is trend-following.
This is multi-timeframe analysis.
On the long-term timeframe, trend-following.
On the short-term timeframe, aiming for temporary counter-movements.
Because of this structure, it should be considered different from a simple counter-trend EA.
When classifying EAs, looking only at short-term entries may make it appear as counter-trend.
However, when viewing the long-term direction, it naturally seems like a trend-following logic.
What this test revealed
In this article, I examined whether combining USD/JPY trend-following with counter-trend averaging could create a Holy Grail EA.
The results are as follows.
First, USD/JPY is a currency pair where trend-following EAs tend to work comparatively well.
There are situations where trend-following logics such as Golden Cross/Dead Cross, Perfect Order, GMMA, and breakouts make it easier to capture trends.
On the other hand, counter-trend averaging can also show a certain edge in USD/JPY depending on the maximum number of positions and the design.
However, simply merging the two into one EA did not yield the expected performance.
Rather, the trend-following and counter-trend logics canceled each other out and failed to leverage their strengths.
In other words, creating a Holy Grail EA is extremely difficult.
What is realistic is to build an EA portfolio
So, what should you do?
In my view, the realistic approach isto build an EA portfolio.
Use trend-following EAs for USD/JPY.
Use counter-trend averaging EAs for EUR/USD.Combine single-position EAs with multi-position EAs.Separate consideration of trend-type, range-type, and anomaly-type.
In this way, it is more practical to operate each EA with its own role.
Of course, making the portfolio more complex does not guarantee wins.
Markets have trends and ranges.
Rather than trying to cover all markets with a single EA, assemble EAs that are strong in different market conditions.
I believe this is a very important concept in EA operation.
Summary: aim for Holy Grail Portfolio, not Holy Grail EA
In this test, I examined whether USD/JPY trend-following and counter-trend averaging could be combined to create a Holy Grail EA.
The result is that simply consolidating into one EA does not yield Holy Grail status.
Trend-following EAs can be profitable on their own.
Counter-trend averaging EAs can also be profitable on their own.
However, when combined, 1+1 does not equal 2.
Rather, they can cancel out each other’s strengths.
That is the difficulty of EA development.
But this is not a pessimistic conclusion.
Rather, in EA operation, it is more practical to create a portfolio by combining multiple EAs than to search for a single Holy Grail EA.
There are logics suited to USD/JPY.
There are logics suited to EUR/USD.
Trend-following has its strengths, and counter-trend has its strengths.
What is important is not to cram them into one EA, but to separate roles and leverage them.
Rather than searching for a Holy Grail EA,
build a portfolio that brings you closer to the Holy Grail.
This is the conclusion drawn from this test.
Note: This article contains technical and educational content related to EA development and backtesting and does not advocate any specific investment actions. There are risks of loss in FX, CFDs, and automated trading. Please make trading decisions at your own responsibility.