# Development ideas for mean reversion system



## bassmann (9 July 2008)

Hi there,

One project I have on my list is to develop a mean reversion system, which as i understand it is based on the premise that residuals will eventually revert to the mean. I also understand this style is tyically short term and has a likening to a timed stop exit and the market should be in trading range. Please confirm.

IvÃ© done some basic testing with bollingers in various entry / exit combinations but seem to continually breakeven (after slippage and brokerage).

For eg (long entry)

Enter:= ADX<20 AND Close above upper Bol * 2 STDEV
Exit:=Close above middle band

I would appreciate any tips, suggestions or approaches people may give in this area. In particular I have found the topic of mean reversion only briefly covered in books. Does anyone have any recommended readings, particularly adaptable for systems development.

Regards,

Bassmann


----------



## tech/a (10 July 2008)

Regardless what you use for entry and exit you need to skew the figures by minimising loss and extending profit.
You dont have that skew in the above. Even though you dont mention stop and position size calculation. The Exit is just to close.


----------



## Frank D (10 July 2008)

Bassman,

Mean reversion systems for short-term intra-day is the ideal way to go.

Market spends 63% of the time rotating and extending, which means it rotates back towards the mean and then extends outward as it follow the trend.

If you optimize the system to only trade long or shorts based on the current trend, you should push the system out towards 70%.

So you want to be trading with statistical probability of actual market conditions, not developing a system that doesn’t take this into account.

So you’ll need to work out your entry and stops, which isn’t easy, and lastly your exit strategy.

Try and factor in 5 periods as your basis of the system, as this is the most robust parameter when developing reversion systems.

Keep in mind  the closer to the mean, price will thrust away, which is ideal of getting on the current trend.

 The further away price will ‘try’ and rotate back towards the mean, which means trying to short at the bottom of the channel, or going long at top of the channel is not ideal.

Traders usually try and develop momentum using breakouts, *but momentum starts from the middle and ‘thrusts outward.*

*You should be on the trend before most others are getting on!*


----------



## tech/a (10 July 2008)

Good stuff there Frank.


----------



## Trembling Hand (10 July 2008)

Frank D said:


> The further away price will ‘try’ and rotate back towards the mean, which means trying to short at the bottom of the channel, or going long at top of the channel is not ideal.
> 
> Traders usually try and develop momentum using breakouts, *but momentum starts from the middle and ‘thrusts outward.*
> 
> *You should be on the trend before most others are getting on!*




Don't tell them that Frank. We need the breakout players to fade.


----------



## BentRod (10 July 2008)

Great post Frank!

I love the idea of mean reversion type trading.


----------



## BentRod (10 July 2008)

> Don't tell them that Frank. We need the breakout players to fade.




haha...yeah like that


----------



## Chorlton (10 July 2008)

Frank D said:


> Try and factor in 5 periods as your basis of the system, as this is the most robust parameter when developing reversion systems.





Hello Frank,

Great post but can expand of this line?

Why would the value 5 be anymore robust than other similar values, and surely this is highly dependant on what you are trading, the Mrkt, etc?

... or is this just a "tougue-in-cheek" comment

Just interested,

Cheers,

Chorlton


----------



## julius (10 July 2008)

bassmann said:


> Hi there,
> 
> One project I have on my list is to develop a mean reversion system, which as i understand it is based on the premise that residuals will eventually revert to the mean. I also understand this style is tyically short term and has a likening to a timed stop exit and the market should be in trading range. Please confirm.
> 
> ...




Hi Bassman,

Here are a couple of idea's :

First step, you need to develop a robust estimate of the mean. This could range from a simple moving average to something more sophisticated, such as an adaptive filter. 

Either way, the premise of this kind of system is that prices are distributed around the estimate of the mean, and will eventually revert. 

A similiar process would be randomly selecting balls from a bucket, where 10 balls are red and 10 are blue. If the first ball selected is red, we would expect to pull out more blues in the future... unless someone is switching the bucket on us, which is the same problem trading systems face because markets are non-stationary.

The basic trading strategy then is to sell higher prices and buy lower prices in anticipation of a reversion to the mean. As Frank pointed out, this is in contrast to a breakout system where the idea is to buy high and sell higher.

The degree to which the system anticipates, as opposed to waits for confirmation, will depend on the signal, but it always impacts the risk:reward of the trade. In other words, the longer you wait to enter the trade, the more profit you are leaving on the table, because the 'target' stays the same.

