Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Incorrect historical data loaded

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

    Incorrect historical data loaded

    Hi,
    Sometimes when starting a live strategy the historical data being loaded to the strategy is incorrect (gives different OHLC values then what they are suppose to be) despite the data that is displayed on the chart is correct. Deleting the data and downloading it again before running the strategy solves this problem. Can you please tell me what could be causing this problem, and what can I do to solve it?

    Thank you

    #2
    orenshkol, for which provider and market do you see this behavior manifesting? How do you load the data in the script? Would this be for a single or multi series script?
    BertrandNinjaTrader Customer Service

    Comment


      #3
      My provider is continuum, but I've seen the same thing happening when I'm using IQFeed on Sim. I'm loading the data using the Add fucntion, and I'm using a single esries script.

      Comment


        #4
        orenshkol, if you're using the Add function then you are working a multiseries script. As Add would just deal with added in series, you will always have the primary series in addition to that. So it would be important to filter the code for updates seen from all series, this would be done via BarsInProgress



        Would you mind sending us a snippet of code you're using that would show the load failing? I believe this is seen due to your missing filtering of the various series calls.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Data Issues

          Hi Bertrand,

          We are familiar with multi-series coding, and perform most of the OnBarUpdate() logic only when BarsInProgress == 0.

          The problem we see: sometimes, when reconnecting the data feed after a while (hours to days, which may cause holes in the data), the first few bars somehow return wrong data, even though we load enough days to cover all possible holes, in the GUI of adding a new strategy.

          By "wrong data" we mean that printing the OHLC prices to the output window / log file produced different values compared to the data shown on the chart!

          This phenomenon was encountered both for the secondary bar series (60 min bars, when connected to live account via Continuum), and in a different occasion, for the primary series (1 min bars, when connected to Sim101 via IQFeed).

          Thanks,
          Bel

          Comment


            #6
            Belcanto, welcome to our forums and thanks for the clarification. Would this be happening for all markets / contracts you tested? So you mean even after reconnect and reload of the data (which always would involve the current day - https://www.ninjatrader.com/support/..._are_built.htm) - the programmatically accessed data would be different than what chart / the Historical Data Manager would show?
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Thanks Bertrand,

              We encountered the problem in one or two markets, but that is because we are much more sensitive to the issue in those markets, and not necessarily because it does not happen in other markets.

              Indeed, the programmatically accessed data differ from the chart even after reloading, unless the data are first deleted from the database (e.g., by renaming the db\minute folder). I don't think we checked the Historical Data Manager, so cannot comment on that.

              Comment


                #8
                Hello Belcanto,

                I would like to see these discrepancies.

                (Just to confirm, when you print these values in the script, these prints are not inside of any branching command (if statement) correct?)

                Please right-click your chart and select Reload All Historical Data.
                After this take a look at the output and find a bar where there is a discrepancy between the chart and the output. (Ensure your output is printing the bar time as well (Time[0]) so that we can compare these)

                Then click Tools -> Historical Data Manager... -> select the Edit tab
                Click the plus "+" to expand the Instrument -> type of data -> interval -> date -> day -> and scroll to the same bar in the historical data.

                Please take a screenshot of this or export the grid to excel. (right-click grid -> select Grid -> select Export to Excel...)

                Also please take a screenshot of the chart with the data box open showing the OHLC of the bar with the discrepancy.
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  We will send you the screenshots once we encounter or manage to reproduce them
                  Thanks

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by josh18955, 03-25-2023, 11:16 AM
                  6 responses
                  435 views
                  0 likes
                  Last Post Delerium  
                  Started by FAQtrader, Today, 03:35 PM
                  0 responses
                  3 views
                  0 likes
                  Last Post FAQtrader  
                  Started by rocketman7, Today, 09:41 AM
                  5 responses
                  18 views
                  0 likes
                  Last Post NinjaTrader_Jesse  
                  Started by frslvr, 04-11-2024, 07:26 AM
                  9 responses
                  127 views
                  1 like
                  Last Post caryc123  
                  Started by selu72, Today, 02:01 PM
                  1 response
                  14 views
                  0 likes
                  Last Post NinjaTrader_Zachary  
                  Working...
                  X