Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

PlayBack, OnExecution, error

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

    PlayBack, OnExecution, error

    Hello,

    With PlayBack, the OnExecution method is called before the OnBarUpdate method is finished.
    With real time works fine.

    I attach a sample code. The strategy is unmanaged.

    This is the PlayBack output:



    And this the realtime output:

    Attached Files

    #2
    So, Why does onbarupdate need called before an execution?

    Anyways, This might be related to onorderupdate caveat in playback:

    Comment


      #3
      No. The problem here is that you are running the code within a method (OnBarUpdate) and before reaching the end of this method, control passes to a different method (OnExecution).

      The link that you have posted is on the order in which event handler methods are executed, but that's a different matter.

      Comment


        #4
        This issue also occurs in StrategyAnalyzer with TickReplay (but disconnected).

        Basically: the control passes to a different method before reaching the end of the current execution method.

        This behavior is different to NT7.

        Comment


          #5
          Hello cls71,

          Thank you for reporting this issue. I will test further on our end to confirm and I will update this thread when I have further information.

          Thank you for your patience in the meantime.
          Michael M.NinjaTrader Quality Assurance

          Comment


            #6
            Hello cls71,

            I have confirmed this behavior and submitted a bug report. I will update this post when I have further information.

            Thank you for bringing this to our attention.
            Michael M.NinjaTrader Quality Assurance

            Comment


              #7
              Hello cls71,

              Our development team has confirmed that this is expected behavior and that this behavior is different from Ninjatrader 7.

              In NinjaTrader 8 the event is triggered right as it is produced. In the sim engine there is an added delay of a few hundred milliseconds to make the results more random like you would see if you were submitting live trades. This has been removed from the playback engine to ensure that results are always reproducible. This is why you are getting differences between the two in your tests.

              Please let me know if I may be of further assistance.
              Michael M.NinjaTrader Quality Assurance

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by trilliantrader, Today, 08:16 AM
              2 responses
              6 views
              0 likes
              Last Post trilliantrader  
              Started by samish18, Today, 08:31 AM
              1 response
              1 view
              0 likes
              Last Post NinjaTrader_Clayton  
              Started by Creamers, 09-08-2023, 10:26 AM
              6 responses
              157 views
              0 likes
              Last Post JonyGurt  
              Started by funk10101, Today, 08:14 AM
              1 response
              2 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by bill2023, Yesterday, 08:51 AM
              3 responses
              22 views
              0 likes
              Last Post bltdavid  
              Working...
              X