Mean reversion forex strategy

Mean reversion forex strategy

Posted: search-words Date: 20.06.2017

A reader sent me some trading rules he got from a newsletter from Nick Radge. He wanted to know if these rules really did as well as published in the newsletter. They seemed too simple to produce such good results. The strategy as presented was long and short and went on margin but he wanted to know how it did the long only since he did not short.

After contacting Nick Radge at The Chartist , I confirmed with him it was OK to publish these rules. No fancy rules are here. It is standard mean reversion strategy. At times the strategy will produce more signals than there are open slots for.

To trade this, one must be watching the markets during the day and take the signals as they happen. This is not realistic for most people since they are not full time traders sitting in front of their computers.

One could automate this, but that is not a simple task. The first time I heard about this rule and tested. I thought there is no way this rule could work. I figured it would destroy a perfectly good strategy. I was flabbergasted that it worked and produced good results. This is why I say that one should test ideas before throwing them out.

Forex Mean Rerversion Trading Strategy - Catching Market Reversals

You never know what will work. When there are more signals than open positions, the code would randomly choose which stocks to enter. I then ran runs for each test. The average CAR of the Monte Carlo runs is Surprisingly good results from such simple rules. The standard deviation for CAR and MDD are much smaller than expected. The results are not as good as using the Russell but still good.

Probably because of the smaller universe which leads to lower exposure. The spreadsheet includes the full Monte Carlo run data.

In the spreadsheet are details on how to obtain the AmiBroker code that I used for this post. What I like about this strategy is how simple it is, yet produces good results.

Only 3 set up rules. One really simple exit rule that one would think would not work. The biggest issue with the strategy is that most people cannot trade it because it requires being in front of the market all day long.

In a future post, we will look into changes the rules to make it more tradable for the average person. Want to see how a maximum loss stop changes the results, read Maximum Loss Stops: Do you really need them? In the comment thread below, a couple of people questioned the results. I had a researcher friend of mine code up the rules as stated on this post.

His results matched mine exactly. This gives me complete confidence that the results are correct. I loved your work in TradingMarkets. It is because of you guys that I have started looking into mean reversion strategies for stocks. With the issue of many signals and watching the screen, Interactive Brokers has Basket Trader facility that allows a trader to enter many market-if-touched orders.

The maximum position that can be opened during the day will then depend on the funding permission the trader has. I am using Amibroker as well to run monte carlo simulation. However, I cannot produce the YEARLY statistics of returns average, min, max, median from Amibroker. Is that a custom backtester? Or do you run it manually for each year? I am very familiar with basket orders. The question is if one has a margin account but does not want to on margin, how does one do that?

I used the CBT to output the yearly return for each run. Then I took all the runs pasted them into Excel. From there I generated the statistics.

I think that complementing this with a mean reversion strategy would be a good idea. What you are describing here looks temptingly good. If you are trading in Australia this is an issue unfortunately. If I understand it correctly you would enter your orders EOD, so there is really no reason to monitor the market during the day, or am I missing something? See my FAQ, http: The issue is that you may have 40 stocks that set up the night before and you do not know which will trigger.

In 30 of those trigger, you only want to get into the first 10 that do. Do you use any cost and slippage? Do you consider it? This answers all your questions and then some. I get the impression your study involves selection bias, i. I may be wrong but this is what my analysis says. More importantly, this is a simple system but has 6 parameters so from the PoV of curve-fitting this is not very simple. My guess they will not do as well because of lack of exposure.

Running a Monte Carlo run takes time. If I do a follow up, I will also include R Two of the rules are liquidity rules which the original rule did not have. It is not realistic to test these lower volume stocks. My guess is if I removed these rules results would improve because that has been my experience. I disagree that these rules constitute curve fitting.

They only a few rules, simple parameters, and each rule makes sense. The issue with when a strategy has crossed from being non-curve-fitted to curve-fitted is that there is a large grey area in between which people have disagreements on when curve-fitting has happened. The good part is that if one thinks curve-fitting has happened, one can ignore the research and not trade. In the period tested there are about 2, bars bit you have 7, trades for the Russell Divide that by 10 and multiply by the average holding period and you get 2, bars.

