Algorithmic and Mechanical Forex Strategies | OneStepRemoved

  • Articles
  • Sophisticated Web Sites
  • Automated Trading
  • Testimonials
  • Contact

3 Forex Expert Advisors to Build Your System Around

November 21, 2013 by Andrew Selby Leave a Comment

Many of the traders interviewed in the Market Wizards books expressed concern that too many traders place too much emphasis on entry and exit signals. They suggest that topics like position sizing and risk management are far more important.

However, quantitative traders still have to decide on some criteria to properly define their entry and exit signals. With so many options out there, it can be more difficult than those Market Wizards books suggest to find and decide on a decent entry and exit strategy that has an edge.

Even after you find and develop your system, there is always room for improvement. For that reason, many forex traders are constantly looking for new ideas, edges, and expert advisors. Babypips.com published their Top 3 Featured Expert Advisors for November 2013 at the beginning of this month.

forex expert advisor

Babypips.com has profiled three different forex expert advisors that might be useful in creating profitable trading systems.

They went through the trouble of backtesting each of these EAs from October 2010 through October 2013. Here are the highlights:

The Linear Weighted Moving Average Strategy

This expert advisor was suggested to me by a kind forum user bobbillbrowne in the Expert Advisors and Automated Trading section.

In a nutshell, it makes use of the linear weighted moving averages (LWMA) on the short-term time frames such as 1-min, 5-min, and 15-min charts.

This strategy signaled a total of 23 trades over the course of the backtesting period. The average profit on a trade was 0.43%, the win rate was 56.52%, and the maximum drawdown was 13.45%.

The AUD/USD MACD Cross Strategy

My search for profitable EAs also led me to the MLQ4 Codebase via the MT4 trading platform.

I stumbled upon this MACD Cross system by author ilkyulee, who specified that this robot must be used on AUD/USD’s daily chart.

This strategy signaled a total of 46 trades over the course of the backtesting period. The average profit on a trade was 1.16%, the win rate was 26.09%, and the maximum drawdown was only 5.69%.

The MACD Sample EA Strategy

I also took a look at the sample systems included in MT4 and found an updated version of the MACD Sample EA.

The currency pair and time frame weren’t specified so I just decided to run the tests on my favorite pair and time frame, which is EUR/USD 1-hour.

This strategy signaled a total of 190 trades over the course of the backtesting period. The average profit on a trade was 0.59%, the win rate was 73.68%, and the maximum drawdown was only 0.39%. Not a bad start for an out-of-the-box sample strategy.

Proceed With Caution

The article then goes on to remind traders that automated trading can be dangerous:

Before you trust a robot with your life (or in this case, your hard-earned cash), make sure that it’s a good autobot and not a bad decepticon.

In other words, you gotta do your homework and additional research to figure out if the EA is consistently profitable or not.

The author also cautions that past performance does not guarantee future results. He also explains that just because an expert advisor does not initially have a great P&L does not mean that it will never be profitable. It may just need to be adjusted in a certain way to become profitable.

 

Filed Under: How does the forex market work? Tagged With: expert advisor, forex, trading systems

Triple Crossover System

July 8, 2013 by Andrew Selby 2 Comments

The biggest problem with a basic moving average crossover system is that it is always in the market. This leads to many false signals and whipsaws. It also tends to give back a large portion of its profit as the slower moving average lags the faster one.

Looking for a way to improve on this system, I came across the Triple Moving Average Crossover System. This system operates in a similar manner, but adds a third moving average to confirm entries and create earlier exit signals. In theory, this will create less false entry signals and retain more profits on successful trades.

About The System

This system uses three different moving averages to asses the direction of a trend and then follow it, eventually exiting the trade when the trend ends.

An entry signal is generated when the fastest moving average crosses the slowest moving average and then crosses the middle moving average. The trade is then held until the fastest moving average crosses or touches the middle moving average. The system also sets an initial stop at the high or low of the most recent price swing.

EMA ,Exponential,Moving,Average

Variations

One of the most interesting aspects of this system is that you can create an almost unlimited number of variations based on the moving averages you elect to use. The most common approach is to use Exponential Moving Averages (EMAs) for shorter term systems, and Simple Moving Averages (SMAs) for longer term trading ranges

For shorter time frames that trade one-hour bars or faster, using 4 EMA, 9 EMA, 18 EMA or 10 EMA, 25 EMA, 50 EMA is recommended.

For longer time frames that trade daily or weekly bars, using 4 SMA, 10 SMA, 50 SMA or 5 SMA, 10 SMA, 20 SMA is recommended.

The Rules

For the following backtesting results, these are the parameters used:

Market: Great Britain Pound vs Japanese Yen

Period: 1 Hour Bars (Jan 14, 2005 through October 12, 2011)

Fast Moving Average: 10 EMA

Medium Moving Average: 25 EMA

Slow Moving Average: 50 EMA

Go Long When:

  • 10 EMA crosses above the 25 EMA and then the 50 EMA

Go Short When:

  • 10 EMA crosses below the 25 EMA and then the 50 EMA

