Exponential Moving Average

Discussion in 'Trading' started by rrisch, Apr 14, 2002.

  1. tom_p

    tom_p

    It appears that the formula was chosen to equate the statistical properties (variances in this case) of the N-day exponential moving average (EMA) and the N-day simple moving average (SMA).
    If we assume that the prices are independently and identically distributed with variance V, then the variance of SMA is V/N.
    So we are looking for the value of K such that the variance of EMA is equal to V/N.

    From the formula for EMA, we have:

    Var[EMA(t)] = K^2*Var[P(t)] + (1-K)^2*Var[EMA(t-1)]

    <=> V/N = K^2*V + (1-K)^2*(V/N)

    <=> 1 = N*K^2 + (1-K)^2

    which can be easily solved to get K=2/(N+1)


    Footnote
    The following properties of Var are used:

    Var(aX+b) = a^2*Var(X)

    For independent random variables, X and Y,
    Var(X+Y) = Var(X) + Var(Y)
     
    #41     Apr 20, 2002
  2. rrisch

    rrisch

    :D Bingo tom_p, you made my weekend.
     
    #42     Apr 21, 2002
  3. rrisch

    rrisch

    While I like tom-p's explanation of why the 2/(n+1) smoothing constant was adopted, I should point out that the underlying assumption of iid is pretty silly. Just look at the Bollinger Bands for any ticker and you will see that the variance really does vary. :eek:
     
    #43     Apr 21, 2002
  4. nkhoi

    nkhoi

    tom_p, can we make money with this new knowledge?
     
    #44     Apr 21, 2002


  5. I've used EMA's ever since I made the intuitive and empirical observation that they are more useful to me than SMA's, but I've never done an in-depth study of their true nature. In fact- horror of horrors- I've never really even bothered to make a simple inquiry.

    Shame on me.

    I will immediately close my trading account and freeze my bank account, and resolve not to touch either one again until I have solved this mystery.

    In the meantime, I will throw away my car keys until I figure out the mechanics of a combustion engine...rip up the plane ticket I purchased for my next vacation until I have found the time to decipher the aerodynamics of an airplane wing...keep all the lights turned off in my house until I have brushed up on my electrical engineering....
     
    #45     Apr 21, 2002
  6. rrisch

    rrisch

    Darkhorse, I believe that you made an "intuitive and empirical observation" that your car is useful to you. I believe you made up a fantasy, which you can't justify in any way, that EMAs are more useful to you than SMAs. There is no doubt in my mind that your car has served you better than the latter preference. :p
     
    #46     Apr 21, 2002

  7. Yes but without my car I wouldn't be able to drive to the ammunition store and reload my gun, which I use to frighten off the CIA operatives who monitor my house disguised as mailmen and insurance salesmen. :D
     
    #47     Apr 21, 2002
  8. p.s. i really don't care whether or not I can come up with a long winded justification for my bias other than my bottom line p&l... i have more respect for multimillionaire floor traders too dumb to spell chrysanthemum than i do for 35K a year tenured professors who can explain complex theorems but couldn't trade their way out of a paper bag....

    i guess the relevant question is this: is the end goal of trading

    a) to make obscene amounts of money

    or

    b) to provide fodder for an intellectual circle jerk?

    :D
     
    #48     Apr 21, 2002
  9. tom_p

    tom_p

    I don't use EMA's.
     
    #49     Apr 21, 2002
  10. egildone

    egildone

    ema's work for the same reason most indicators (fib levels, Bollinger bands, rsi, etc) work and that is that lots of people are watching them and they become selffulfilling...

    Ed
     
    #50     May 7, 2002