This means that many positions overlap and although you open 10 positions at the time max you hold many more open. This is why your CAR is overstated. If you adjust that and you add reasonable slippage you do not even make it near buy and hold with reinvested dividends.

Your high CAR is a red flag. Apparently, your backtests are based on using open equity to buy more stock. You cannot do this in real life. You have to add money to the account. When you do that and also account properly for slippages, the method is a loser.

That gives bars in the test not The average hold is 3. If I enter a position today at the open and exit tomorrow on the open, AmiBroker calculates that as a 2 bar hold. In reality that is only 1 bar of time. By these calculations all is good. Because of your concerns, I double checked my code to make sure I was not entering more than 10 positions or using margin.

I am always aware that I can and I do make mistakes. After checking my code, I see no problems. Given that, the system is probably holding many more positions than 10 at a given time. Note that most retail backtresters calculate CAR based on starting and initial equity and do not account for margin.

The only way for this to be resolved is for you to provide a complete trade-by-trade report here so everyone can be convinced that you are not using margin in your CAR calculations. I am not convinced at all that your results are correct or that your code is correct. The only way for you to convince me is to provide complete results or code so that your readers can reproduce them.

If you still believe the code is wrong, I suggest that you code up the strategy and post your results. I have given you the full rules. I am hiding nothing. There still may be an error in the code that I have not found, but at this point I leave it to you to code and post results that contradict my results.

Which version of AMI do you use? I will repeat again that the high return should have immediately triggered a red flag. Anyone with more than 3 months backtesting experience knows this. I am doing that. Because of your continued concerns and that I want to make sure the code is correct like I have said before it is possible that I have a bug that I have not found , I asked a favor from someone I know who is a professional researcher with very strong AmiBroker skills, to program the strategy as the rules as given in this post.

When I worked for Connors Research the way we verified a strategy was by giving the English rules as in this post to another researching to code up. We then compared results. At this point, I consider the strategy verified and correct. Unless you want to say the rules as stated in the post are wrong. Also, as far as the rules go. Does the close below the 5 day MA have to happen first, and then the 3 lower lows after that?

Or can the 3 lower lows begin above the MA and then the close below the 5 day MA happens on the 3rd day? On the setup day, the close has be under the MA5 and that day is at least the third day in a row of 3 lower lows.

Instead of trading individual stocks, how would your results be different for trading ETF SPY, either Long, Short, or Money mkt, and only at EOD? Thanks for sharing your work. One would have to make big changes in the strategy because of lack of trades, the exposure would be very low and thus low CAGR. That was my suspicion as well, …that there would be very few trades if one were trading SPY. Is there a favorite strategy of yours, or that you recommend for trading SPY at EOD only?

I currently do not trade the SPYs. I am researching a possible SPY option trading strategy. But that is in the early stages of investigation. Hello, what AFL statement are you using to limit open positions to As someone already pointed out it appears you system takes more than 10 positions and exceeds cash equity. I remember AFL has a command to limit the opening of new positions to 10 but i do not recall it having one to limit new positions based on already open ones.

As already noted the CAGR is unrealistic and this is possibly due to overestimation. As I have pointed out, I believe the code is correct. Not to say that it could still be wrong. I have checked it several times. Why do you think the code is wrong? With regards to the exit of this system: Wouldnt you hold it all the way down?

Or if the price kept oscillating in a range such that this condition never came true. The stock might be held forever? Yes in theory the stock could close down every day until it hit zero. In all my testing this has never happened. If the price oscillates, then we will get out because in order to oscillate the stock must close up and then we would get out.

I agree with you it is a strange exit. Cesar, What would be the inverse version of this strategy? First, I have not tested the short version of this.

The Mean Reversion Trader – What Forex Style Suits You? — MahiFX

The inverse rules changes are Setup changes would be Close MA5. I find it interesting that this person was able to program this strategy, generate the results and test them in less than half a day. Originally, when you gave the rules the option I gave you was not included. This is what you gave:. Your post that this must be included has a time stamp at least 3 hours after my post.

I do not see a reason for omitting it in the first place because it deals with exactly the issues raised. Therefore, one way for you to prove that your results are correct is to post an excel file of the Amibroker trade-by-trade output for the first case of Russell Then the issue will be settled either way.

