Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnExecution Event Not Firing Consistently

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

    OnExecution Event Not Firing Consistently

    I'm developing an add-on for a client and have encountered a challenge with the OnExecution event. While everything functions seamlessly in a simulated account, the client faces an issue during "Live" trades with Apex Trader Funding. Specifically, when there's a split fill on an order, the OnExecution event triggers several times, but it doesn't trigger for the final execution. I've incorporated logging to diagnose the problem, but the cause remains elusive. The logs confirm that the OnExecution event activates multiple times during partial fills, but not upon complete fill. However, the OnOrderUpdate method consistently receives all updates. Can anyone shed light on this anomaly?
    Attached Files

    #2
    Hello SystemTrading,

    You may need to use OnOrderUpdate for this, if the user is using an apex account with a rithmic connection the order of events are not guaranteed. You can find a sample in the following post which uses OnOrderUpdate to help avoid that problem. https://forum.ninjatrader.com/forum/...72#post1206372

    Comment


      #3
      That was my backup plan, but I run in to another issue with that solution. I'm also using the built-in SystemPerformance and Position objects to track positions and calculate P&L. I need the executions in order to update these objects. Is there another way to retrieve the executions?


      Code:
      private SystemPerformance systemPerformance = new SystemPerformance(true);
      private Position position;
      
      private void OnExecutionUpdate(object sender, ExecutionEventArgs e)
      {​
          position.AddExecution(ex, Parent.systemPerformance);
      }

      Comment


        #4
        Hello SystemTrading,

        There is no way to force the events to be in a specific order, that is the order that they are being sent through the brokers API. NinjaTrader subscribes to those events and in the case of IB and Rithmic those events won't be guaranteed to be in a certain order.

        The only way to get executions in an addon would be to subscribe to the execution update event or use the accounts execution collection https://ninjatrader.com/support/help...executions.htm

        Comment


          #5
          Got it. Thanks!!!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          599 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          344 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          103 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          558 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          557 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X