Trend Follower EA

countertrend forex robot

This a a review of one of my private forex robots that follows trend on EURUSD, M30 timeframe. When it comes to automatic forex trading I’d like to keep things as simple as possible, more rules lead to curve fitting and worse long term performance. This forex robot opens trades when short term support and resistance lines are broken and the volatility is high. The theory says that volatility came into play right before a big movement up or down. My trend follower EA is a frequent trader, ~2500 trades opened during 13 years which is a lot considering the fact that it only opens one trade at a time! This result pleases me as EURUSD is known to be one of the trending pairs. It works on multiple pairs but I rather use it on EURUSD only because the drawdown is acceptable and recovery is pretty fast. All of my robots are designed to work as standalone forex robots but together they work much much better. The drawdown length is reduced from more than one year to 3 months because the strategies are covering all market aspects and each EA ends up being profitable.

The strategy

It simply follows the trend. When the current candle closes above the previous high and the volatility exceeds a certain value, a long position is triggered. If the current candle closes bellow the previous low and the volatility exceeds a certain value, a short opens. It can’t be done as simple as that, however, the “secret” lays in the way I calculate volatility. I only use price action, no indicator needed, I do not like indicators very much because they repaint. The last thing I need is to forecast the past or to make predictions about the future using meaningless information. This EA is designed to open trade based on the present market configuration.

Take Profit and Stop Loss levels

It opens positions at the end of the current candle, but it closes them whenever necessary, it doesn’t wait for the current candle to close in order to exit the trade. Take profit and stop loss are also broker side thus protecting the account if the VPS shuts down or if the internet connection is lost.

Take profit:  between 40 and 55 pips
Stop loss: between 50 and 167 pips

Take profit is smaller than stop loss but the number of winning trades exceeds the number of losing trades. The big advantage is the fact that 0nce open, a trade has enough room to move, this way the noise is eliminated.

Backtests and statistics

First, 13 years backtests:

Trend follower backtests

Trend follower backtests

Total number of trades: 2465
Won pips: 21,000
Maximum drawdown: 980 pips
Maximum drawdown length: 410 days (more than 1 year)
Average pips per year: 1615
Won trades: 75%
Lost trades: 25%
Maximum consecutive wins: 32
Maximum consecutive losses: 8
Average consecutive wins: 5
Average consecutive losses: 2
Average profit trade: 50 pips
Average loss trade: 122 pips

Backtests show that all years are profitable:

Trend following profit years

Trend following profit years

Of course, money is not made on backtests but they are needed to analyze the robustness of the EA. So, how robust is it?

Robustness analysis

1. 2465 trades during 13 years is enough for the backtests to be considered valid from this point of view.

2. Backtest shows 1226 long trades and 1239 short trades, the distribution is almost equal which is great!

3. The profits are almost equally distributed over the years and this is a great thing too.

4. It passes my personal robustness criteria:

Real Profit Ratio (RPR) = ((WFER * Total profit in pips) / number of years to backtest) / MCWCS


WFER = Walk Forward Efficiency Ratio

MCWCS = Monte Carlo Worst Case Scenario (MC analysis is performed having the best selected parameters as a starting base)

If RPR<0.5, the EA should be discarded.
If RPR>0.5 AND RPR<0.6 – modest performance
if RPR>0.6 AND RPR<0.8 – good performance
if RPR>0.8 – an excellent EA!

In this case, RPR is 0.7 – good performance.

You may wonder why am I using this weird formula. I’m using it because it respects the following:

– money is made in the future, not in the past, so in order to see how this EA should behave in the future, I’m performing a WFR analysis first. Total profit of pips made in the backtests are multiplied with Walk Forward Efficiency Ratio which is usually less than 1 because in real life we expect less pips than in backtests.

– MCWCS (Monte Carlo Worst Case Scenario) shows us the worst case scenario we can expect.

– My formula is nothing more than the number of pips we can expect in real life / maximum drawdown in pips shown by MCWCS.

My trend follower EA passes this.

5. It survives on a correlated pair like USDCHF without any adjustments.


The drawdown length is quite high, backtests show a maximum drawdown length of more than one year and nobody has the patience to wait that much. But the drawdown length is a common expert adviser problem. More than 95% of them have a prolonged drawdown period and the answer is very simple: market changes, it can’t trend all the time. So during the swing periods the EA merely survives.

How to use it

I can’t just discard an excellent EA just because sometimes the market doesn’t trend. The proper choice is to build a multiple strategy portfolio. My portfolio (this trend follower is a part of it shown only 3 months of drawdown, the maximum drawdown length is 3 months only!