Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

partial fills

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

    partial fills

    I have a simple strategy.

    EnterLongStopMarket(0, true, qty, stopPrice, "myLongEntry")

    ExitLong(0, qty, "myLongExit", "myLongEntry") at a specific EoD time.

    managed code is much easier than unmanaged but how does managed code take care of partial fills?​

    does my code need to handle this ... protected override void OnOrderUpdate

    Code:
                    if  (order.OrderState == OrderState.PartFilled)
                    {
    
                    }
                    else if  (order.OrderState == OrderState.Filled)
                    {
    
                    }

    also will ExitLong cancel all positions & pending orders?

    also if there are none, can I still use it|?
    Last edited by fingers; 12-04-2023, 07:51 AM.

    #2
    Hello fingers,

    Thank you for your post.

    You can track partial fills in OnOrderUpdate() or OnExecutionUpdate(). Your stop or target will close the trade for the partially filled amount if either is hit before the entry order is completely filled.

    OnOrderUpdate() - https://ninjatrader.com/support/help...rderupdate.htm
    OnExecutionUpdate() - https://ninjatrader.com/support/help...tionupdate.htm


    ManagedRithmicIBFriendlyExample demonstrates how OnOrderUpdate and OnExecutionUpdate may be used to submit target/stop and this strategy also works well to handle partial fills.

    https://forum.ninjatrader.com/forum/...72#post1206372


    ExitLong() will not cancel all positions/pending orders. You can use CancelOrder() instead. Please see the example script below.

    https://ninjatrader.com/support/help...thod_to_ca.htm


    Please let us know if you have any other questions.

    Comment

    Latest Posts

    Collapse

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