Algorithmic and Mechanical Forex Strategies | OneStepRemoved

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

Big change to Dominari

March 9, 2016 by Shaun Overton 24 Comments

I said it here and here and here. The biggest issue with my Dominari is trading costs. Things aren’t going to really take off until I do one of two things.

  1. Reduce the trading costs
  2. Make more money on each trade

I’ve been working on Dominari since around September or October of last year. After racking my brain for months, I more or less wrote off the idea of improving the trade profitability.

That suddenly changed last week on Friday after the market closed. The best reason to trade my own systems live is that the agony of underperforming forces creativity. The feeling reminds me a lot of Daymond John’s (the guy from Shark Tank) new book the Power of Broke. When life isn’t going your way, it’s the resourceful and creative who are best able to get to the top.

Nobody wants to feel broke or under extreme stress. As much as we hate those feelings, they’re often the strongest drivers of performance. That’s how I feel right now with Dominari. I’m so close to getting there and wasn’t sure how to fix that missing ingredient.

If it weren’t for that stress, I would not have had my simple but very powerful insight last Friday.

And please don’t laugh. The change is so dumb and obvious that you’re going to wonder what’s wrong with me. When you’re in the thick of designing a system, the ugly truth is that sometimes you get lost in the weeds. Or to use another botany metaphor, you only see the trees instead of the forest.

My key insight was to slightly modify the exit strategy to use limit orders, whereas previously I only exited based on the close of the bar. I noticed two repeated behaviors that finally beat me over the head enough that the point finally sank in.

The number of occasions where my trade closed in the optimal location seemed to be significantly outweighed by the amount of money left on the table. The key insight for me was realizing where to optimally place that limit order. And for those of you on my newsletter, it happens to be closely related to the Auto Take Profit that I’ve been talking about all week.

Backtest assumptions and results

My operating mantra when doing backtests is to minimize the number of assumptions. Spreads for retail traders have changed dramatically from 2008 to today. I remember working as a broker at FXCM when our typical spread on GBPCHF was something like 8-9 pips. I now routinely pay something like 2 pips. It’s impossible to model what happened in the middle without haphazardly guessing.

I find it far more convincing to analyze the raw signal, both on historical and recent market data, then to interpret whether trading costs are likely to be favorable in today’s markets. “Raw signal” is the ideal signal, one which assumes perfect execution, no slippage, no rollover, no spreads and no commissions. The natural result is that you’re overstating historical performance, but the benefit is that you have a very clear idea whether the core idea is a system capable of predicting the market with reasonable risks.

The total leverage employed in the portfolio is 7:1. If I have a $50,000 trading account and held a position in every currency pair in the portfolio, then the notional value of those trades would equal $350,000 (50k * 7).

Another key point is that I used a fixed position size of $12,500 per trade. The size of the trade never increases or decreases during the backtest, which allows me to isolate the impact of the raw signal without adding the variable of money management.

Here are my trade metrics with version 1 of Dominari. Click the images to view them in full size.

Version 1 backtest of Dominari

The first version of Dominari had a profit factor of 1.26.

After here’s the change with Dominari version 2.0.

My new version of Dominari increases the profit factor to 1.59 with a significantly lower drawdown.

My new version of Dominari increases the profit factor to 1.59 with a significantly lower drawdown.

My best case scenario was to hope that the profit factor would jump another 10 points or thereabouts, maybe stretching the profit factor to 1.35 or thereabouts. It’s incredibly exciting to see the edge over breakeven more than double (going from a $0.26 edge to a $0.59 cent edge).

What I’m most excited about is the skew in the returns. Most mean reversion systems look for an edge but are overwhelmed with the impact of losing trades. That was the case with version 1.

Skew of Dominari version 1

The largest losers outweighed the largest winners in version 1.

This new version of Dominari is the very first mean reversion strategy that I’ve ever developed where the winning tails (ie, the biggest winners) nearly equal the losing tails (the biggest losers). It’s almost always the opposite with mean reversion strategies. Said another way, the risk profile of the extreme outcomes significantly improved with version 2.

Fat tails in Dominari v2

The impact of the biggest winners is nearly identical to the biggest losers with version 2.

And the metric that most traders care about the most, drawdown, is wildly improved. Version 1 showed a drawdown of 5.72%. The new version is a fraction of that at 1.77%.

Out of sample backtest for Dominari version 2

The out of sample performance is nearly identical to the in sample performance, despite significantly different market conditions.

When I walked my test out of sample onto recent data, covering 2013-2015, the performance characteristics of version 2 are nearly identical to the in-sample test. The profit factor was identical at 1.59, and the max drawdown was 2.01% for 2013-2015.

Translating the theoretical into expected performance parameters

Again, those metrics above are in the ideal world of perfect execution and no trading costs. The real world performance will have lower returns and higher drawdowns. The advantage to having live trade data is that I can now make some kind of intelligent estimate of my expected trade accuracy and profit factor. Just how overstated are the idealized returns likely to be?

The process that I went through to calculate the expected profit factor in the real world is a 5 step process. I don’t think it’s going to make any sense if I try to write out the steps in conversational English. Instead, I’ve chosen to share a spreadsheet where you can view the step by step process for how extrapolating live trading data into expected performance with the new strategy. Click here to view the spreadsheet.

The expected profit factor for my live trading is expected to be between 1.29 to 1.39. The expected percent accuracy for live trades should jump from 62.55% to 70.8%.

The traders who will get first crack at the Total Access Apprenticeship are those are subscribed to the free newsletter. If you’re not signed up, make sure to fill in your email address in the orange box at the top right of this page.

Filed Under: Dominari, Test your concepts historically Tagged With: backtest, fat tails, GBPCHF, leverage, mean reversion, profit factor, skew

