Sunday, November 7, 2010

How do I chose the best pair of EMAs

Jim Smith, probably one of the new readers of this blog, asked me a very good question, how I decide what pair of EMAs to use in order to get buy/sell signals and why I am using different EMAs for SPX and for UUP (the dollar index)?

I touched this subject a few times in the past but I am going to give more details today. There is no other way to select a certain pair of EMAs than looking in the past and see what worked then and making the big assumption that is going to work again. Most of the time it does work, market somehow "remembers" its own behavior. EMA25 crossing EMA50 on hourly chart has worked for me for a few good years, this year the system was exceptionally good but the other years were not bad either. This pair of EMAs works for indexes, it doesn't work as well for individual stocks since they are much more volatile and a sharp move up or down it's enough to onset a false buy or sell signal. For an index ETF a move up or down above 2% it's a rare event, for an individual stock this is rather the rule than the exception.

Now let's look at UUP the dollar ETF launched only three years ago so we don't have two much data. This a perfect example for how to chose the best pair of EMAs for a certain ETF. Let's look on daily chart which give us data back to the beginning of 2009. The shorter the EMAs the sooner they are going to give you a buy signal and the sooner is going to give you a sell signal on the way down. For example a EMA10-EMA20 is going to make you more money than EMA25-EMA50 (better entry point, better exit point), but at the same time EMA10-EMA20 is going to give you more false buy/sell signals than EMA25-EMA50. What I want is the shortest pair of EMA that doesn't give a false buy or sell signal over a decent period of time, during a decent uptrend or downtrend. I know it sounds confusing so let's go back to UUP. At the beginning of March UUP reached a higher high then by the end of the month it went down no less than 7%. Was that a correction or the long term trend had changed for real? At that time I couldn't tell (well, the daily and weekly DMI turned red but let's say I couldn't have a clue). By the end of April UUP made a substantial move up but it couldn't go above the March high. In May UUP moved bellow the April's low so now we had a lower high and a fresh lower low a clear sign that UUP was in a downtrend. Looking back at the data I realized the obvious thing, that the April rally was a huge bull trap. My question now was "what was the pair of EMAs that almost gave a "buy" signal, what EMAs touched each other but without crossing because that pair of EMAs was going to give me the best entry point on the next rally? I tried different pairs and realized that EMA15-EMA30 was the one that fulfilled my conditions.

What I had to do now was to watch this pair and see if the buy and sell signals were going to be for real or not. In between "buy" and "sell" signals I was supposed to see the two EMAs touching each other but without crossing. And indeed the buy signal in December 2009 and the sell signal in July 2010 were for real. Since May 2009 when I came out with EMA15-EMA30 pair until now, the timing system was confirmed 7 times, 5 times the EMAs touched without crossing, offering and excellent support level and the buy and sell signal were also for real. So if you want to trade UUP, next time EMA15 is going to cross EMA30 on daily chart you can buy since the uptrend is most likely going to be for real. It's not 100% guaranteed but the chance to be on the right side of the market it's huge.

Different ETFs have slightly different pair of EMAs that works for them. Also you need to decide what time frame are you interested in, long term, short term, intermediate  term (my favorite) or are you interested only when market switches from bear market to bull market or the other way around (for this I am using EMA100 crossing EMA200 on daily chart).

This is how I came up with EMA25 crossing EMA50 on 60 minutes chart for SPX, this is how I came up with 19 days SMA as a confirmation of the EMAs crossing, by testing and testing and testing different indicators. You are not going to find this timing system in any book, you will hardly see DMI mentioned in any book, this is my baby, I came up with this system so you should take the trading advices on this page with a grain of salt. I don't have a background in economics, but at least one person, my kid, thinks that I am the smartest person in the World :) Of course when I am giving him as much candies as he wants. Otherwise...


  1. Thanks a lot, Babaro! For this exclusive post written just to answer my question! I feel honored! :)
    Now that you've explained, I see the logic behind choosing the numbers for EMA.
    Your blog now joins the list of my favorite blogs.
    Good Luck with trading!

  2. You're welcome, Jim. Keep asking questions and feel free to make suggestions. I want to optimize my system even more and any idea is welcomed.

  3. Thanks Babaro. So you are basically a trend-follower. Do you incorporate ADR (Avg Daily Range) into your position sizing, or do you just go all in on an EMA cross? Do you also play the downtrends, or just bail on longs and wait for the next bullish EMA cross?

  4. Babaro, I've got few short ETF which I had bought 2 months back, which are all in Red now. I don't have any option but to hope that the market will tank some day, and I can exit those shorts at least on a break-even. (A small correction also won't help me, I need the market to crash to exit!)

    What would you suggest me at this point? Should I enter the market with some longs? My fear is, just like I entered the short side too early, I might be entering the long side too late. Don't want to get caught up in the same cycle again.


  5. Great post. Any chance we will get to see a similar post, but this time for the DMI? :)

  6. Where do you get hourly data to backtest you ema crossovers


  7. Nice work,

  8. Blankfiend, ideally I am going all in at the end of the trading day when I am getting the EMAs crossing. In practice I may buy a little bit next morning and even two days after that. I am always afraid I am going to get whip-saw. I am riding both the ups and the downs. SSO-SDS is my favorite pair of ETFs. Sometimes I am using QID-QLD.

    Anonymous, I don't have too much to say about DMI but I am going to touch the subject again in the following days.

    Bill, check out this website

    Jim, I hear you, I made this mistake many times in the past. you didn't short the market too soon, you did it too late. You were supposed to short it at the beginning of August around 1080-1100, cover and go long one month later at 1080. I hate to give you an advice at this point.

    You need to go long or short at the BEGINNING of a new trend then WAIT as long as it takes until the market turns around. People who followed my advice and went long at 1080 are staying now on a 140 points gain. If market is going to plunge starting with today they are going to give away 20-30 points. It doesn't matter, they are going to cash the profit and go short around 1190, and once again they are going to ride the downtrend from the very beginning.

    If I were you I would sell at least half of the short ETFs and stay in cash. You can go long a little bit here with one condition to promise yourself if you see a "sell" signal you are going to cut your losses right there. Otherwise, as you said you are going to be caught in the same cycle again.

  9. Great advice, Babaro. I really appreciate your cool-headed thinking. Thanks a lot. Being a novice, that's something I need to learn before I trade any more. :)

  10. Babaro,

    i have looked at that website, i have looked at lot of website i dont think you have historical hourly data for more than 60 days anywhere, if you know of any website let me know i will like to download and backtest it


  11. Thanks Babaro. Where do you typically put a stop after going all in on a levered ETF like that? Do you ever cash in some chips along the way?

    BTW, I put up a chart of your UUP EMA's on my blog tonight - with attribution, of course. The 15/30 crossed today, although only by .01.

  12. I just corrected my post. I need to pay more attention, as I see that you were working with the daily chart, NOT the 60 minute. In that case, we are not even close.

    BTW, you should consider adding Disqus to your blog. Posting here is a pain in the ___, especially if you discard cookies after each browsing session.

  13. Blankfiend, can you tell me how to add "Disqus"?

    Also, how can I make the charts look bigger, not on the main page but after you click on it?



Thank you for your feed-back