Exit Long When:

  • 10 EMA crosses below or touches the 25 EMA

Exit Short When:

  • 10 EMA crosses above or touches the 25 EMA

Backtesting Results

An investment of $10,000 in this system would have returned a profit of $6,958.64 in the period tested. This represents a return of 69.6% in six years and ten months. It is very interesting to note that the S&P 500 is just slightly up over the same time period.

The system posted a profit factor of 1.10 and and expected payoff of 6.26. It had a maximal drawdown of 22.79% and a relative drawdown of 26.05%.

It’s largest profit was 3216.57 and its average profit was 230.17, while its largest loss was 729.36 and its average loss was 95.86. The system was profitable on 31.32% of its trades.

System Analysis

This system has a lower Win Rate and a lower Payoff Rate than the SPY 10/100 Long Only System, but it also trades more than 27 times more frequently. The vast number of trades allows it to make up for its lower Win and Payoff Rates and actually become more profitable.

The goal of adding the middle moving average was to improve the system’s ability to hold on to profits. This likely contributed to the Triple Moving Average Crossover System having a far lower drawdown than the SPY 10/100 Long Only System.

Despite having a lower Win Ratio and Profit Ratio, the fact that this system can make profitable trades as frequently as it does with such low drawdowns makes it absolutely worth further review and testing.

Possible Improvements

My main reservation about these test results are that they are exclusive to one market over one seven year period. I would be very curious to see if the system can generate similar results when tested across multiple different markets and time periods. This would prove that the system is not just benefiting from testing an ideal scenario.

It would also be interesting to test this system using a wide range of moving averages. While the results we have prove that the system is worth developing, I am curious whether adjusting the moving averages could either improve or ruin the system’s returns. There are endless combinations that we could test, but I would be especially interesting in how adjusting the middle moving average affects drawdowns.

One of the key aspects of moving average systems is that they perform best in trending markets and generally underperform in range-bound markets. Adding a component that would allow you to distinguish between trending and range-bound markets and only trade the system in the trending markets might be very profitable. It also, however, might result in curve-fitting that could backfire down the road.

Filed Under: Trading strategy ideas Tagged With: trading systems, triple crossover system

Multiple Day Mean Reversion System

June 27, 2013 by Andrew Selby Leave a Comment

The Multiple Day Mean Reversion System is designed to pick up quick profits from ETFs that wander a little too far from their current trend. It is based on the mean reversion assumption that all markets will eventually revert back to their average price.

Similar to the 3 Day High/Low Mean Reversion System, this one has outperformed the S&P 500 over the past 12 years with a significantly lower drawdown. It is designed to trade a basket of 20 ETFs that represent a broad spectrum of global markets.

The Rules

Go Long When:

  • ETF > 200 day SMA
  • ETF < 5 day SMA
  • ETF has closed lower 4 out of 5 days

Go Short When:

  • EFT < 200 day SMA
  • ETF > 5 day SMA
  • ETF has closed higher 4 out of 5 days

Exit Long When:

  • ETF crosses above 5 day SMA

Exit Short When:

  • ETF cosses below 5 day SMA

 

About The System

The Multiple Day Mean Reversion System was popularized by Larry Connors and Caesar Alvarez in their 2009 book High Probability ETF Trading. Like all mean reversion strategies, this approach is based on the assumption that a market that has trended in one direction will eventually revert back to its average price.

This system targets up-trending ETFs that fall below their 5 day simple moving average while closing lower in four out of five days. It also targets the inverse, down-trending ETFs that rise above their 5 day simple moving average while closing higher in four out of five days. After establishing this position, the system holds it until the ETF crosses back above/below its 5 day SMA.

Backtesting Analysis

Backtesting results for this system were posted on Sanz Prophet’s blog in September of 2012. Those results reported the system’s performance from January 1, 2002 through August 1, 2012. During that time, the system made 1,901 trades. Of those trades, 71% were profitable. The compound average return during that time was 9.44%, with a maximum drawdown of 13.37%.

The returns posted by this system over the past decade are impressive, and the low drawdown makes them even more appealing to many investors. The system also performed exceptionally well during the financial meltdown in 2008. While the S&P lost half its value, the Multiple Day Mean Reversion System posted tremendous gains of almost 50%.

Improving The System

Limiting Downside

The Multiple Day Mean Reversion System has the same major flaw as the 3 Day High/Low Mean Reversion System. While both systems have incredibly high win rates, they both have open-ended loss potential on the downside. If the only way to close out a position is for it to cross its 5 day SMA, then you could theoretically be caught holding a long position as it drops to zero. Taking this kind of risk to make a relatively small profit on most of the trades is like picking up nickels in front of a steamroller. You’re just asking to get flattened.

Mean reversion faces risks of large losses

Small profits and big risks means that the market is going to steamroll you one day.

I would be very interested to see how the results would change if a stop-loss element was introduced to the system. Using Bayesian Inference or even a simple ATR Multiple to set the stops would absolutely limit the downside. Those stops could also reduce the overall returns depending on how many of those  losing trades eventually close out as small winners.