You may have something here but the odds are against you and you possibly either have optimized the system to fit past data or you have a bug that overstates CAGR.

The reason for the omission is I missed that one line of code when I copied over what I wanted to show. Since you have had someone code it up, you can verify for yourself if the results are correct or not.

As far as I am concerned, these results are correct as I stated I had a another person code them up and get exactly the same results. I appreciate you bringing up your concerns that the code was wrong but I have proved to myself there are no issues. I will only spend more time and energy on this topic, if someone brings proof that the results are wrong. This strategy is in fact an intraday strategy, not interday. You might have many stocks that meets the criteria on given day.

In real life however, you would only buy these stock, that will go down earlier. Having EOD data you do not really know, which one you will buy. That is why you need to use MonteCarlo. Lets suppose, that on given fay 5 stocks meet criteria and goes down by at least 5 percent. MonteCarlo assumes that the distribution of probability is uniform.

Other words, you will buy good stocks in 4 cases and the bad one in 1 case. And what if bad stock almost always goes down quicker that good stock?

That will mean, that the distribution of probability is not uniform. And the test results are not reliable. I am asking the question, because I created similar mean reversion strategy, but this question worries me. I did do a Monte Carlo simulation on these results. We do not know which stocks trigger first. You are correct that we do not know if bad stocks tends to trigger first or not, thus the distribution is not uniform. I ask becuase it seems every time I attempt to code a limit order in amibroker I get a Holy Grail outcome!

The reason you end up with a Holy Grail system is that there may be signals and your system like this one, takes those that signal. In most peoples real trading they are not sitting in front of the computer to see which ones trigger first and then entering those.

The more likely case is that one places limit orders for the first 10 ranked stocks. But then these may or may not get filled. Thus you end up with a much lower exposure and lower CAGR. If you have many signals on one day. That way you will always buy the stock, that first triggers on the limit. However, you will buy a maximum one stock daily, On the other hand, if you have stocks with signal and if you place orders for 10 of them, you might buy nothing.

Also, thanks for sharing this very hard work you have done. It seems no good deed goes unpunished. Results improve considerably when the requirement that the price be above its day moving average is removed.

I have had several people email about suggestions on how to improve the strategy or make it easier to trade. I will likely do a post on that in the future. I will remember to test by removing the MA rule. Good work but needs some checking. Cesar, I ran the data as per your adjustments back to using delisted and historical constiuents to alleviate survivorship bias this also offrs some out-of-sample data as your test started Results as follows Original vs Adjusted:.

Certainly a significant outperformance, but coming with greater downside. It can be done. Interesting to see these results. I agree it can be done.

It just requires some experience on order placement from the user. Therefore I would personally not remove the day MAV. I feel I am missing the point, but if you start your tests on a given date, why must you run separate tests?

Is this because the random parameter leads to different results each time? I use these two lines: This post will cover three of […]. I backtested this strategy myself, I can comfirm the results above. It seems there is no survivership bias involved as there are good results on random portfolios as well.

You can increase the return even more with a same-day-exit on close, althoug that rule makes it even less tradable manually. This strategy needs automatic execute anyway…. Hi Cesar, i could not find any information in your describtion neither in the comments regarding initial stopp loss.

What value did you use for that? Thanks for all this great and interesting materials. Is it 3 LLV in a row? Is it 3 LLV over a certain period? If not on a close, then on what? I can personally verify that this strategy works in practice.

I have been trading a very similar method to this constantly since April I trade much smaller on each position and trade it globally on Interactive Brokers. Max drawdown was My thanks particularly to Cesar as I was a longtime paying student of Connors research and all my methods are based on them.

David, thank you for the kind words. It is good to hear that your strategy is doing great. I use Tradestation so ask. That is what a lot of people do. I have not found a trend following strategy that I like. I do trade multiple strategies with the same general idea that one is at least working at all times. But remember, when markets go to hell correlation goes to 1. Thks Cesar for posting this strategy. I am going to try the same like what Dave said here.