So to offset the lesser R:R, if the system waits confirmation, it must also gain accuracy in the form of win%. 

My experience has been that stops do alot of damage to the performance of swing systems - rather than emphasising tight stops to minimise losses, it can be more effecient to add filters that remove certain trades, going short in an up trend for example - which will increase the overall win percentage.


----------



## Frank D (10 July 2008)

Chorlton,

I’ve tested and developed reversion systems for index futures and forex going back to 1993, and the most robust pattern is 5.

5 periods can be 5 days as an example, or an intra timeframe or ‘range bars’

A Reversion system is not only about the ‘swing’ and trading back towards the central zone, it also about trading from the central zone outward, as it follows the trend.

Therefore if swing trading you look to exit  towards or @ the ‘mean’.

If trading from the ‘mean’ outward, you can hold your exit strategies much longer.

Don’t optimize the entry or the stops within the system, just optimize the exit strategies depending on what you are doing.

The potential to profit is much greater if you are able to trade from the ‘mean’ outward.

The mean is already mapped out, so your target or profit potential should be known in advance when swing trading.

The ‘rejection pattern’ as it travels from the mean outward is unknown, depending on your exit strategy, which can be based on a ‘time’ parameter or price parameter.

i.e. exit a days close or next days open is a time parameter. (profit unknown)


Reversion systems aren’t just about trading from channel highs and channels lows towards the mean, it should also be about the rejection from the mean outward.

Your goal should end up with a hybrid system of swing and momentum techniques using the same parameters.

63-72% of the time the market rotates, and the rest of the time the market moves with the trend. 

 Therefore you’ll be in the market more often using a reversion system compared to a momentum system, but the latter will end up on most occasions delivering more bang for your buck, but on a less consistent basis.

You just need to incorporate both.

And Julius is right, you’ll need to add in filters, which often relates to your own ability to chart read the market effectively.

Cheers,
Frank


----------



## wavepicker (10 July 2008)

julius said:


> Hi Bassman,
> 
> 
> First step, you need to develop a robust estimate of the mean. This could range from a simple moving average to something more sophisticated, such as an adaptive filter.
> ...




Great post Julius, I think you have hit the nail right on the head with your thoughts here. 

In addition I will add my 2c worth here. In order to optimize your "estimate" of the mean, be it by MA or adaptive filter it should be cycles based and calculated at various intervals as cycles contract and expand continuously. After all MA's are simple a representation of the sum of the cycles greater than the span you have selected. Also the "lag component" needs to be accounted for and the filter centered such that it's in phase with price otherwise the whole exercise is a waste of time.

The use of fixed cycles in this type of system is IMO not the most appropriate strategy. Once you have established the best estimate of the "mean" then one needs to work out the most appropriate bounds of the excursion of price away from the mean level. As such the channels need to enclose approx 90% of the price action as deviates above and below the mean level.

Cheers


----------



## Chorlton (10 July 2008)

Frank D said:


> Chorlton,
> 
> I’ve tested and developed reversion systems for index futures and forex going back to 1993, and the most robust pattern is 5.
> 
> ...




Hello Frank,

Thanks for the reply and an interesting insight into Mean Reversion Trading.

Are there any good publications / books / etc which you may be aware of, that cover this type of Trading in more detail?  

Unfortunately, I have to admit that my knowledge of this approach is rather limited but I can definately see the benefits in including it in ones own strategy.

Kind Regards,

Chorlton


----------



## nizar (10 July 2008)

Great thread guys, im following with interest.


----------



## macca (17 July 2008)

Hi Frank

Interesting figures, do you cover reversion trading in your book?

The charts that you post on "your" regular thread show various values, which one would you consider to be the mean.


----------



## chops_a_must (17 July 2008)

This is going to be one of my first projects in developing a system.

Would like to trade equities based on weekly pivots, entering at the close of the first day, or the open of the second, where stocks have not touched the weekly pivot, and have not gone above or below R or S 1.5. 

Really not sure how to code that yet though.


----------



## nizar (17 July 2008)

Jerry Parker has some interesting thoughts on mean reversion and is quoted in Michael Covel's latest book pg164.



> Mean reversion works almost all of the time. Then it stops and you're kind of out of business. The market is always reverting to the mean except when it doesn't. Who wants a system like we have, "40% winners, losing money almost all the time, always in a drawdown, making money on about 10% of your trades, the rest of them are sort of break even to losers, infrequent profits? I much prefer the mean reversion where I have 55% winners, 1% or 2% returns per month. "I'm always right!" I'm always getting positive feedback. Then, maybe in 8 years, you're kind of out of business, because when it doesn't revert to the mean, your philosophy loses.


