Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Delta value printed from strategy not matching chart data window

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

    #16
    Do you mean the actual output of CurrentBars[2] or the Closes[2][0]? Closes[2][0] is printing the current Last price of ES.

    Comment


      #17
      CurrentBars[2] is not updating to new bar index at same time of chart

      Comment


        #18
        Hello Lance El Camino,

        I am not able to reproduce.

        Below is a link to a video testing.
        https://drive.google.com/file/d/1N-M...w?usp=drivesdk

        The values printed match the chart.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #19
          That video of the strategy is OnBarClose. What about OnEachTick?

          Comment


            #20
            Hello Lance El Camino,

            With or without TickReplay?

            I am assuming you mean with TickReplay.

            As the indicator updates with the 1-tick series, you would want to move the logic to the BarsInProgress of that 1 tick series. With TickReplay enabled and Calculate set to OnEachTick, BarsInProgress 0 would be updating before BarsInProgress 1, so the last tick update of BarsInProgress 1 would not be included with the last tick update of BarsInProgress 0.

            I've adjusted the code to work with TickReplay and print during BarsInProgress 1 (after the 1 tick series has updated the indicator) and the values are still the same.
            https://drive.google.com/file/d/1M3G...w?usp=drivesdk
            Chelsea B.NinjaTrader Customer Service

            Comment


              #21
              Thank you again! I've been using Market Replay OnEachTick for everything. I also noticed that when I reloaded the historical data on the actual chart the values matched and the values of volume for the ES Volume chart changed for the current bar from what it was before I reloaded the historical data. I believe that was the issue this whole time. Could it be that there are minor hiccups when running Market Replay OnEachTick? Seems like when a lot of volume hits it slows down or pauses to process each tick and affects the bar construction on the Volume chart.

              Comment


                #22
                Would there be any advantage to calling the Volumetric Bar Delta instead of Order Flow Cumulative Delta?

                Comment


                  #23
                  Click image for larger version

Name:	image.png
Views:	23
Size:	557.9 KB
ID:	1218559
                  Here is an example of what I'm referring to. The volume in the chart says 3174. I've printed the volume output in the strategy of the primary bar series. It says 76. Yet the output of TICK in the strategy perfectly matches TICK on the chart.
                  Attached Files

                  Comment


                    #24
                    In this example I'm using ES 5000 Vol as BIP 0, ^TICK as BIP 1, and 1 tick series as BIP 2.

                    Comment


                      #25
                      Hello Lance El Camino,

                      I've been using Market Replay OnEachTick for everything.
                      The Playback Connection with Market Replay data plays back as real-time data. Anything that loads on the chart when the chart first opens is historical data. Historical data loads on the chart, and then the playback will play back Market Replay data as real-time data.

                      I am asking if in the historical data if you are using TickReplay. TickReplay is different than Playback with Market Replay or Tick data.

                      Below is a link to a video on Playback.
                      https://www.youtube.com/watch?v=CktT...vDBcC&index=17

                      In historical if TickReplay is not enabled, Calculate will always be OnBarClose and will not update intra-bar for each price change or tick with OnEachTick or OnPriceChange.

                      This means in the historical data, you are actually running the script with OnBarClose as you do not have TickReplay enabled.

                      TickReplay must be enabled for a script to update Calculate for OnEachTick or OnPriceChange historically.
                      https://ninjatrader.com/support/foru...377#post773377

                      I also noticed that when I reloaded the historical data on the actual chart the values matched and the values of volume for the ES Volume chart changed for the current bar from what it was before I reloaded the historical data. I believe that was the issue this whole time. Could it be that there are minor hiccups when running Market Replay OnEachTick?
                      I am not able to reproduce this behavior.

                      To confirm, if you start by following the exact steps I have shown in the video, the values are not matching the chart when you first apply the strategy?
                      If you reload the values match the chart or are still not matching the chart?

                      Would there be any advantage to calling the Volumetric Bar Delta instead of Order Flow Cumulative Delta?
                      The code for adding volumetric bars and using the values not typical. Some mind find a learning curve of how to call volumetric bar information.
                      Chelsea B.NinjaTrader Customer Service

                      Comment


                        #26
                        So if I'm using Market Replay I should still enable Tick Replay on both chart and strategy?

                        Comment


                          #27
                          Sorry I didn't answer your question, "If you reload the values match the chart or are still not matching the chart?" If I reload it matches. So that's what I believe was the initial problem. If running realtime data I thought Tick Replay wasn't necessary?

                          Comment


                            #28
                            Hello Lance El Camino,

                            For historical data loading in Playback, yes TickReplay still has to be enabled to allow Calculate to update for OnEachTick or OnPriceChange in historical.

                            Playback with Market Replay is real-time data only. This is not historical data. This plays back as real-time.

                            If you are not processing historical data, and you are doing an 'if (State == State.Historical) return' to not preocess the historical data, this would not apply. However, even in real-time I am getting the exact same values as the chart for every tick update.

                            Are you only processing the real-time data by returning in historical?

                            Are you printing the State in your print to confirm this is historical or real-time?
                            Chelsea B.NinjaTrader Customer Service

                            Comment


                              #29
                              My replay data is set to Market Replay. Also, there is a time difference in the output of BIP 0 and BIP 1 in the strategy.
                              Click image for larger version

Name:	image.png
Views:	19
Size:	70.5 KB
ID:	1218608

                              Comment


                                #30
                                Hello Lance El Camino,

                                It is expected a 1 tick series which has the time stamp of each tick, would be different than the time stamp of the close time of a larger primary bar.

                                Following the exact steps shown in the video I have provided you, with the exact code in the video, are you getting different behavior than what is shown in the video?
                                Chelsea B.NinjaTrader Customer Service

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by Gianpiero, 12-01-2022, 05:06 AM
                                5 responses
                                76 views
                                0 likes
                                Last Post NinjaTrader_Adrian  
                                Started by sjmuk1, 12-05-2022, 04:10 PM
                                5 responses
                                53 views
                                0 likes
                                Last Post NinjaTrader_Emily  
                                Started by spottysallrite, Today, 04:21 PM
                                0 responses
                                4 views
                                0 likes
                                Last Post spottysallrite  
                                Started by llanqui, Today, 03:56 PM
                                1 response
                                3 views
                                0 likes
                                Last Post NinjaTrader_ChelseaB  
                                Started by spottysallrite, Today, 02:50 PM
                                2 responses
                                13 views
                                0 likes
                                Last Post spottysallrite  
                                Working...
                                X