Selective Implementation

The biggest strength of this system was its performance during the financial meltdown in 2008. Based on that performance, it is obvious that this system works best in highly volatile markets. Therefore, it might be a good idea to implement a volatility condition that would only permit the system to make trades when volatility shot up.

We wouldn’t want a system that only trades one out of every 12 years, so we would have to couple this with an alternative system. However, if we could find a system that worked well during normal markets and underperformed in volatile markets, we could combine the two and have them switch back and forth based on the current volatility conditions. This would allow us to maximize the strengths of each system while minimizing the weaknesses.

Filed Under: Trading strategy ideas Tagged With: mean reversion, trading systems

3 Day High/Low Mean Reversion System

June 6, 2013 by Andrew Selby 1 Comment

Let’s take a look at a system that works almost completely opposite from the other systems we have been looking at.

This system targets small, quick profits and holds on to its losers until they revert to the mean. It also outperformed the S&P 500 by almost double from 2002-2012.

About The System

The 3 Day High/Low System is a mean reversion system. It works on the theory that if a market is in a long term trend and deviates from that trend for three straight units of time, then it is likely to revert back to the average.

In this case, we are using the 200 unit simple moving average (SMA) to define the long term trend and the 5 unit SMA to define the short term average. Using those numbers, we will assume that any market that goes three consecutive units making both lower highs and lower lows is likely to revert back to its short term average

Trading Rules

Go Long When:

Price > 200 unit SMA

Price < 5 unit SMA

Price has made three consecutive lower lows

Price has made three consecutive lower highs

 

Go Short When:

Price < 200 unit SMA

Price > 5 unit SMA

Price has made three consecutive higher lows

Price has made three consecutive higher highs

 

Exit Long When:

Price crosses above the 5 unit SMA

 

Exit Short When:

Price crosses below the 5 unit SMA

 

Backtesting Results

The backtesting results I found for this system contained a portfolio of 20 diverse ETFs. The portfolio was limited to 10 positions at any given time. The backtest started January 1, 2002 and ran through August 1, 2012.

Over a little more than 10.5 years, this strategy posted a total net profit of 112.08%. This breaks down to an annual return of 7.36%. Over the same time period, the S&P 500 had a total return of 23.087% which breaks down to 3.984% if you reinvested the dividends.

backtest system

The system recorded a total of 1389 trades, of which 73.79% were winners and 26.21% were losers. The average profit on a winning trade was 1.73% and the average loss on a losing trade was 2.69%. The average length of a trade was 4.56 bars. The winning trades averages 3.44 bars and the losing trades averaged 7.71 bars.

During the backtesting period, the largest drawdown for the portfolio was 15.19%. The largest drawdown on a single trade was 18.84%. The system posted a Sharpe Ratio of 1.60.

System Analysis

This system is very different from the systems I have previously covered. It has an inverse profit ratio, but is able to stay profitable because of its 73% win rate. By logging a profit on three trades for every loser, it is able to make up for those losers being almost twice as big as the winners.

Aside from drawdowns at the beginning of 2009 and at the beginning and end of 2011, the system performed fairly consistently across the ten year period.

This system goes against the common system trading goal of letting profits run and cutting losses short. It actually cuts profits short and lets losses run. Despite that, it is hard to argue with the impressive long term results. I am not sure that I would have had the guts to stick with the system when it continued to hold a position that was down over 18%.

Ideas For Improvement

Adding A Stop-Loss Component

The biggest negative with this system is that it exposes your portfolio to the possibility of establishing a position and watching it go straight to zero (or an infinite loss for a short position). While the risk of all positions crashing like that at the same time is almost zero, that non-zero risk of ruin is frightening. The most common knock against any mean reversion system is that when they eventually blow up, it can be ugly.

One way to limit this risk exposure would be to add a stop-loss component to the trading rules. More detailed backtesting could give you the information to determine the best type of stop to use.

You would want to analyze how many winning positions have drawdowns and how deep those drawdowns can be. With that information, you could experiment with ATR Stops or Bayesian Stops at different risk tolerances and backtest how they would affect the overall portfolio return.

Trading Multiple Systems

An interesting way to capitalize on the consistent returns that this system offers while reducing the risk of ruin is to trade it as a portion of a multiple system strategy. Trading this system does not mean you have to commit all of your trading capital to it, provided you have enough capital. This would give you an even greater level of diversification, but would also limit the profit potential.

 

Filed Under: Trading strategy ideas Tagged With: mean reversion, trading systems

FREE trading strategies by email

Trending

Sorry. No data so far.

Archives

  • Dominari
  • How does the forex market work?
  • Indicators
  • MetaTrader Tips
  • MQL (for nerds)
  • NinjaTrader Tips
  • Pilum
  • QB Pro
  • Stop losing money
  • Test your concepts historically
  • Trading strategy ideas
  • Uncategorized
  • What's happening in the current markets?

Translation


Free Trading Strategies

Privacy PolicyRisk Disclosure

Copyright © 2022 OneStepRemoved.com, Inc. All Rights Reserved.