Announcement

Collapse
No announcement yet.

exponential moving averages

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

  • exponential moving averages

    I'm having trouble getting the same ema (17 period) as displayed by esignal on a 1hr bar.

    The current price is 16.46
    The last ema-17 was 16.24

    I'm multiplying 16.46 times 2/18

    and adding it to

    16.24 times 16/18

    and coming up with 16.249

    esig is coming up with 16.268

    The stock is LTD, Date 09/18/03 10:30am price 16.46

    If someone could explain how I could get the same results esig does it would save me from pulling out my hair. Thanks !
    Gene Martin
    InfoLogic

  • #2
    Hello Gene,


    In our EFS library, there is a help example that will show you how to code the EMA calculation (EMAcalc.efs). See the first post in that thread. The chart below displays the 17 ema of the EFScalc.efs and the built-in EMA study. The dark green line is the EFS.

    Jason K.
    Project Manager
    eSignal - an Interactive Data company

    EFS KnowledgeBase
    JavaScript for EFS Video Series
    EFS Beginner Tutorial Series
    EFS Glossary
    Custom EFS Development Policy

    New User Orientation

    Comment


    • #3
      thanks, but...

      I'm not using EFS, so I'm afraid the EFS example is just confusing things for me. I'm not understanding at all why the math I'm using doesn't come up with the same number that appears on the Esig chart.



      I'm pretty sure the formula is corect and I'm assuming I'm coming up with a different answer because I'm selecting different prices than Esig is, but, I can't find my error.

      Am I using the wrong 'last ema17' ? in my calculation ?

      Can you tell me exactly what numbers you are actually using to come up with the ema17 that you are in the example I gave, which would tell me why I'm getting a different result ?
      Gene Martin
      InfoLogic

      Comment


      • #4
        Hello Gene,

        No problem. Let's see if I can help clear this up for you. For this example we have the following data:

        close = 16.46
        dPercent = (2.0/ Length +1) = (2.0/18) = 0.1111
        last ema17 = 16.2444

        EMA-17 = ((close - last ema17) * dPercent) + last ema17

        EMA-17 = ((16.46 - 16.2444) * 0.1111) + 16.2444

        EMA-17 = 16.2684
        Jason K.
        Project Manager
        eSignal - an Interactive Data company

        EFS KnowledgeBase
        JavaScript for EFS Video Series
        EFS Beginner Tutorial Series
        EFS Glossary
        Custom EFS Development Policy

        New User Orientation

        Comment


        • #5
          Thanks

          That seems to work, thanks for saving me a lot of time.
          Gene Martin
          InfoLogic

          Comment

          Working...
          X