iBankCoin
Joined Nov 11, 2007
1,458 Blog Posts

More MA(5): A System for Trading Volatile Periods?

Starting equity was $4,000 which was enough to buy 100 shares of the Qs on 1-5-04, the date the first trade was made.

The rules are simple. Buy 100 shares at the close if the close is below the MA(5). Sell 100 shares at the close if the close is above the MA(5). The system simultaneously opens a short position on any close above the MA(5) and closes the short position on any close beneath the MA(5). Thus, the system is invested 100% of the time, either long or short.

Money management rules: The system will add or subtract the equity from any gain or loss to the 100 share size. After a winning trade, the next trade may purchase 101 shares, or after a loss, 99 shares.  This means that the system is reinvesting profits or is trading smaller after losses. A refinement to the system would have the longs and shorts tracked separately so that as the shorts were working, their size gets larger while long sizes are decreased.

There are no stops used. I tested a time-based exit and suprisingly it worsened some drawdowns. I have not tested a percentage or volatility-based stop.

Commissions were calculated at .01/share. The report shows that commissions totaled over 25% of the starting equity.

I did not factor in slippage as I think this system may be an excellent candidate to trade with EOD funds.

Caveats: This system has performed very poorly, for many many years. While a different moving average would had eeked out some profits in the 1990s, the system did not begin performing very well until 2003. Keep in mind that this report ignores the years when it did not work very well.

My suspicion is that this system does a very good job of capturing volatility. Thus, it may have performed well during other periods of high volatility, such as the early 1970s, but I have not tested it on that period exclusively.

The Equity Curve

______________________________________________________________________________________________

The screen shot below includes the MA(5) and the longs and shorts from September to the present. The largest intraday drawdown of the system was incurred on October 10th, 2008. Note the system goes long 291 shares on September 29th. It exits on October 13th after the Qs gapped above the MA(5).

Also note that one of the most profitable shorts of the 5 year period was initiated on October 13th, after the largest trade to trade drawdown was booked.

I want to thank El Cuervo for bringing this system to our attention. I think it has the potential to develop into something that I may add to my personal system quiver. I’ll consider any suggestions for improvement in the comments section, and will test them (given enough time and assuming I can code the changes) and report back any success.

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

18 comments

  1. Woodshedder

    I realize that the spreadsheet is not displaying properly. Believe me, it looks nothing like that in the editor.

    I’m sorry for the affront to your sense of design and symmetry. It bothers me too.

    I’m off to a party, so it will have to stay like this until I have time to fix it.

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

    I hope Fly has something hilarious to say about the spreadsheet.

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

    As the man with the bad red toupe and the odd Jamaica Estates (Noo Yawk) accent says:

    Ya fired!

    _________

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

    Also note that one of the most profitable shorts of the 5 year period was initiated on October 13th, after the largest trade to trade drawdown was booked.

    Yeah, I noticed that kind of behaviour too. It’s weird that the Qsinator takes a huge hit and then turns around with a profit that negates most of the previous drawdown or makes up for it.

    I mentioned on your previous post that I was thinking about adding another rule that forced the trade to hold until the low was above the five day average but I think that, like the time based exit would have an epic fail as well.

    I’m trying to figure out a correlation between this and the VIX but, I’m beginning to think that the more rules get added the less it performs.

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

    Nothing spectacular with the VIX in the mix.

    I did notice however, that the VIX close is often higher than the VIX 5MA when the Qsinator triggers a buy and then the VIX close is often lower than the 5MA when the sell order comes from the Qsinator rules.

    But, I didn’t see anything statistically relevant on the VIX 5MA yet.

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

    I reviewed my spreadsheet for the “many folds” post – the actual sale, if they happened at the end of the day pushes the score to 13.46%.

    Your modifications already proved better refinements but I updated the original post for the sake of frank disclosure.

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

    T h a t s p r e a d s h e e t l o o k s g r e a t

    T h a n k s

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

    lol…I’ll get the sheet fixed this morning…and then take some time to respond to Cuervo’s comments.

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

    Spreadsheet is fixed!

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

    If this system thrives in high volatile environment, QLD or QID might be used instead of the Qs.
    What will happen if the trading asset closes 5 days in a row above the 5 day MA? Is the system going to consecutively sell short 100, 99, 98, 97, 96 shares in each of these days? Such scenario might bring significant losses. What was the maximum losing streak for the last 20 years (I noticed that the info is since May 2004). Such problem might be solved if the system doesn’t take a new trade if there are 2 consecutive losing trades. For example the system closes 3 days in a row above the 5 day MA. First day, the system sells short 100 shares, second day it sells 99, third day it doesn’t do anything since it has already initiated 2 losing positions in a row.
    Thanks for sharing quantitative trading systems.

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

    ivanhoff- it is easy to test the diETFs on this strategy. Actually, I did, but it was on SDS as a proxy for the S&P500.

    The system does not pyramid positions in either direction. It takes one position only, on the close after a cross of the MA(5).

    There is not data available on the Qs for more than approximately 10 years. Of course I could use the COMP to go back further, but I was trying to add depth to Cuervo’s original system, which he had trading the Qs. To make the system perform profitably from 1999-2003 one must add some adaptations and optimizations.

    As the max losing streak was three trades, it doesn’t make sense to stop trading after 2 losers, although I am very interested in systems that generate long dependent series of winners and/or losers, so that the refinement you mention can be tested.

    I’m not sure that it thrives in high volatility environments. I’ll have to test that in the upcoming days, using as Cuervo has already mentioned, the VIX, and possibly ATR.

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

    To my knowledge there is nothing “magical” about a 5DMA. In fact, many suggest that a 5DMA cross with a 10DMA indicates a point of “indecision” with regard to price action of a holding (momentum). If that is in fact true, you might test with a 10 DMA as an upper and lower threshold for the decision rule. Also, VWMAs may be more sensitive (yielding better return), as compared to simple MAs.

    In any event, what you and Cuervo have tested probably beats the crap out of MFs that the moms and pops drop their coin in. At the very least, it captures some form of sentiment in price movement…Keep it up…

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

    Manuel, certainly nothing magical about any MA. In fact, the 5DMA does not optimize to be the best MA for this period.

    I like your idea of using a longer MA for a lower and upper threshold. I’ve not messed with VWMAs, but I certainly could run it with VWMAs with a couple of clicks and see how it holds up.

    It has certainly had stellar performance over the last 2 years, but the fact that using a single digit MA for this type of system has not performed well 35 out of 40 years makes me cautious.

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

    I’ll say it again: take the trade in front of you.
    Use it for as long as it works.
    Then use something better when it comes along.

    Why should any technique be a “silver bullet”?
    Markets change – why shouldn’t techniques?

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

    Cuervo, part of me wants to believe that the fact that it hasn’t worked well, but now is working, is better than a system that has worked for 40 years, but is showing signs of deteriorating.

    The other fact is that no system should be used to manage 100% of anyone’s assets.

    Ideally one has many different systems. If a few fail, or hit periods of underperformance, the hope is that the other systems pick up the slack.

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

    I have a few opinions as to why things are falling into place with this plan but, they’re just that. Theories.

    I am not sure I like the 5MA crossing the 10MA because both of them are too slow.

    What I do like is the idea of the equity vs both the 10MA and the 5MA to make decisions.

    I started this by whole ball rolling by wondering what would happen with the 3MA and started working my way up until I hit the 5MA.

    • 0
    • 0
    • 0 Deem this to be "Fake News"
  17. Arnita Sow

    Keep in the wonderful function, I examine few articles on this internet website and We conceive your blog is quite interesting and has bands associated with great data.

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