Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnExecutionUpdate() Timing Clarification

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

    OnExecutionUpdate() Timing Clarification

    I have thought that OnExecutionUpdate() is called immediately after each broker confirmation of order execution. However, while testing an unmanaged strategy that I have developed using the Playback Historical capability and with the Primary Data Series being 15-second bars and the Secondary 1-tick data OnExecutionUpdate() is called only at 15-second intervals. Is that due to a Playback Historical testing limitation or have I misunderstood when OnExecutionUpdate() is called? There obviously is no way to know how long order confirmations would have taken, but I had assumed that the test system would either immediately confirm following the crossing of a limit price level, for example, or would confirm after a short random delay period to approximate reality.
    Last edited by caveat_lector; 04-03-2020, 03:29 PM.

    #2
    I just noticed the OnExecutionUpdate() Help states:

    "Playback connection triggers executions immediately, for the sake of consistency in backtesting. Because of this, OnExecutionUpdate() can appear to be triggered earlier than it would in live trading, or when simulation trading on a live connection."

    That isn't what I am seeing. OnExecutionUpdate() is always called 15-seconds after the close of a bar that crosses an order limit price, so order execution confirmations are always 15 to 30 seconds later than would have occurred real-time, depending on exactly when during a 15-second bar a price limit was crossed.

    Comment


      #3

      Hi caveat_lector, thanks for your post.

      I wanted to let you know I'm testing code behavior and will reply when I have an answer.

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

      Comment


        #4
        Hi caveat_lector, thanks for your patience.

        I'm not seeing the same thing on my side. Heres a video and I also attached my test script.

        https://clauber.tinytake.com/tt/NDE4ODM1MV8xMzAxMzc4NA

        Please let me know if this does not resolve your inquiry.
        Attached Files
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          Thanks very much for the time you spent on that. I will compare your script and video to what I am doing and seeing.

          Comment


            #6
            Sorry, my mistake. I was using:
            Code:
            Print(execution.Name + " " + Time[0] + "." + Time[0].Millisecond + " Time Series");
            Instead of:
            Code:
            Print(execution.Name + " " + Times[1][0] + "." + Times[1][0].Millisecond + " Time Series");

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by muratb35, Today, 03:36 AM
            0 responses
            4 views
            0 likes
            Last Post muratb35  
            Started by fernlicht, Today, 02:16 AM
            2 responses
            13 views
            0 likes
            Last Post fernlicht  
            Started by fernlicht, 04-12-2021, 06:01 PM
            1 response
            29 views
            0 likes
            Last Post NinjaTrader_PaulH  
            Started by memonolog, Today, 02:10 AM
            3 responses
            10 views
            0 likes
            Last Post memonolog  
            Started by orenytz, Today, 12:25 AM
            0 responses
            10 views
            0 likes
            Last Post orenytz
            by orenytz
             
            Working...
            X