Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by wzgy0920, 04-20-2024, 06:09 PM
    2 responses
    27 views
    0 likes
    Last Post wzgy0920  
    Started by wzgy0920, 02-22-2024, 01:11 AM
    5 responses
    32 views
    0 likes
    Last Post wzgy0920  
    Started by wzgy0920, 04-23-2024, 09:53 PM
    2 responses
    74 views
    0 likes
    Last Post wzgy0920  
    Started by Kensonprib, 04-28-2021, 10:11 AM
    5 responses
    193 views
    0 likes
    Last Post Hasadafa  
    Started by GussJ, 03-04-2020, 03:11 PM
    11 responses
    3,235 views
    0 likes
    Last Post xiinteractive  
    Working...
    X