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

Canceled trades due to partial entry fills

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

    Canceled trades due to partial entry fills

    Hi NT experts,


    I have an issue with canceled FOREX trades with IB due to partially filled entry orders. It happens very often.


    IB automatically routes FOREX orders to its “Exchange” IDEALPRO. When an order size is smaller than certain size, it will also re-route it to IDEAL, of course without trader intervention.


    The problem arises with matching stop and target orders when entry order is partially filled. Some partially filled orders will have position size smaller than IB specified size for IDEALPRO. The following stop and target orders will be rejected when using execution.Order.Filled as the quantity in OnExEcution().


    After detecting rejected stop and target orders, the NinjaTrader will close the whole position. At the same time, IB is trying to re-route these IDEALPRO-rejected orders to IDEAL.


    I am thinking to get the cumulative filled quantities in pre-determined time instead of submit stop and target orders immediately for each execution. Not sure if this is the solution.


    Any suggestions are welcome.

    #2
    Hi binwang2, please try this with orderHandling set to 'per Strategy Position' under Tools > Options > Strategies > NinjaScript > OrderHandling
    BertrandNinjaTrader Customer Service

    Comment


      #3
      I have read similar threads on this subject using "By strategy position".

      My impression is that "By strategy position" will still send out stop&target orders based for each partil filled quantity first. When the specified entry amount is fully executed, then the strategy will cancel previous orders and submit another order with quantity equal to all partial fills.

      Then NinjaTrader will still see rejected orders first from IB IDEALPRO before it send out replacment order with whole quantity. In this way, the trade will still be closed shortly after it is entered.

      let me know if this understanding is correct.

      Comment


        #4
        With 'by strategy position' NinjaTrader will send out one target and one stop order and modify the size as entry executions are reported.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Thanks for the clarification.

          So when an order has a partil fill first, 'by strategy position' will send out one stop and one target based on the inital partially filled quantity. Then replace this order when more fills come in.

          So when an inital partial fill quantity is less than IB's spec, the subsequent one stop/one target orders will be rejected. Then NinJaTrader will automatically close the whole position when seeing a rejected order, before it modifies the size to reflect the cumulative execution quantity.

          Then the issue with IB's IDEALPRO will be still there? Any comments are welcome.

          Comment


            #6
            I think you're correct binwang2 - I believe you can work around this by reissueing the rejected order to an instrument set up on the IDEAL FX exchange without the size limitation, I will clarify this and get back to you.
            BertrandNinjaTrader Customer Service

            Comment


              #7
              My idea would work binwang2, but we feel it's making things overcomplicated and you should work then with the normal IDEAL pair to circumvent this issue.
              BertrandNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by kulwinder73, Today, 10:31 AM
              1 response
              8 views
              0 likes
              Last Post NinjaTrader_Erick  
              Started by RookieTrader, Today, 09:37 AM
              3 responses
              15 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by terofs, Yesterday, 04:18 PM
              1 response
              24 views
              0 likes
              Last Post terofs
              by terofs
               
              Started by CommonWhale, Today, 09:55 AM
              1 response
              6 views
              0 likes
              Last Post NinjaTrader_Erick  
              Started by Gerik, Today, 09:40 AM
              2 responses
              8 views
              0 likes
              Last Post Gerik
              by Gerik
               
              Working...
              X