iBankCoin
Joined Nov 11, 2007
1,458 Blog Posts

El Cuervo’s 5 Day Moving Average Trading System

For the rules of this system, check out Cuervo’s post where he explains his Qsinator 5 Day Moving Average Trading System.

Starting equity was $5,000 with 100 shares traded each time.

I included .01 share for commission.

You’ll find my results (below) to be similar to his. My testing used the closing price of the day that price crossed above or beneath the 5 day simple moving average for entry and exit. Cuervo required the high of the day to be beneath the moving average to trigger an entry. I did not code it with that additional requirement.

I’ve circled in green the metrics that I pay the most attention to, but there are others worth reviewing such as the Profit Factor and Ratio Avg. Win:Avg. Loss. Also note that the average losing trade lasted twice as long as the average winning trade. You might be quizzed on that later.

________________________________________________________________________________________________

Below is the equity curve. Note the two large drawdowns. The first large drawdown began on 12-27-07 as the system went long twice during the January swoon. The low of this drawdown was January 23, where the system had lost 16% (intraday) from starting equity. From trade start to finish, the drawdown ended up being 9.5%

The second large drawdown began at the end of September. By October 10th, the system had lost (intraday)over 16% from the high at the end of September. However, from trade start to finish, the drawdown was only 6.5%

I believe there is a very simple refinement that could be made to decrease the drawdown. Anyone have a guess what that refinement could be?

________________________________________________________________________________________________

For fun, and because it looks cool, here are some of the recent trades the system has taken. Per El Cuervo’s rules, the system only traded 100 shares at a time. On the chart below, MA5LE = Long Entry while MA5LX = Long Exit.

A very simple yet profitable system. I wonder what percentage of retail traders were able to beat this system in 2008?

Caveat: Testing over all the data for the Qs (starts March 1999), the system hit a high in March of 2000 that was not surpassed until August 2008.

If you enjoy the content at iBankCoin, please follow us on Twitter

