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 charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        65 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        149 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        162 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        99 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        286 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X