Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Partially filled orders

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

    Partially filled orders

    hi ... need some direction.

    I have an automated strategy that manages both trade entry and trade exit conditions. I can conceivably have a situation where an order, (say 6 contracts) is partially filled (only 4 of the 6 contracts) ... and the remainder of the order (2 contracts) gets filled after I've reached an exit condition. In this case, I need to do the following when I reach my exit condition ...

    1) exit all of the contracts that I have currently active (do I need to specify the # of contracts that are active, or is there a catch-all function that closes all trades?)

    2) need to cancel any outstanding orders that are left over from a partially filled order ... in the case above, the 2 remaining contracts. (how is this accomplished?)

    Any assistance/advice is greatly appreciated.

    #2
    Hello pman777,

    Thank you for your post.

    You can use Exit() methods to exit all positions whether long or short (using ExitLong() or ExitShort() respectively).

    You can use IOrder objects OnExecution() and CancelOrder() together to accomplish cancelling orders that are partially filled.

    For information on IOrder objects please visit the following link: http://www.ninjatrader.com/support/h...nt7/iorder.htm

    For information on OnExecution() please visit the following link: http://www.ninjatrader.com/support/h...nexecution.htm

    For information on CancelOrder() please visit the following link: http://www.ninjatrader.com/support/h...ancelorder.htm

    Please let me know if you have any questions.

    Comment


      #3
      thank you for your response!!! Do you know of sample code that cancels a partial order?

      Comment


        #4
        Hello pman777,

        Thank you for your response.

        I am not aware of an example for partial fills but you can find an example of using OnExecution() at the following link: http://www.ninjatrader.com/support/f...ead.php?t=7499

        Please let me know if you have any further questions.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        634 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        364 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        105 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        567 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        568 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X