Should we use the 200 day EMA or SMA?

Discussion in 'Technical Analysis' started by pragmatic-trader, May 24, 2020.

  1. #21     May 24, 2020
    tommcginnis and pragmatic-trader like this.
  2. Tradex

    Tradex

    Of course my dear friend, timing the market - with trend following techniques for instance - BEATS buy and hold, it has been proven thousands of times for the last 200 years!

    Why?

    Because the market is NOT random, period.
     
    #22     May 24, 2020
  3. gaussian

    gaussian

    I'm confused.

    You claim to have significant DSP experience but you can't set up a simple backtest like this? Just do it and figure out the results. It should be easy for you. Backtesting a simple MA strategy in Excel takes all of 10 minutes for a first pass.

    This book is a desk reference. I like Kaufman and I think he did great work in that book but of the 10 or so strategies I backtested from there I found almost nothing to even build upon. I think the book should be updated with newer results before I'd recommend it to anyone else. There are some more complicated strategies I didn't touch (I'd imagine they may perform better) but I tend to subscribe to a note that Ernest Chan posted (and I'm paraphrasing here) "strategy books only contain strategies that the author no longer finds profitable".

    Otherwise, if you have no basis to even start, it's quite possibly one of the best desk references of general strategy you could find and for me is often a source of initial inspiration if I haven't a clue what I'd like to test.
     
    #23     May 24, 2020
    dennis86, jys78 and Tradex like this.
  4. Tradex

    Tradex

    Pragmatic-Trader, read "Trend Following: How Great Traders Make Millions in Up or Down Markets" by Michael Covel, another best seller, it will show you how trend following beats buy and HOPE, by a large margin, while still reducing the drawdown.
     
    #24     May 24, 2020
  5. Tradex

    Tradex

    Really?

    Could you post a couple of backtests and the programming code (in C++, Python or TradeStation)?
    Thanks.

    Talk to you later guys, I am currently watching GBP/USD (short at 1.2190), bye for now.

    Over and out.
     
    Last edited: May 24, 2020
    #25     May 24, 2020
  6. gaussian

    gaussian

    That was a year or so ago on MES. I don't generally keep results that perform poorly around for long. I'll take a note what didn't work so I can return to it later but the code generally gets tossed once I confirm what I was trying didn't work. I don't really put much value in the code - throwing together a quick backtest when a book gives you the steps is very quick in Python.
     
    #26     May 24, 2020
  7. That is not true. 200ema on daily chart is really important on stocks and Emini-futures. You can backtest it yourself. Only thing you should do with it is use it as a target, never as an entry, although it helps finding s/r zones
     
    #27     May 25, 2020
  8. @page { margin: 2cm } p { margin-bottom: 0.25cm; line-height: 115% }

    Moving averages work in the sense that they pick up recent trends in the market, and if those trends persist then a moving average will be profitable. In many markets trends do seem to persist, and therefore moving averages are profitable. There are many other different ways of detecting trends. Moving averages are as good as any of them, but are inferior to using an ensemble of different methods. Of course if markets don’t trend then they won’t work.

    Momentum is rarely a strong enough effect that it will always work (single moving averages on one instrument average Sharpe Ratios of ~0.25). Therefore it’s always possible to find an instrument or time period when it doesn’t work, especially if you only test a single moving average like 200 days on a small set of instruments. However tests of multiple moving averages over long history and many different instruments show they have been profitable in the past. Then there are the still profitable scores of profitable hedge funds and traders (including myself) who use moving averages (almost always as part of a larger set of signals).

    Normally if I had two competing signals I’d trade them both with some risk allocation, but with MA and EMA this would be a bit pointless since they are so similar. So a choice is inevitable.

    But a ‘slight’ difference in performance isn’t statistically significant. Anyway, this isn’t the correct criteria. When two systems give very similar performance you should be looking at other factors, which brings me on to:

    Never heard the term ‘repaint’ before, but I agree that it would make sense to avoid a signal which frequently reverses itself. This is likely to be more costly to trade. Essentially for a given level of profitability, we want the signal which has the lowest turnover.

    (There is a subtle difference here between ‘binary’ traders who go long/short one unit of risk when the MA crosses and ‘continuous’ traders like myself who are always adjusting positions. ‘Binary’ traders don’t care about turnover if it doesn’t change the sign of the signal, i.e. there is no cross. However a signal with higher turnover is also likely to cause more multiple crosses in a short period)

    However the SMA is likely to have a higher turnover than EMA! This isn’t very apparent on a 200 day SMA where both will be very smooth so you will need to look at a much shorter period (also multiple crosses, and thus 'repainting' are relatively rare with a 200 day EMA anyway).

    First you have to compare like with like, and set up the EMA so it has the same half life as SMA. A 20 day EMA has a half life of about 7 days whereas a 20 day SMA has a half life of exactly 10 days. To match the 20 day SMA you’d need a 28 day EMA.

    If you plot them you will see that the SMA is more jagged and less smooth than the EMA, and hence 'repainting' is much less likely. You can also backtest which will confirm this result.

    Even for matching moving average lengths the EMA . The exponential weighting provides a much smoother transition as large returns come in and out of the ‘window’.

    For this reason I’d choose to use the EMA over the SMA.

    GAT
     
    #28     May 25, 2020
    Whynottrade and Fx-Game like this.
  9. qlai

    qlai

    This sounds very familiar:) If you treat MA as an area, not a line, would EMA vs. SMA make much difference on intra-day charts?
     
    #29     May 25, 2020
    Fx-Game likes this.
  10. Turveyd

    Turveyd

    Swing Stocks D1 charts I used to use.

    9sma
    21ema
    50sma
    200sma
     
    #30     May 25, 2020