Thanks for a great contribution to mean reversion trading MRV. This is a very valuable work that I highly recommend. I am wondering whether MRV works as well with Forex or futures markets. Do you have any experience with this? First let me say I am not a Forex or futures trader. What little testing I have done in these markets, MR seems to work on the futures market and not as much on Forex.

I have entered my information so you can send me the link to your spreadsheet. I think there are so many trades that fit the criteria 3 lowest lows, etc. I got the same good results until I turned same bar exits off.

See symbol CHK on 3 June When you look at an intraday chart the sequence of the pricing would make a profitable trade impossible. Apart of using round lots, based on your vast experience, is there any way to reduce slippage? I assume you mean slippage on the exit since entry is a limit entry which you can only have positive slippage. Are you seeing this slippage on low volume high spread stocks? I tend to trade larger stocks. But even there sometimes slippage is an issue. I also use TWAP to get out which avoids some of the issues but then makes it harder to track how your system does in real life since one cannot test a TWAP exit.

I see, TWAP could be go for exits, but not for entries. Best MR entries occour during shift moves that preceed reversal. In such cases using LIT orders allows me to get all orders executed, but with bad fills. On the other hand, LMT orders allow to have zero slippage, yes, but some of them would not get filled.

Any reccomandation to reduce slippage on entries? Thank you in advance. Part of it depends on how big my edge is vs how much am I willing to give. I will have to make minor changes to test […]. I have filled in the form to obtain the spreadsheet. Just wondering if you have the Metastock coding for the system as well?

If so are you please able to email to the email address noted.

Running positionscore in AB as random and still seeing good results is a huge confidence booster. A great system that provides an awesome equity curve with minimal drawdown. However, I can understand the difficulty in practically applying this system. Alvarez, have there been any changes to the rules to make it more tradeable for the average person? I have written about lots of variations of this strategy. Here is one that is more tradeable: Stop Losses and Profit Targets.

Plus Happy Birthday Excel! After reading your post and reply to many of the queries above, I am highly convinced about your thorough knowledge and skill in amibroker coding. I am looking forward for your valuable guidance and help in coding the strategy. How do you know which stocks were part of the Rusell in any specific day? You need to ask to be added to their Alpha program. Then know when a stock is in an index is very easy. A one line function call.

Do you take positions in non-marginable stocks? Does your code check for historical margin requirements for each stock?

Yes I do since my data provider does not give me any information if the stock was marginable at that time. I think that it is difficult for Amibroker to resolve them. Want to be notified by email when I make a new post? Subscribers automatically get the link to any spreadsheet included in the post. I've known Cesar for 8 years and he is my first and foremost "go-to" resource for financial markets research, quantified strategy development, and coding.

Eventually, I realized that the majority of the models they presented were engineered by Cesar. His work is enlightening, informative and very easy to understand, and that is very refreshing to see in the Quant world The email includes a link to any spreadsheet included in the post. Your Privacy is protected. Home Blog AmiBroker Services Bio Contact Me FAQ Disclaimer. Email Twitter LinkedIn Google Pocket RSS Feed. Related Posts Simple Ideas for a Mean Reversion Strategy with Good Results — Part 2.

Click Here to Leave a Comment Below. Join my mailing list.

Mean Reversion

Disclaimer The information and analysis on this site is provided for informational purposes only. Nothing herein should be interpreted as personalized investment advice. Under no circumstances does this information represent a recommendation to buy, sell or hold any security. None of the information on this site is guaranteed to be correct, and anything written here should be subject to independent verification.

You, and you alone, are solely responsible for any investment decisions you make. The ideas and strategies should never be used without first assessing your own personal and financial situation, or without consulting a financial professional.

mean reversion forex strategy

I may hold positions for myself or clients in the securities or industries mentioned here. There is a very high degree of risk involved in trading securities. Your use of any information on this site is entirely at your own risk. My thoughts and opinions will also change from time to time as I learn and accumulate more knowledge. Testimonials "After working with Cesar my trading performance went from unpredictable and barely profitable to consistently profitable Copyright text by Alvarez Quant Trading.

Send to Email Address Your Name Your Email Address jQuery document. Sorry, your blog cannot share posts by email. Fill out the form below to be notified by email of new blog posts.

Rating 4,5 stars - 709 reviews
inserted by FC2 system