39 comments

  1. Woodshedder

    C’mon…no takers willing to guess about a refinement to improve the drawdown?

    • 0
    • 0
    • 0 Deem this to be "Fake News"
  2. ZMoose12

    This stuff is pretty cool, I hope you’re successful finding the refinement….

    Would it be possible to tinker with the system manually when it inaccurately goes long using the 5 Day MA when there are different patterns other than the 5 Day MA that show a larger drawback than the system expects (human intervention in a nutshell)?

    ZM

    • 0
    • 0
    • 0 Deem this to be "Fake News"
  3. BOOMER

    I’m out of my depth here, Shed. But I’ll guess, just to hear you tell me why I’m wrong:

    His rules are:

    1. If the Day’s High is less than the 5 Day moving average & you have no shares, then Buy 100 Shares

    2. If you have 100 shares and the close looks to be higher than the 5 Day moving average, then Sell 100 Shares

    3. If you are not in either State 1 or State 2, in the immortal words of The Fly: “Eat a Sandwich”

    Maybe something like:

    4. If you have 100 shares, and the price fails to retake the 5 day avg within X days, sell.

    • 0
    • 0
    • 0 Deem this to be "Fake News"
  4. Woodshedder

    ZMoose, sure there are lots of ways to tinker with it.

    A component that considers volume could be added, as well as RSI and other overbought/oversold indicators.

    For example, if the system goes long with an RSI2 > 50, maybe it takes a half position. Or maybe it doesn’t go long at all if the RSI is > X.

    Lots and lots of tinkering…that’s what makes it so much fun.

    You might not believe it, but with some simple tweaks and refinements, I’ve got this system returning 62% annualized YTD. That’s 3x the return from what is posted above.

    • 0
    • 0
    • 0 Deem this to be "Fake News"
  5. The Chart Addict

    5-day MA is ultra short-term that works in volatile markets, but sometimes it’s better to trade with the trend. I would personally use a 15 or 20-day MA strategy. Might want to add candle stops (stop out based on the close that exceeds the length of the entry days).

    • 0
    • 0
    • 0 Deem this to be "Fake News"
  6. Woodshedder

    Boomer, this system will simply buy or sell if price crosses beneath or below the MA(5). Even if the day starts out above the MA(5), if the close is beneath the MA(5), it buys it.

    I have not yet figured out how to code Cuervo’s High of Day < MA(5) requirement. Your refinement is based on TIME which I believe will make a nice refinement. Good work Boomer, although I haven't tested a time based stop, yet. I believe strongly it will improve the system.

    • 0
    • 0
    • 0 Deem this to be "Fake News"
  7. BOOMER

    I just eye balled it. It appears that the 5 day is usually retaken within 4 trading days (given the fact that it is a 5 day avg, this makes intuitive sense). If it fails to retake, it indicates the 5 day avg is shifting like during the two large drawdowns you mention.

    Why are you still up? On vaca?

    • 0
    • 0
    • 0 Deem this to be "Fake News"
  8. Woodshedder

    Yeah Buddy. Big time en vacances.

    I’ll create a time stop and add it to it to see what happens.

    Addict, I can run the strategy over any length of moving average you want.

    • 0
    • 0
    • 0 Deem this to be "Fake News"
  9. BOOMER

    What software do you use to do this work?

    • 0
    • 0
    • 0 Deem this to be "Fake News"
  10. Woodshedder

    Tradestation, on this study in particular.

    • 0
    • 0
    • 0 Deem this to be "Fake News"
  11. The Chart Addict

    http://i539.photobucket.com/albums/ff358/WeeklyTA/cuervos-ma5-system.png

    Try using the candle stops. After the long entry, the next day’s close cannot close below the entry day’s opening price. At this point, it typically means that the pattern has broken down.

    Also, try testing a 15 and 20-day MA strategy.

    • 0
    • 0
    • 0 Deem this to be "Fake News"
  12. Woodshedder

    Addict, those candle stops are cool. I know I can code that, as I’ve seen the basic code for it, but it will take some searching, so I won’t get it updated tonight. But I will let you know.

    I tested the 5 day time exit and it works well to decrease the intraday drawdowns. However, it slightly increases max drawdown from trade close to trade close. I’ll have to post the differences in the equity curves when I get time.

    15 day MA system lost 10% annualized YTD, but produced 80% winners.
    20 day MA system lost almost 14% annualized YTD with a 72% win rate.

    Of course these should be tested over a longer period than 1 year.

    • 0
    • 0
    • 0 Deem this to be "Fake News"
  13. The Chart Addict

    The candle stops are effective for this strategy. When an extended trend emerges (such as an extraordinary downtrend), this strategy could be in trouble.

    I didn’t clarify when I asked about the 15-20DMA test, but is there is a short strategy to the original? How about testing the original strategy + to “short” at the LX and cover at the LE?

    • 0
    • 0
    • 0 Deem this to be "Fake News"
  14. Duane

    hey guys, in Robert Colbys book ” The Encyclopedia of Technical Market Indicators” has great info on the “5 day price cross”… his book is a must for system peeps…

    here is a link to the abbreviated excerpt from his site:

    http://www.robertwcolby.com/EMAreport.html

    happy holidays, and god bless…

    Duane

    • 0
    • 0
    • 0 Deem this to be "Fake News"
  15. El Cuervo

    I used a simple spreadsheet to scope out an idea that came to me in about fifteen minutes and you went an made it beyoootiful.

    Seriously, thanks for the re-examination of the idea.

    I tried a variation where the system would simply close out at the end of the next day after a buy, i.e. when a buy is triggered you sell at the close of the next day regardless.

    In spreadsheet it didn’t help things significantly so I didn’t post the variation.

    My other two thoughts are:
    1. Only enter if the closing is MA(7) [I picked 7 out of my hat but you get the idea]
    2. Who says it should stick with the MA(5) ??

    From Duane’s link I quote “The best Net Profits were found at the shorter lengths, 200 days and below. Further fine tuning revealed that a length of just 2 days produced the highest Net Profit of $816 million on an original $100,000 investment.”

    I think in advertently I was processing Curtis Faith’s Way of the Turtle because he mentions near the end of the book a simple moving day strategy that performs extremely well.

    Finally, I open sourced my algorithm so that someone would either review it or tell me to take a hike. I am curious Wood what tweaks you made…

    • 0
    • 0
    • 0 Deem this to be "Fake News"
  16. Woodshedder

    Duane, thanks for the link! Good stuff! I’ll have to check out his book.

    • 0
    • 0
    • 0 Deem this to be "Fake News"
  17. Jakes Crackberry

    What about throwing an ATR limit in there as your stop? Too limiting?
    ___

    • 0
    • 0
    • 0 Deem this to be "Fake News"
  18. Woodshedder

    Addict/Cuervo- adding a short entry that triggers automatically when the long exit is made makes for some very interesting (good) results. In fact, the results are so good, I was just going to mention it to Cuervo and let him contribute that addition…but since he asked…

    Another addition that really makes for a BEAUTIFUL equity curve is to have the system increase position size with each win and decrease it with each loss. B-A-UTIFUL, I tell ya!

    Below are the results with the added short entries/exits and position sizing that increases and decreases with wins/losses. I think most people will find the results tasty, at the very least. Keep in mind this is the same period tested as I posted about above (1 year on the Qs).

    Total Net Profit $8,269.41 Profit Factor 3.77
    Gross Profit $11,252.34 Gross Loss ($2,982.93)

    Total Number of Trades 80 Percent Profitable 76.25%
    Winning Trades 61 Losing Trades 19
    Even Trades 0

    Avg. Trade Net Profit $103.37 Ratio Avg. Win:Avg. Loss 1.17
    Avg. Winning Trade $184.46 Avg. Losing Trade ($157.00)
    Largest Winning Trade $1,037.30 Largest Losing Trade ($547.42)
    Largest Winner as % of Gross Profit 9.22% Largest Loser as % of Gross Loss 18.35%

    Max. Consecutive Winning Trades 18 Max. Consecutive Losing Trades 3
    Avg. Bars in Winning Trades 3.15 Avg. Bars in Losing Trades 6.95
    Avg. Bars in Total Trades 4.05

    Max. Shares/Contracts Held 369 Account Size Required $547.42
    Total Commission $263.10 Total Slippage $0.00

    Return on Initial Capital 165.39% Annual Rate of Return 100.14%
    Buy and Hold Return (41.84%) Return on Account 1510.62%
    Avg. Monthly Return $678.66 Std. Deviation of Monthly Return $750.37

    Return Retracement Ratio 3.16 RINA Index 39.16
    Sharpe Ratio n/a K-Ratio 3.39

    Trading Period 11 Mths, 21 Dys Percent of Time in the Market 100.00%
    Time in the Market 11 Mths, 21 Dys Longest Flat Period n/a

    Max. Equity Run-up $8,966.71
    Date of Max. E. Run-up 12/19/08 16:00 Max. E. Run-up as % of Initial Capital 179.33%

    Max. Drawdown (Intra-day Peak to Valley)
    Max. Drawdown (Trade Close to Trade Close)

    Value ($2,003.84) Value ($547.42)
    Date 10/10/08 16:00 Date 10/13/08 16:00
    as % of Initial Capital 40.08% as % of Initial Capital 10.95%
    Net Profit as % of Drawdown 412.68% Net Profit as % of Drawdown 1510.62%

    Max. Trade Drawdown ($1,704.88)

    • 0
    • 0
    • 0 Deem this to be "Fake News"
  19. Duane

    morning wood,

    wow… very interesting results…

    • 0
    • 0
    • 0 Deem this to be "Fake News"
  20. B-rad

    I remember you purchasing TS a long time ago, but you havent mentioned using it lately. What is your rationale for choosing b/t Stockfetcher + TS? Stockfetcher is limited to 2 years of backtesting even w/ the purchased version correct? Have you ever looked into Amibroker, WealthLab, or Ninjatrader?

    • 0
    • 0
    • 0 Deem this to be "Fake News"
  21. Chile

    Hi Wood,

    Could you please explain what you mean by adding to winning positions and decreasing a losing position?

    Thanks! Great work.

    • 0
    • 0
    • 0 Deem this to be "Fake News"
  22. Woodshedder

    B-rad, its really simple. Tradestation will not allow testing of a strategy across a portfolio of securities. That is a severe limitation. Of course everthing else about TS is very good.

    Stockfetcher data goes back to 2002, but you can only run tests 2 years at a time, and then compile the results in excel.

    I do not have Amibroker, but those who do have it alwasys seem to be very happy with it.

    I’ve done a little research on Ninja and none on Wealth Lab.

    • 0
    • 0
    • 0 Deem this to be "Fake News"
  23. Woodshedder

    Chile- the very first trade of the system purchased 100 shares of QQQQ and was a losing trade. Thus, the amount of equity decreased and so the next buy was for only 95 shares. However, this trade made money, and so the next buy was for 97 shares. So as equity is increased, more shares are purchased. Basically, gains are compounded.

    By November of this year, the system was buying over 300 shares at a time.

    I hope this explanation helps. If it is not clear, let me know.

    • 0
    • 0
    • 0 Deem this to be "Fake News"
  24. Duane

    wood…

    when and if you have time, can you please show a chart pic with a “readable” series of actions with your tweeks…

    ty, and gb…

    • 0
    • 0
    • 0 Deem this to be "Fake News"
  25. Rob

    Any chance of posting the rules including the short and position sizing strategies?

    Thanks much.

    • 0
    • 0
    • 0 Deem this to be "Fake News"
  26. Sia

    Woodshedder, why do you not automated your strategy using tradestation instead of manually entering the trades with scottrade? Have you considered using a system that uses intraday data? I have a strategy I want to test out once I sign up for tradestation early January.

    • 0
    • 0
    • 0 Deem this to be "Fake News"
  27. Woodshedder

    Duane, Rob, et. al… I will make a new post with all the rules. Can’t do it right now. Just made the trip to SC to my parents house.

    Sia, currently I have no reason to automate anything. All my systems are based on EOD data and therefore the orders can be placed outside of market hours. I use the Tradestation account, linked to Covestor, for two very specific strategies, and nothing else. The Scottrade account trades strategies that are still in development, or I take discretionary trades in it.

    I have not written a strategy that uses intraday data, but I will, in the future. I think the bomb is to have multiple strategies that operate across varying time frames, ideally, all uncorrelated.

    • 0
    • 0
    • 0 Deem this to be "Fake News"
  28. El Cuervo

    Again, thanks for the hard work you put on this (what I thought was a little harebrained) idea.

    The short following long exit is too complicated for the retail investor. If it takes longer than five minutes to make a decision, then it’s about four minutes too long.

    The increase/decrease of capital is an interesting idea, one I never would have thought of but it reminds me a bit of Vegas style investing.

    Feliz Navidad y Prospero Año

    • 0
    • 0
    • 0 Deem this to be "Fake News"
  29. Duane

    wood, where in s.c. are your parents living… even though i currently live “1 year” in charlotte nc, i am originally from gaffney s.c…

    hope you and the family have a blessed christmas…

    • 0
    • 0
    • 0 Deem this to be "Fake News"
  30. Woodshedder

    Cuervo, you might be right about the short being too complicated for retail, although the concept is just as simple: When the long is exited, a short is entred, when short is exited, a long is entered 🙂

    I will post what it would look like with some different scenarios, long only, long only with time exit, long and short, short only, etc..

    Anyway, this has been fun and very helpful, and my just develop into another system that I will really trade. Keep sending those hairbrained ideas!

    Duane, Summerville.

    Merry Christmas Everyone!

    • 0
    • 0
    • 0 Deem this to be "Fake News"
  31. ZMoose12

    That’s awesome…. Even though it’s been a shit-tastic year, this stuff still gets me going.

    ZM

    • 0
    • 0
    • 0 Deem this to be "Fake News"
  32. Kay

    The Qsinator looks great so far. Thanks for all the hard work guys! I’ve been back-testing variations of it myself, and will share any ideas that prove to be worthy.

    • 0
    • 0
    • 0 Deem this to be "Fake News"
  33. El Cuervo

    Here’s a modification I just came up with:
    1. After purchasing 100 shares of QQQQ, hold them until the low of the day is higher than the 5D MA

    • 0
    • 0
    • 0 Deem this to be "Fake News"
  34. Woodshedder

    Cuervo, then sell at the close?

    • 0
    • 0
    • 0 Deem this to be "Fake News"
  35. El Cuervo

    That sounds about right.
    It was something that hit me looking at this graph

    • 0
    • 0
    • 0 Deem this to be "Fake News"
  36. Ehliyet S?nav Sorular?

    Simply want to say your article is as astounding. The clearness in your put up is just excellent and i could think you’re knowledgeable in this subject. Well along with your permission allow me to grab your feed to keep up to date with approaching post. Thank you a million and please carry on the gratifying work.

    • 0
    • 0
    • 0 Deem this to be "Fake News"
  37. BlackberryTorch Venezuela

    You are actually a just right webmaster. The site loading velocity is amazing. It kind of feels that you are doing any unique trick. Furthermore, The contents are masterwork. you have done a great job in this subject!

    • 0
    • 0
    • 0 Deem this to be "Fake News"