Announcement

Collapse
No announcement yet.

EMA calculations

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • EMA calculations

    Hi,

    My question concerns how EMAs are calculated in eSignal’s Basic Studies. Wikipedia indicates that an EMA is calculated according to:

    EMA(t) = alpha x price(t) + (1 – alpha) x EMA(t-1)

    Where:

    alpha = 2/(N+1) and N is the length of the EMA

    This works for my EMA and MACD calculations and I am able to reproduce the values of the eSignal Basic Studies in a spreadsheet. However, the formula does not work for my RSI calculations – even after several hundred trading periods to allow the calculation to settle down. The only way it appears to work is if I change alpha to:

    alpha = 1/N

    With this change, my calculated RSI figures match the eSignal figures.

    Is there a technical reason for this difference, or have I misunderstood something?

    Many thanks,
    Trader08

  • #2
    Trader08
    The RSI uses Wilder’s smoothing method and not an exponential average. See this article in the eSignal KnowledgeBase
    Alex


    Originally posted by Trader08 View Post
    Hi,

    My question concerns how EMAs are calculated in eSignal’s Basic Studies. Wikipedia indicates that an EMA is calculated according to:

    EMA(t) = alpha x price(t) + (1 – alpha) x EMA(t-1)

    Where:

    alpha = 2/(N+1) and N is the length of the EMA

    This works for my EMA and MACD calculations and I am able to reproduce the values of the eSignal Basic Studies in a spreadsheet. However, the formula does not work for my RSI calculations – even after several hundred trading periods to allow the calculation to settle down. The only way it appears to work is if I change alpha to:

    alpha = 1/N

    With this change, my calculated RSI figures match the eSignal figures.

    Is there a technical reason for this difference, or have I misunderstood something?

    Many thanks,
    Trader08

    Comment


    • #3
      Thanks Alex,
      That was very helpful and pointed me in the right direction. This page explains further how Wilder’s smoothing works – it shows that alpha is set to 1/N as I guessed below.
      Trader08


      Originally posted by Alexis C. Montenegro View Post
      Trader08
      The RSI uses Wilder’s smoothing method and not an exponential average. See this article in the eSignal KnowledgeBase
      Alex

      Comment


      • #4
        Trader08
        You are welcome.
        FWIW you can easily replicate Wilder’s smoothing using an exponential average where its length is calculated by multiplying your smoothing period by 2 and then subtracting 1 from the result ie (2*smoothing)-1
        Alex


        Originally posted by Trader08 View Post
        Thanks Alex,
        That was very helpful and pointed me in the right direction. This page explains further how Wilder’s smoothing works – it shows that alpha is set to 1/N as I guessed below.
        Trader08

        Comment

        Working...
        X