Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Close of last bar incorrect and other issues

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

    Close of last bar incorrect and other issues

    I'm using the Yahoo EOD data feed and I've noticed a few issues which I'd like to point out here since I'm unsure of what is related to Yahoo and what to NT.

    1) If I open a chart or hit "reload historical data" then all bars except the last day are shown. After a few seconds (or sometimes longer) the last bar appears as well. First I thought maybe all bars except the last one are considered as historical data and the last one as real-time data by the application. The "Historical" flag is however true for all bars, including the last one (so when using daily data there will never be any non-historical data?). But anyway, I suppose this is the intended behaviour.

    2) Point 1 is not a problem by itself. However, there seem to be some problems with the last bar (I have checked this with multiple instruments). Let my try to explain it with an example.

    Let's assume it's the 21st of August and the markets have already closed. Usually I get the following chart:

    A) ... -> Bar of 08/20 (correct) -> Bar of 08/21 (close incorrect)

    So here the problem is that the closing price of the last bar is not correct (all other data seems to be ok), i.e. it seems that the last trades of the day have not been considered in the bar yet.

    Past midnight (so technically on 08/22) things get more confusing and I get the following:

    B) ... -> Bar of 08/20 (correct) -> Bar of 08/22 (close incorrect)

    This is the same as above with the only difference that the last bar now has a different timestamp (which it obviously gets from my computer's clock). It's closing price is however still incorrect (and a bar for 08/21 is missing). So the only difference is that the last bar now gets a different date because of my local time.

    After a little while things get even more interesting:

    C) ... -> Bar of 08/20 (correct) -> Bar of 08/21 (correct) -> Bar of 08/22 (???)

    Now the bar of 08/21 is there (which was the last trading day) and it's data is finally correct. But now there is also another bar for 08/22 even though the markets have not opened yet. The high and low of this last bar (which should not be there) are the same as of the previous bar (the one that really should be the last), it's opening and closing price are however completely random.

    This seems to be a problem related to the Yahoo data feed and the timestamps of the data. If I go to the Yahoo website however, the data shown there is always (!) correct so NT must at least be doing something wrong.

    This is insofar an issue for me as my strategy works with daily data only and depends especially on the data of the last bar to generate signals on whether to place orders for the next day or not.

    I can live with situations A and B since the closing price is usually only a little bit off and if the date of the last bar is correct or not does not really matter. Situation C is a problem however, since there is a bar which should not be there. I could of course just ignore the last bar. The real problem is however, that I cannot programatically distinguish if it's situation A, B or C.

    Maybe one workaround to avoid situation C would be to manually set the LastDay property in the data series to 08/21 (after midnight) this should filter the unwanted bar. This would however still leave incorrect data (before midnight) in case A or completely missing data for the last day (after midnight) in case B (as the last bar now gets filtered).

    3) Sometimes (especially with non-US instruments) there are a few days missing between the bars that appear instantly and the last one (which always has the current date) that shows up a bit later. So even though this obviously is a problem with the data feed, when looking at the Yahoo website the data there is correct.

    #2
    NT pulls historical data from Yahoo and I believe we pull up until the prior calendar day close. The current day close sometimes may tricklet in since this based on a delayed simulated feed we create by requesting the last price. You can disable this in the Yahoo account connection by setting the delay value to some high number.
    RayNinjaTrader Customer Service

    Comment


      #3
      Do you mean the setting "market data request interval"?

      I played with it a bit and it seems the higher it is the longer it takes for the last bar to appear. However, I don't think this is a viable solution because

      1) the bar will appear eventually (unless the delay is set to a really high number).

      2) NT only consideres a bar closed once the next one has opened, so it would never show me the last (today's) bar after the markets have closed for today but not yet opened for the next day.

      3) if I do anything else that loads data, like opening a market analyzer window, this phantom bar will also suddenly show up in the chart.

      I think I'll do the following: I guess the wrong closing price in case A is due to the fact that somehow not all trades of the day have been considered yet in the data feed (even though the markets have already closed and the data on the Yahoo website is ok). Case B is the same as case A only with a different timestamp for the last bar. Both cases are acceptable, it might only be a problem if the actual closing price also made a new high or low for the day (then not only the closing price would be wrong which might lead to a wrong analysis). I think I should be able to filter out the phantom bar in case C by examining its timestamp and the current date and time of my computer (and comparing it to the opening hours of the markets).

      Comment


        #4
        PS: Another interesting thing associated with point 3 from the first post (missing days before the last bar) is that when I hit reload sometimes more and sometimes less bars are missing.

        Comment


          #5
          The point is that the historical data pool we get from Yahoo will not include today's data until tomorrow. So todays data is built off of the delayed updates on their site, thus the higher the delay the longer it will take to build the bar.
          RayNinjaTrader Customer Service

          Comment


            #6
            Yes, that makes sense and when the markets are open everything works fine: There is the historical data (excluding the last bar and if there are other bars missing then this is clearly a Yahoo problem) and the last bar which is made from Yahoo's current data (which is 15min delayed, both on their website and in NT).

            The problems I described occurred after the markets had closed. First, the last bar was still incorrect even though it was two hours or so after the closing time and the data displayed in NT did not match the data on the Yahoo website which is the strange thing. The second problem is then the appearance of this phantom bar once the past day gets into Yahoo's historical data but NT still loads another extra "live" bar (and another question is where the seemingly random opening and closing price of this phantom bar come from).

            I think NT should filter this last bar (or not try to load it). Instuments are already associated with an exchange so now it would only be neccessary to add the opening hours for each exchange. This would also solve the issue discussed in other threads that a bar is at the moment only considered closed once the next one has opened.

            For now I guess I'll set CalculateOnBarClosed to false so that my indicators will be calculated on every bar and then I'll manually implement the check (by looking at the time) to see if the last bar is closed or not or if its just junk.

            Comment


              #7
              Still fighting with this

              Hi

              Has anyone found solution or any workaround for this problem? It has been almost a year now since this thread started.
              Delaying data update is not a fix nor workaround in 95% of cases as it is causing only new problems. Besides while using Market Analyzer (with some indicators) it will update the data anyway.

              To NinjaTrader Support: in NT7 features thread there is information that Yahoo feed underwent Performance Overhaul. Does it mean you corrected this errors or it Is it still going to be a problem in NT7 and if so, what about Google feed, any good news here for free EOD data feed?

              If it is not possible to correct can you at least put some warnings while setting up Yahoo feed with the information that "this feed provides correct EOD data only from Monday to Friday between 16:30 to 23:59". And I am not being sarcastic. I really think it would save people a lot of time and frustration.

              Thanks

              Comment


                #8
                Hello gregid,

                Unfortunately the Yahoo feed will work the same in that regard with NinjaTrader 7.

                I am not sure how the Google feed will exactly work.

                I will forward your suggestion to my superiors.
                JasonNinjaTrader Customer Service

                Comment


                  #9
                  Thank you for your response Jason.

                  As much as I admire your software I am disappointed that correcting something that causes incorrect results 77% !!!! of time (for EOD data - 130 out of 168 hrs) has such a low priority in NinjaTrader development team!
                  I really hope this issue will be addressed one day.

                  Anyway I still think NT has got huge potential. I just don't understand why you don't seem to bother with this type of error.

                  Best regards

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Option Whisperer, Today, 09:05 AM
                  0 responses
                  1 view
                  0 likes
                  Last Post Option Whisperer  
                  Started by cre8able, Yesterday, 01:16 PM
                  3 responses
                  11 views
                  0 likes
                  Last Post cre8able  
                  Started by Harry, 05-02-2018, 01:54 PM
                  10 responses
                  3,203 views
                  0 likes
                  Last Post tharton3  
                  Started by ChartTourist, Today, 08:22 AM
                  0 responses
                  6 views
                  0 likes
                  Last Post ChartTourist  
                  Started by LiamTwine, Today, 08:10 AM
                  0 responses
                  2 views
                  0 likes
                  Last Post LiamTwine  
                  Working...
                  X