----------



## wavepicker (17 July 2008)

This is a mean reversion technique I have been working on and using for the last 3 months. I have posted numerous examples thoughout other threads. The core concept is not my own, it's been around for over 40 years. 
The way the cycles are calculated and extracted and then used to forecast via an algorithm is entirely my own IP.

 The chart below is a current hourly chart of the SP500. Over the last 2 weeks there were 10 trades and 200 points there for the taking. I use this strategy for trading SP500 and I also trade the EURUSD. This technique requires the use of multi timeframe analysis. Best results are obtained using a combo of 4Hr and 1hr. Upon a signal one can take trades when price reaches outer extremeties of the channel, thereafter a move back to the mean is a high probability. Usually a move back to the other extreme is quite common(prices move from one extreme to another and are always passing through equilibrium), but I liquidate 50% of my position at the mean level.

Markets move in cycles, this is easy to see. The middle blue line represents the trend of the market, the market "vibrates" above and below the middle trend line. If the trend is down one can take great positions by knowing with high probability approximately where that countertrend will finish.

Random Walk Theory, what's that?? Move with the ebbs and flows and trade the market.


----------



## Frank D (18 July 2008)

Macca,

I do cover a lot of ‘reversion’ trading in my book. I also cover a lot 
of momentum trading in my book. I basically cover a lot of stuff you won’t
 find anywhere.

I hope ‘reversion’ trading isn’t going to be sexed up all of a sudden,
 that people begin to think it’s the ants pants, because it’s not.

I’m ahead of the curve on most technical stuff found in forums, you just
 need to spend at least 6-months with me so you can understand every
 little piece of the puzzle.

 And then you’ll know when to adapt between  ‘reversion’ and ‘momentum’.

The good trader is the trader that can adapt to changing market 
conditions, but the smart trader is the one who anticipates the 
change before most realize what’s going on.

As I pointed out in the trader premium a couple of weeks, once the SPI 
hits 4836 move into financial stocks....  and I already know when i'm
 getting out and back into cash,  and so do most of my readers.

cheers
Frank


----------



## howardbandy (19 July 2008)

Chorlton said:


> Hello Frank,
> 
> Thanks for the reply and an interesting insight into Mean Reversion Trading.
> 
> ...




Hi Chorlton --

Look at Chapter 10 in your copy of Quantitative Trading Systems.  Then look at Chapters 8, 16, 17, and 20.

Thanks,
Howard


----------



## mr.x (22 December 2008)

try using candles in conjunction with bolinger bands and slow stocastic.wait untill candle is on or below btm band and when stoc crosses -30 for second time buy.also look for candle patterns,abandoned baby etc. take a look at a few eod charts and see what you think.


----------



## aarbee (30 December 2008)

Mean Reversion systems are quite consistently profitable in so called normal market. They take a big hit in the Jan '08 type of correction. They can be made to be highly profitable when leverage is used, but not easy to trade. The systems that I am trading (with CFDs) have very high W/L ratio but with very wide fixed stops can cause severe loss on the rare occasion when it is hit. Leverage needs to be controlled as it is quite easy to get carried away when the system is really firing. 

These systems took a lot of punishment in the Jan '08 correction when the market fell for 12 consecutive sessions. My systems are very quite at the moment. The best way to trade these systems is in conjunction with other systems like short term trend following short system to offset the drawdowns of the MR system. 

Cheers


----------



## tech/a (30 December 2008)

If turned from long to short wouldnt you have had a tremendous run (when shorting is allowed) trading off the highs of retracements within the down move?
Pretty well the opposite to the long trading setups.


----------



## Cartman (30 December 2008)

mean reversion systems are great if u like counter trend trading etc etc ---- the instrument you trade will determine the tack you take -- current market conditions are choppy - just shorten yr time frames --- M/R works well on FX


----------



## Edward deVeres (26 May 2009)

Try Pair Trade Finder (pairtradefinder.com) for a great "mean-reversion" system.  If you want to make money selling your system, then continue to develop your own.  But if you're interesting in trading "mean reversion," this is a system that works, and the developer has a thread on this Board on which he posts his trades as he does them.  His first 20 trades were 90%+ profitable.

Yours, Edward deVeres.


----------