Improve Returns & Limit Volatility by Trading Half Days

January 29, 2014 by Andrew Selby Leave a Comment

The most common method for calculating data for quantitative trading systems is to define one day’s action as the change in price from one day’s closing price to the following day’s closing price. This method encompasses the entire 24-hour period that comprises one trading day. That is why it is the most commonly used definition for daily data.

A paper that was published in 2010 by Jozef Rudy, Christian L. Dunis, and Jason Laws points out that there could be a quantitative edge found in using open-to-close or close-to-open data for daily mean reversion strategies instead of close-to-close data. The authors thoroughly cited many sources that suggested there could be valuable information obtained from factoring in opening prices.

half day data

Distinguishing between price moves that happen while the market is open and moves that happen overnight could allow you to focus your strategy on more profitable areas.

The authors believed that altering the data set in this manner would be ideal for trading a daily mean reversion strategy that looked to profit from overreactions following large price declines in individual stocks. They set out to prove that both close-to-open and open-to-close data could outperform close-to-close data using this type of strategy.

The Data

The data used to backtest the authors’ theory was the stocks that comprised the S&P 500 Index, the S&P 400 MidCap Index, and the S&P 600 SmallCap Index. The backtesting period ranged from May 30, 2000 through February 12, 2010.

In order to account for transaction costs, a factor of 0.05% was charged to each trade. This cost was meant to replicate the type of fees that an individual investor would be exposed to.

The Strategy

The goal of this strategy is to exploit the largest losing stocks in any given decision period, expecting an immediate bounce back in the following period. The strategy is broken into two versions based on the two different data periods that each day has been segmented into.

The first version of the strategy uses the close-to-open data as its decision period. Then, it buys the worst performing stocks during that period at the open and holds them through to the close of that same day.

The second version of the strategy uses the open-to-close data as its decision period. Then, it buys the worst performing stocks during that period just before the close and sells them at the open of the following day.

Backtesting The Strategy

In order to determine how many poorly performing stocks to purchase after each decision period, the paper provided backtesting results for every stock in the S&P 600 SmallCap Index. There were similar results for the other two indices that were included in the appendix of the paper.

The paper divided all of the stocks into ten different groups each day, based on their performance during the decision making period. Purchasing all of the stocks in the worst performing group produced an average annual return of 215% with a maximum drawdown of 48% for the first version. The second version of the strategy produced an average annual return of 73% with a maximum drawdown of 11%.

As you can see, the second version, which holds the positions from close-to-open has a lower annual return, but much less volatility. The authors state that both versions produced better returns than using the standard close-to-close period.

Filed Under: Test your concepts historically, Trading strategy ideas Tagged With: close-to-open, improve returns, mean reversion, open-to-close

Mean Reversion Strategies Are In Hibernation

October 20, 2013 by Andrew Selby Leave a Comment

Many of the trading systems I have profiled stem from the interesting books written by Larry Connors and Cesar Alvarez. Their research focuses on short term, mean reversion systems that look to take quick profits when trending markets become temporarily oversold.

Cesar Alvarez recently launched his own blog, and one of his first posts addressed the issue of whether mean reversion strategies are still valid in today’s market environment. He begins by discussing how he has a friend that continues to challenge him on the issue, demanding proof that the strategy is still profitable.

Alvarez set out to test the following theory:

My theory is that mean reversion is in hibernation waiting to come back; or said another way, mean reversion is simply mean reverting. I think that when too many people trade mean reversion, the space gets crowded and we see fewer winning trades and smaller returns. However, this has always been conjecture never backed up with numbers. Are we really seeing fewer trades? Smaller returns?

In order to test his theory, Alvarez took the top 1,000 stocks in terms of dollar-volume from the beginning of 2001 through August 30, 2013. He used a 2-period RSI value under 5 as his entry signal, and then exited when the value rose above 70. Entries and exits were all calculated by closing prices and the data set was free of survivorship bias.

mean reversion strategies

Alvarez believes that mean reversion strategies are simple in a period of hibernation.

The first question Alvarez sought to address with the data that he produced was whether fewer oversold opportunities were presenting themselves:

The blue line is the percent of stocks with RSI2 < 5 compared to all the stock for a given year.  This has hovered between 5.1% in 2009 and 8.0% in 2008. The green line is a liner regression of the data. We can see that the trend has been down since 2001 but not a lot.  The trend from 2005 to 2007 compared to the trend from 2011 to 2013 looks very similar. Is this trend because we are in the same cycle of a bull market? Is mean-reversion in hibernation? Given the trade data, I would say yes. Nothing appears out of the ordinary.

Next, Alvarez looked at whether the average profit had changed:

This chart surprised me. The blue line is the average % profit/loss of all the trades with RSI2 < 5 and the exiting when RSI2 > 70. The green line is a linear regression of the data. The last thing I expected was an up sloping linear regression line. The 2013 average % profit/loss is .94% substantially less than the 2008 and 2010 values of 1.58% and 1.57% respectively. But 2013 returns are higher than 2011 and 2012 and substantially higher than 2007’s value of .33%.

Alvarez concludes that basic mean reversion strategies are currently finding less signals than in past years, but are still quite profitable. He suggests that the strategy is just hibernating and is poised to make a strong return.

We are at the low of the number of sold off stocks per year but the average # profit/loss is the middle range. The numbers do not tell me anything is out of whack with mean reversion. Mean reversion is not dead but it looks like it is coming out of hibernation.

Filed Under: Trading strategy ideas Tagged With: alvarez, mean reversion, RSI

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 © 2023 OneStepRemoved.com, Inc. All Rights Reserved.