• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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:

    http://ninjatrader.com/support/helpG...rderupdate.htm

    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 AspenHiker, Today, 08:37 AM
              0 responses
              1 view
              0 likes
              Last Post AspenHiker  
              Started by dshalom9, Today, 08:36 AM
              0 responses
              1 view
              0 likes
              Last Post dshalom9  
              Started by StarTrader, 07-11-2020, 11:27 AM
              1 response
              13 views
              0 likes
              Last Post NinjaTrader_ChrisL  
              Started by rtwave, Yesterday, 04:11 PM
              1 response
              8 views
              0 likes
              Last Post NinjaTrader_PaulH  
              Started by sachin shetty, 07-11-2020, 08:49 PM
              1 response
              21 views
              0 likes
              Last Post NinjaTrader_PaulH  
              Working...
              X