Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

onExcutionUpdate with multiple filled orders

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

    onExcutionUpdate with multiple filled orders

    Hi,

    I have a doubt:

    If I am right: when I have sent an entry order to the market for more than one contract, when is filled in two times (with diferent pirces for example), the OnExecutionUpdate will detect two filled entry orders so if I have a condition that when entry order is filled I'll send an oco order, (profit and stoploss) this will be sent twice the oco order.

    So I would like to know if I can get the number of contracts filled so I can send the oco order with the same number of contracts. This way I won't have double number of contracts in the two oco orders than in my position.

    Or may be check if number of contracts in my position is the same than in my sent oco orders...

    Thanks

    #2
    Hello aprendiz,

    Thanks for your post.

    If an order gets filled in 2 executions, we will see the order fill as OrderState.PartFilled and then OrderState.Filled.

    Our SampleOnOrderUpdate strategy provides some direction for handling partial fills and changes were made to this script recently to improve functionality in this regard. I recommend reviewing this strategy and taking similar approaches in your strategy to handle stop/target submission and partial fill handling. (This is a Managed Approach strategy, but the same concepts could be implemented in an Unmanaged strategy.)

    SampleOnOrderUpdate - https://ninjatrader.com/support/help...and_onexec.htm

    Please let us know if we can be of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    45 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    21 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    31 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    50 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    42 views
    0 likes
    Last Post CarlTrading  
    Working...
    X