Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Plot Executions - TextAndMarker showing at wrong bar

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

    Plot Executions - TextAndMarker showing at wrong bar

    Hello Support,

    I am testing my strategy. My strategy draw the Entry Signals at the close of the current bar 0. But I see NT plotting the execution at a few bars before that! Sometimes even more than ten bars behind (bar 10). The price vertical triangle marker is correct, but text and arrow horizontal position is mostly wrong! Check out the attach screen capture.This is annoying as one see and conclude it is not taking the trade and then there is trade when there is no signal. It makes visual verification difficult when there are multiple signals and executions. How can this be fixed ?

    Thanks.

    Regards.
    Attached Files

    #2
    Hi Edward Kunafi,

    It's possible that the entires are not being executed at the same time as the Draw() objects are being drawn. To verify this, try using Print() statements to track when the conditions for the Draw() objects are satisfied, and use TraceOrders to track orders and compare the two.

    More on Print() - http://www.ninjatrader.com/support/f...ead.php?t=3418
    More on TraceOrders - http://www.ninjatrader.com/support/f...ead.php?t=3627
    TimNinjaTrader Customer Service

    Comment


      #3
      Hello Tim,

      1. I have remove uncessary clutter in the new attached image. The cross hair cursor is at the Strategy Marker done by NT. At that bar, the price does not reach 71.94, let alone 71.95.
      2. The draw done my Strategy script is given at 7 bars after that, close of bar at high is clearly 71.94. Trade must have been taken one bar after that when price hit 71.95.
      3. Look at the profit target execution, also shown at the wrong bar. That bar marked profit target does not reach 72.02, only two bars after that price reach 72.02
      4. Bar marked ExitTL does not cross 71.96, price only falls to that level at 5 bars later, where my Strategy also draw ExL1 at 71.96 correctly.

      Now my Strategy also happens to print critical information. This is not market replay, it happens realtime today. I attached the relevant print. Check it out, It shows NT take the trade after the given signal, but print an earlier time! Also look at the last two lines is output print. The ExitTL is showing earlier time but it is after the signal UpTrend Trail Stop Crossed Down. How can NT execute earlier before getting the Signal. What is going on? How can it be fixed ?

      Thanks.

      Best regards.

      EdwardK
      Attached Files

      Comment


        #4
        Edward,

        Are you using tick charts or similar? If you are, the execution will be plotted on the first bar with the same timestamp as where the trade was placed. This is the case because there is no way the charting can differentiate the bars based on timestamp alone so when there are multiple bars with the same timestamp the executions will be shown on the first bar with that timestamp.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Hello Josh,

          I am not using tick chart, but special Renko bar.

          I do not understand what you are saying.

          My strategy give the signal, draw correctly bar wise and price wise. Then then trade is taken by NT, but earlier?

          Thanks.

          Regards.
          EdwardK.

          Comment


            #6
            Hello Josh,

            I reread your post and understand what you mean now. But it does not explain the prints that show seconds. Also the exit clearly not on first of multiple bar of 1:26, it is actually at 1:25.
            So I conclude it must be something else, somehow NT does not get internal time correctly.

            Thanks.

            Regards.

            EdwardK

            Comment


              #7
              Edward,

              What data provider are you using? Executions are timestamped with local PC timestamps. If you local PC clock is a little bit out of sync with the data feed's timestamp it could result in the execution being shown on a different bar as well.
              Josh P.NinjaTrader Customer Service

              Comment


                #8
                Hello Josh,

                I am using Zen-Fire.
                The execution time seems to be earlier by about 57 seconds.
                I have adjusted my clock to be earlier by about 57 seconds, but I can see execution time is still ahead by 57 seconds. So I think the issue is caused by something else.

                Thanks.

                Regards.

                EdwardK.

                Comment


                  #9
                  Edward, you would to check the time sync on a frewly executed trade then, those would not be backadjusted as you change your clock, they stamped as the come in / are received by NT.

                  Comment


                    #10
                    Hello Bertrand,

                    Of course I am observing new executions. I have verified, the computer I run NT has now been set to about 57 seconds later than my other computer. But when NT show the execution after the signal, the Execution timestamp is still about 57 seconds earlier than the Signal timestamp.

                    I suspect it is something else.

                    If there is time difference, why can't NT detect any time difference ? And adapt the printing?

                    But computer time can be made to sync to server like "time-a.nist.gov" everytime it is boots up, so I would assume Zen-Fire would also do that, it make sense. Any difference would probably a fraction of a second, if it is booted up every day. It cannot be 50 odd seconds. My two computers was showing about the same time, before I change the one running NT.

                    Thanks.
                    Regards,
                    EdwardK.

                    Comment


                      #11
                      Hi Edward Kunafi,

                      Thank you for the update. As a test, can you please try running this on a tick chart, then run it on the default, supported Renko chart, to see if you see the same behavior (an exceptionally large gap in time)
                      TimNinjaTrader Customer Service

                      Comment


                        #12
                        Hello Tim,

                        Tried on Tick Chart, it behaves the same. I notice that when I reload Strategy the historical execution TextAndMarker is plotted correctly, but when it comes to realtime trade, the gap appears.

                        Thanks.

                        Regards.
                        EdwardK

                        Comment


                          #13
                          Hi Edward Kunafi,

                          What kind of gap are you now seeing? (how long?)
                          To verify, have you tried this with the PC clock synced?

                          You can sync your PC clock by double clicking on the clock in the lower right corner of your desktop. Once you have done that, click on Internet Time tab and then click Update. Your PC clock should now be updated.
                          TimNinjaTrader Customer Service

                          Comment


                            #14
                            Hello Tim,

                            Gap remain about the same.
                            My PC was synced to server up to this morning when I adjust the clock backwards about 57 seconds and untick the sync option. NT is still showing execution timestamp that is about 57 seconds behind Signal Timestamp.

                            I have ticked back the Clock Sync option, connection is lost then reconnected when this is applied. And so far the strategy on Tick Chart does not exhibit the gap anymore. The Renko based charts have not trigger a trade. Will let you know tomorrow. Hope this really solve the problem.

                            Thanks.

                            Regards.

                            Comment


                              #15
                              Hello Tim,

                              This seems to work well. The execution timestamp now matches or slightly later than the signal timestamp. Seems that we cannot manually adjust, but just do time sync update with server.

                              Thanks.

                              Regards.
                              EdwardK.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              663 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              376 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              110 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              575 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              580 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X