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

Cancel balance order in part filled orders

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

    Cancel balance order in part filled orders

    Hi,

    May I check how do I go about cancelling the balance in part filled orders? Understand that we can't use CancelOrder to cancel any part filled orders?

    I'll like to cancel any balance in the part filled orders after the price had reached either my profit level or my stop-loss level.

    Thanks in advance.


    Regards,
    Al

    #2
    Hello Al,

    Attempting to cancel a part filled order is most likely going to cause an error as the order will continue filling.

    It is possible to use a CancelOrder() on a part filled order and the non-filled amount will be cancelled. However if the order has another part fill execution before the part filled amount is cancelled, the broker is going to send an unable to cancel order error message, or an overfill message.

    My suggestion would be to use individual orders for each quantity instead of a larger quantity that can part fill.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi Chelsea,

      Thanks for the reply.

      May I also check on the following:

      1. Can I place ExitLongLimit for profit level and Exit LongStopLimit for stop loss with the original planned entry size even though I'm only partial filled for my entry?

      2. If yes to qn1 -> if price reaches either my profit level or stop loss level with the partial filled qty, will the exit order exit the partial qty and still pending the unfilled orders? W

      3. If yes to qn2 ->, if I cancelled the entry, will the 2 exit order also be cancelled?

      thanks in advance.

      regards,
      al

      Comment


        #4
        Hello Al,

        1. Can I place ExitLongLimit for profit level and Exit LongStopLimit for stop loss with the original planned entry size even though I'm only partial filled for my entry?

        You can place several ExitLongLimits and ExitLongStopLimit pairs for each quantity chunk small enough it won't part fill. Each entry should have a unique signal name, each exit should be using the From entry signal of that entry to pair them together.

        Make sure the EntryHandling is set to unique entries or EntriesPerDirection is large enough for the extra orders.



        2. If yes to qn1 -> if price reaches either my profit level or stop loss level with the partial filled qty, will the exit order exit the partial qty and still pending the unfilled orders? W

        The idea is to make the quantities small enough they don't part fill, even if the quantity has to be dropped to one. This basically happens only in slow moving markets and the script should be designed to handle that.

        3. If yes to qn2 ->, if I cancelled the entry, will the 2 exit order also be cancelled?

        With the managed approach yes, exits using the From entry signal of an entries Signal name will automatically be cancelled if the entry is cancelled or if the position opened by the entry is closed.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by GussJ, 03-04-2020, 03:11 PM
        11 responses
        3,223 views
        0 likes
        Last Post xiinteractive  
        Started by andrewtrades, Today, 04:57 PM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by chbruno, Today, 04:10 PM
        0 responses
        7 views
        0 likes
        Last Post chbruno
        by chbruno
         
        Started by josh18955, 03-25-2023, 11:16 AM
        6 responses
        438 views
        0 likes
        Last Post Delerium  
        Started by FAQtrader, Today, 03:35 PM
        0 responses
        10 views
        0 likes
        Last Post FAQtrader  
        Working...
        X