Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help with Cumulative Delta indicators

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

    Help with Cumulative Delta indicators

    Can you help me understand the cumulative delta indicators better?

    When I have a chart with the following two indicators:
    Order Flow Cumulative Delta (NQ 06-18 ( 4 Range ), Bid Ask, Session, 0 )
    Order Flow Cumulative Delta (NQ 06-18 ( 4 Range ), Bid Ask, Bar, 0 )

    For any given individual bar I am expecting the following to be true:
    ( Delta Close of Session Indicator - Delta Open of Session Indicator ) = Delta Close of Bar Indicator

    Is that incorrect? For bars loaded historically, it seems to hold true. For bars built live, it doesn't seem to be. The Session Delta seems to be at least +/- 1 the bar delta value, sometimes more, in the attached image, it's off by 3.

    Thanks,
    Nick
    Attached Files

    #2
    Hello Nick,

    Thanks for the post.

    This is an expected behavior of cumulative delta bars that run on non-time based bars like tick/volume/range. The math is correct, but what is happening is that when multiple ticks/bars have the same timestamp, NinjaTrader doesn't know the order of the bars in relation to the other series. This means that all of the ticks for the series are fired in a row before changing back to the other series. So the ticks are showing up in a different bar than the bar that it is expected to land on. To get around this, you would need to have the cumulative delta indicator already running on live data as the session begins.

    Please let us know if you have any questions.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      This timestamp issue is really confusing the heck out of me

      The bar in the picture I attached was built against live data. From a previous ticket, I was under the impression that the timestamp issue doesn't affect live data as the transactions are processed in the order they are sent by the data provider?

      Comment


        #4
        Hello Nick,

        Thanks for the follow-up.

        Our development team has updated the information on this issue and told me the session period cumulative delta is affected by this in State.Realtime because it is cumulative throughout the session, that is why running the session cumulative delta from the very beginning of the session instead of starting it from the middle of a session will work.

        Please let us know if you have any questions.
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          I will try this and see, unfortunately I missed today's start of session. I am still struggling to understand this though.

          You seem to be saying that the indicator behaves different in State.Realtime based on whether or not the first bars processed for the indicator were in State.Historical or State.Realtime?

          I see how the behavior can be different in Historical vs Realtime, but I don't understand how the indicator could possibly operate differently in Realtime once that state is reached.

          I also don't understand how this seems to be affecting the Cumulative Delta Session and Cumulative Delta Bar indicators differently... they seem to be calculating differently in my screenshots. But they are both operating as a 1 tick series behind the scenes, right? Seems like they should be affected by any timestamp issue in a similar way.

          Comment


            #6
            Hello Nick,

            The Cumulative Delta indicator will behave differently if you accumulate from historical data to real-time. In other words, if you apply it to your chart in the middle of a session and then it begins to calculate in real time, it will display ticks in a different bar than you expect because of the ordering of the ticks. If you apply it before the beginning of the session and it starts accumulating in real time at the beginning of the session it will display as expected.

            Here is an example:

            Primary Series: 3 Volume

            Secondary Series: 1 Tick

            Calculate: OnBarClose

            State: Historical

            Order of OnBarUpdate calls:

            Primary → 10:00:00.050 → 3
            Primary → 10:00:00.050 → 3
            Secondary → 10:00:00.050 → 1
            Secondary → 10:00:00.050 → 1
            Secondary → 10:00:00.050 → 1

            Secondary → 10:00:00.050 → 1
            Secondary → 10:00:00.050 → 1
            Secondary → 10:00:00.050 → 1


            This forced tick ordering would not happen in real time; that is why running from real-time data from the beginning of the session will produce expected results.
            Chris L.NinjaTrader Customer Service

            Comment


              #7
              Thanks for trying to explain it. I'll start a fresh chart Sunday afternoon to look for this behavior.

              Is the point about the shared timestamps that I am not getting is that the two data series never get back in synch after a shared timestamp scenario occurs? Once it happens, all subsequent bars are off?

              Comment


                #8
                I started a fresh chart Sunday at 4:00pm CST. It was completely blank until the market opened at 5:00. It still seems to be happening. Please see the photo, Session indicator reports a delta of -5, the Bar indicator a delta of -3.
                Attached Files

                Comment


                  #9
                  Hello Nick,

                  Thanks for the reply.

                  I will test this out tomorrow and make sure I have the indicators applied before session begin. I will let you know what I find.

                  Thanks in advance for your patience.
                  Chris L.NinjaTrader Customer Service

                  Comment


                    #10
                    Hello Nick,

                    Thanks for your patience on this item.

                    I was able to confirm the correct behavior of OrderFlow+ Cumulative Delta when started at the session beginning. Please see the screenshot attached. Can I confirm that you have reloaded the scripts and historical data on your chart? Please also make sure to keep your platform up to date as the OrderFlow+ tools are still in beta release.
                    You can reload the scripts on your chart by right clicking> Reload NinjaScript.
                    You can reload the historical data on your chart by right clicking> Reload all historical data.

                    Please let me know if you see the same after doing this.
                    Attached Files
                    Chris L.NinjaTrader Customer Service

                    Comment


                      #11
                      I am using 8.0.13.1 64-bit (Standard).

                      I reloaded the script and historical data, it still is incorrect on my machine. Or do I have to wait until tomorrow for the start of a new session?

                      Can you please lay out the exact steps you used to create the chart and apply the indicators? Also can you confirm what what trading hours your chart is using? Mine is using instrument default which is set to CME US Index Futures ETH.

                      Comment


                        #12
                        Hello Nick,

                        Thanks for the reply.

                        Here are the details of my chart configuration:

                        NQ 06-18 4 Range
                        CME US Index Futures ETH

                        I loaded the OrderFlow Cumulative Delta Session and Bar with their default settings. I reloaded my historical data as well as the scripts before the open of the market for good measure.

                        May I ask what data feed you are using so that I can test this out again at market open tomorrow? I would suggest doing the same procedure I did and you can test this tomorrow with me.

                        I look forward to your reply.
                        Chris L.NinjaTrader Customer Service

                        Comment


                          #13
                          I have no idea why we are seeing different behaviors. I am using Continuum.

                          Isn't the start of the session on that template 3:30pm CST? Won't you need to have the indicator going by then?

                          Comment


                            #14
                            Hello Nick,

                            Thanks for the reply.

                            According to the session template, the CME US Index Futures ETH session starts at 5PM. I will test this on Continuum tomorrow and let you know what I find. If you are still unable to see correct data placement after this test I will discuss what we can do with my colleagues.

                            I look forward to assisting further.
                            Last edited by NinjaTrader_ChrisL; 04-18-2018, 08:05 AM.
                            Chris L.NinjaTrader Customer Service

                            Comment


                              #15
                              Hello Nick,

                              I tested this on NinjaTrader Continuum and my difference is reading correctly. Are you able to see the same on your end?

                              I look forward to your reply.
                              Chris L.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by warreng86, 11-10-2020, 02:04 PM
                              7 responses
                              1,360 views
                              0 likes
                              Last Post NinjaTrader_Manfred  
                              Started by Perr0Grande, Today, 08:16 PM
                              0 responses
                              5 views
                              0 likes
                              Last Post Perr0Grande  
                              Started by elderan, Today, 08:03 PM
                              0 responses
                              9 views
                              0 likes
                              Last Post elderan
                              by elderan
                               
                              Started by algospoke, Today, 06:40 PM
                              0 responses
                              10 views
                              0 likes
                              Last Post algospoke  
                              Started by maybeimnotrader, Today, 05:46 PM
                              0 responses
                              14 views
                              0 likes
                              Last Post maybeimnotrader  
                              Working...
                              X