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 NullPointStrategies, Today, 05:17 AM
    0 responses
    52 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    130 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    70 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    43 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    47 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X