Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Daily EMA last bar calc missing?

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

    Daily EMA last bar calc missing?

    I notice that in both a MarketAnalyzer and a Chart, the calcuated EMA for a range of daily data does not produce a result for the very last bar in the chart. For example, on 7/9 it only showed results up to 7/8, even after the market day ended and the 7/9 bar was closed.

    This is a problem since I need to know what the EMA was for the pervious day BEFORE the market opens the next day, not after it opens. I'm new to this, so I may easily be missing something.

    Also, is this a general issue with all indicators? Do indicators not get called for the very last bar until the next one opens?

    #2
    Please make sure you have both MarketAnalyzer and Chart set to the same CalculateOnBarClose setting.

    Comment


      #3
      Originally posted by NinjaTrader_Dierk View Post
      Please make sure you have both MarketAnalyzer and Chart set to the same CalculateOnBarClose setting.
      Yes, they are both set to CalculateOnBarClose = TRUE. (I don't want to waste time having the calculation done more than once per day.)

      Problem seems to be though, that a daily bar (of an index) is not recognized as "closed" until start of next day, so I can't see yesterday's EMA until after today's open. If trying to get any of the big daily EMAs (200, 50, etc.), they'll are delayed until start of next day, even though the previous day's bar is "closed" long before that.

      Surely there must be a workaround for this. I've also verified with another program that the EMAs being calculated by NT are correct, but am just missing that last day's calculated value, which, for most indices, should be available after the market closes that day.

      I just checked this again this morning, and the close from yesterday's index data is still not being used to calculate yesterday's EMA, even though the markets have been closed since yesterday afternoon. I presume that this won't be updated until the market opens today and the first data shows up for these stock indices.

      Comment


        #4
        >> Problem seems to be though, that a daily bar (of an index) is not recognized as "closed" until start of next day, so I can't see yesterday's EMA until after today's open. If trying to get any of the big daily EMAs (200, 50, etc.), they'll are delayed until start of next day, even though the previous day's bar is "closed" long before that.

        Not sure I follow. If that would be true than it would be true for chart and MA.

        Comment


          #5
          Originally posted by NinjaTrader_Dierk View Post
          Not sure I follow. If that would be true than it would be true for chart and MA.
          Yes, problem occurs whereever EMA is used, in both chart and MA.

          I've attached a small screen dump to illustrate the problem. The SP500 EMAs from daily data are not being calculated for the last closed bar, meaning I can't see what yesterday's value is for use today...

          Edit: I can see why this is not normally a problem for continuous data. But the daily index bar data has a big time gap between bars, so the "close" of a bar does not correspond to the "open" of the next bar. Perhaps the underlying NT code is not recognizing this issue, and is assuming that bar closes always occur with bar opens.
          Attached Files
          Last edited by greentrader; 07-10-2008, 05:11 AM.

          Comment


            #6
            Set CalculateOnBarClose=false to get the EMA for the last bar.

            Comment


              #7
              Originally posted by NinjaTrader_Dierk View Post
              Set CalculateOnBarClose=false to get the EMA for the last bar.
              Okay, but that just means that NT is spending all day needlessly recalculating EMAs just so I can see the one calculation it does at the end of the day that matters. As noted in my previous post, I think the underlying indicator update callback is flawed in that it does not recognize when bars like daily index bars are truly "closed". Unless I'm missing something, this appears to be a simple bug that should be fixed (TradeStation, for example, knows the difference, and updates such indicators on the same afternoon that the bar closes).

              Comment


                #8
                The previous bar is closed as the first tick of the next bar comes in. There is no "time based close" logic.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by funk10101, Today, 09:43 PM
                0 responses
                6 views
                0 likes
                Last Post funk10101  
                Started by pkefal, 04-11-2024, 07:39 AM
                11 responses
                37 views
                0 likes
                Last Post jeronymite  
                Started by bill2023, Yesterday, 08:51 AM
                8 responses
                44 views
                0 likes
                Last Post bill2023  
                Started by yertle, Today, 08:38 AM
                6 responses
                26 views
                0 likes
                Last Post ryjoga
                by ryjoga
                 
                Started by algospoke, Yesterday, 06:40 PM
                2 responses
                24 views
                0 likes
                Last Post algospoke  
                Working...
                X