Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bars To Load and EMA(200)

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

    Bars To Load and EMA(200)

    Hi community,

    i have seen the following occuring and i am not sure of the concept behind this, so maybe someone can bring in some light.

    If i use an EMA(200) on for example a 240min chart, the actual value of the EMA(200)[0] is changing as i manipulate the "Bars to Load" value (changing it from for example 250 to 400 will result in a different EMA value).

    Why is this happening? I assumed, that if an indicator is added to a chart, NT is using the amount of needed bars to actually calculate the given indicator correctly, but thats not the case as it seems. What would be the "correct" value for an EMA(200) in "Bars to Load"? Is there a formular to use?

    many thanks in advantage

    #2
    puravida, that would be expected as your EMA is techically a IIR filter (Infinite Impulse Repsonse) - meaning it would take always take all data into consideration by it's internal weigthing, albeit this would be get extremely small at some point the futher you look back, but it would still contribute. In contrast the SMA would have definite 'cutoff' here being a FIR filter (Finite Impulse Response), so your 200 bars window to calculate is hard set and older bars really dropped out of the calcs.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Thanks for the quick response.

      Think i get the concept, but to be sure:
      That means, if anybody is telling/linking an value for an EMA, it will always depend on how many bars he used to calculate it, right? So if a website "claims" the EMA(200) of the instrument XYZ is for example 10.10, then this is not really compareable unsless he gives the number of bars he has loaded to actually calculate it?

      Is there a study available how to adjust in such a case, so you get most out of the bars, but don't use too much to stress you data feed? Is there a formular like:
      If you use (200) bars as parameter, you should use XYZ times as many bars to load for optimal performace and minimal data loss?

      I assume the most "correct" version would be to load as many bars into the chart as possible, right? I saw it not really changing anymore above 610 bars (so about 3 times the amount of the input parameter), but this may be also the max. amount of historical data i had available.

      And another question, if you print the value from a strategy, it always differs from the chart. How many bars is a strategy using by default to calculcate? All available or is there also a bars to load parameter i haven't found yet?

      Comment


        #4
        You are correct, there isn't really a rule of thumb but you would have to be aware in this case how the calculation works and that some data is needed to arrive at 'stable' values, as you have seen at some point the effect becomes negligible. Do you run the strategy from the chart as well? The strategy would per default have a BarsRequired of 20 before any OnBarUpdate(0 would be called. This could be shortened from the UI if desired.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Thanks for your help.

          Bars required is the parameter i was looking for to adjust.

          Comment


            #6
            Originally posted by puravida View Post
            Thanks for your help.

            Bars required is the parameter i was looking for to adjust.
            That is unlikely. BarsRequired is the number of bars that must pass BEFORE calculations start, not the number of bars required to calculate the Plot.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by mgco4you, Today, 09:46 PM
            1 response
            2 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by wzgy0920, Today, 09:53 PM
            0 responses
            3 views
            0 likes
            Last Post wzgy0920  
            Started by Rapine Heihei, Today, 08:19 PM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by Rapine Heihei, Today, 08:25 PM
            0 responses
            6 views
            0 likes
            Last Post Rapine Heihei  
            Started by f.saeidi, Today, 08:01 PM
            1 response
            9 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Working...
            X