Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Question regarding Cumulative Delta applied to historical data

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

    Question regarding Cumulative Delta applied to historical data

    I have applied the cumulative delta indicator to historical data.

    I am seeing that the cumulative delta indicator does not require the use of tick replay. Therefore I assume that it loads tick data directly from the historical tick data base and does not perform calculations on the chart bars.

    Cumulative delta values on tick and minute charts are not identical, but come pretty close. Therefore I assume that they both use the same data source - that is historical tick data.

    I do understand the concept of upticks / downticks with continuation. This is an approximation with something like 70% to 80 % accuracy that allows for calculating cumulative delta from simple trade data (tick by tick but without information whether the trades occured at the bid, at the ask or in between).

    Here comes my question:

    When I select "Delta type" = "BidAsk" on historical data, how is the delta calculated?

    I do not have any bid or ask data stored in my historical data base. The only data available is historical tick data of type "Last". This means that a genuine cumulative delta calculation is not possible with my data, as the data is not being qualified as bid or ask.

    Nevertheless, when selecting the delta typy "BidAsk", the indicator produces an output that is different from the result generated for the uptick/downtick with continuation setting. What logic is behind this calculation?

    #2
    Other than my question - please see prior post - I am running into issues with the setting "BidAsk" for several instruments, see charts attached.

    For example for GC futures the cumulative delta is completely off prior to November 29. For FDAX futures it is off for all dates prior to December 13. For CL it happens prior to January 12.

    What is happening here?

    In all cases the problem is related to rollover dates, as the false calculation can be observed about 3 working days prior to the last rollover date.

    Edit: Reloading all historical data temporarily fixes the issue. However, when you toggle to a different instrument and then back to the original instrument, the problem reappears.
    Attached Files
    Last edited by Harry; 02-10-2018, 03:50 PM.

    Comment


      #3
      Most (if not all) data providers have bid/ask stamped tick data. so when you load last tick data, it includes bid/ask info.

      It sounds like this may be a cache issue based on the information you've provided.

      To delete the cache, follow the steps below.
      • Shut down NinjaTrader.
      • Open the Documents > NinjaTrader 8 > db folder.
      • Delete the sub-folder named 'cache'.
      • Restart NinjaTrader and test.


      EDIT:

      Harry, so we can better understand what you've reported, we'd like to collect some files from your end. Please write into PlatformSupport[AT]NinjaTrader[DOT]com with a link to this thread and 'ATTN Patrick G' in the subject.
      Last edited by NinjaTrader_PatrickG; 02-12-2018, 10:26 AM.

      Comment


        #4
        Additionally, we will test to see how you are getting that output on GC and if we can reproduce. We will be back with more questions / confirmation of issue fix once we have understood what is going on there.

        Comment


          #5
          Hello Patrick and Brett,

          Thank you for your answer.

          I will contact you via e-mail, as requested below.

          Comment


            #6
            Hello Brett, (or anyone)
            on this topic, just how does one get accurate bid and ask values on historical data, without Tick Replay?
            In testing here, values returned by GetCurrentBid() and GetCurrentAsk() always report only the Last price on Historical data.
            OnMarketData() doesn't fire on Historical Data.
            Yet somehow, an indicator like "Order Flow Cumulative Delta" uses Bid and Ask historically without Tick Replay.

            I have done much testing with loading additional DataSeries for Bid and Ask, but historically they arrive in an order that is not the same as realtime, and the results therefore are incorrect, especially for a calculation like Cumulative Delta based on Bid and Ask.

            Some specific advice would be greatly appreciated.

            FYI I've built a perfect Cumulative Delta and Volume Profile using TickReplay and OnMarketData,which matches the built-in Order Flow indicator perfectly, but unfortunately that is not able to be used on LineBreak charts which my client specifically requires this project for. So I'm in a bit of a pickle.

            Thanks,
            saltminer

            Comment


              #7
              Hello saltminer,

              Thank you for your response.

              You can use the Bars.GetAsk() and Bars.GetBid() on historical bars to receive the Bid or Ask values of that bar index historically. You can find this detail under the Bars section in the Help Guide at the following link: https://ninjatrader.com/support/help...en-us/bars.htm

              Please let me know if you have any questions.

              Comment


                #8
                Hi,
                thanks, that's very helpful, and I've got good results from using that.

                Can I ask how the Bid/Ask mode in the Order Flow CumulativeDelta operates when a trade occurs between the Bid and Ask?

                Thanks,
                saltminer

                Comment


                  #9
                  Hello saltminer,

                  Thank you for your response.

                  If a tick is greater than the Bid and the last tick was a buy then it is considered a buy if not then it is a sell.

                  Please let me know if you have any questions.

                  Comment


                    #10
                    Order Flow Cumulative Delta - bug at State.Transition

                    Hi,
                    the Order Flow Cumulative Delta does not operate correctly at the transition between historical and realtime.
                    It resets incorrectly to zero at the first realtime tick. Try it in market replay - you'll easily see the problem.

                    I haven't tested all the other OrderFlow indicators.

                    saltminer.

                    Comment


                      #11
                      I am seeing the same here. Cumulative delta is incorrect for the transition bar between historical and real-time data. Volume data for the historical fraction of the transition bar is not being accounted for.

                      Comment


                        #12
                        Hello Harry and saltminer,

                        Thank you for your responses.

                        I am not seeing the same behavior on my end on Market Replay data or when using a realtime data feed.

                        Can you advise the version of NinjaTrader 8 you are using? This is available under Help > About in the NinjaTrader Control Center.

                        Can you provide the settings used for your chart? What instrument, bars type, and Days To Load?

                        Please also detail the Order Flow Cumulative Delta setting used.

                        I look forward to your response.

                        Comment


                          #13
                          Hi,
                          I'm using NT8.0.15.1.
                          Minute charts (I was using a 30 Minute on 6A futures in Market replay).
                          Indicator is set to Bid/Ask showing Bar delta.
                          20 minutes in it might show a Delta of 1000 or so, and when the next tick comes in (perhaps of just a few contracts) Delta plummets to zero or a small offset thereof. It is easy to replicate in market replay. Just have this indicator on and a volume indicator - you can see it is not right.

                          Load market replay with the indicators on, and scroll to a suitable time mid-way through a long duration bar. Hit F5 on the chart so you see the historical load.
                          Start the replay and immediately stop it after the first tick hits the chart. That'll do it.

                          saltminer

                          Comment


                            #14
                            Hello saltminer,

                            Thank you for your response and the details.

                            I can replicate this on my end with your instructions. I will follow up here when I have details on this matter.

                            Comment


                              #15
                              Hello everyone,

                              A fix is planned for the next release of NinjaTrader 8 concerning this matter.

                              Please let me know if you have any questions.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Mestor, 03-10-2023, 01:50 AM
                              16 responses
                              388 views
                              0 likes
                              Last Post z.franck  
                              Started by rtwave, 04-12-2024, 09:30 AM
                              4 responses
                              31 views
                              0 likes
                              Last Post rtwave
                              by rtwave
                               
                              Started by yertle, Yesterday, 08:38 AM
                              7 responses
                              29 views
                              0 likes
                              Last Post yertle
                              by yertle
                               
                              Started by bmartz, 03-12-2024, 06:12 AM
                              2 responses
                              22 views
                              0 likes
                              Last Post bmartz
                              by bmartz
                               
                              Started by funk10101, Today, 12:02 AM
                              0 responses
                              7 views
                              0 likes
                              Last Post funk10101  
                              Working...
                              X