Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

IBKR Adaptive(IBALGO) orders

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

    IBKR Adaptive(IBALGO) orders

    Is there a way to change the default order type to IBAlgo? Or set a number of shares per order when making a close position order? I lost out on a pretty large amount of profit today due to the inability to exit the position. I ended up having to close the position from the webapp.

    From what I can tell, the issue is that you can only make an order of ~15000 shares without using the IBALGO and when I went to close the position I had ~32000 shares.

    #2
    Hello RaddiFX,

    Thank you for your inquiry.

    Unfortunately, these no way to achieve this in NinjaTrader directly but you may be able to set this limitation with your broker!

    Please let us know if we may assist you any further.

    Comment


      #3
      I spoke to their support, and they informed me that there is no way to "force" all orders through the API to go to a certain protocol, that is something that is specified in the API call itself. Is there any way for me to make a high priority feature request for Adaptive IBALGO to be added as an order protocol?

      Or for me to be able to create a "Scale out" setting for flatten, or close position orders?

      Honestly that would be the easiest. If I could just set the flatten and close position orders to break up into multiple 1000 share market orders.

      Comment


        #4
        Hello RaddiFx,

        Thanks for your response.

        I can certainly ask for that feature with our Development team!

        As with all feature requests, interest is tracked before implementation is considered, so we cannot offer an ETA or promise of fulfillment. If implemented, it will be noted in the Release Notes page of the Help Guide.

        Release Notes — https://ninjatrader.com/support/help...ease_notes.htm

        Please let us know if we may be of further assistance to you.

        Comment


          #5
          Since there doesn't seem to be a good solution here. What would be the best way for me to calculate the total position (Filled + unfilled) for a strategy so that I can limit the maximum number of total shares to 23000 before placing the order?

          Comment


            #6
            I created a method in my code to set my order size to a max of 23499

            Code:
                        // Get the current quantity of shares owned
                        int ownedShares = Position.Quantity;
                        
                        // Get the total quantity of unfilled orders
                        int unfilledQuantity = GetUnfilledQuantity();
                        
                        int totalShares = ownedShares + unfilledQuantity;
                        
                        if (totalShares + orderSize >= maxShares)
                            orderSize = Math.Max(maxShares - totalShares, 0);​
            
                    #region Unfilled Quantity
                    private int GetUnfilledQuantity()
                    {
                        int unfilledQuantity = 0;
                
                        // Iterate through active orders and sum the unfilled quantities
                        foreach (Order order in Orders)
                        {
                            if (order.OrderState == OrderState.Working || order.OrderState == OrderState.Accepted)
                            {
                                unfilledQuantity += order.Quantity - order.Filled;
                            }
                        }
                
                        return unfilledQuantity;
                    }
                    #endregion​

            Comment


              #7
              Hello RaddiFX,

              Thank you for your response.

              I'd advise that you post this additional question regarding development to the Strategy Development section. Unfortunately, I personally do not have coding knowledge but our NinjaScript team or another forum member can help.

              Please let me know if I may assist you any further.

              Comment


                #8
                Zach, I already implemented a temporary band aid for the 23500 limit issue, however I'd really like to express my desire for the ability to set the type of protocol used on the API so that I can work with more than 23000 shares.

                The response from IBKR states that they have no ability to resolve this, that it's all controlled with the API call made by ninjatrader.

                Thank you for reaching out on the matter.

                Unfortunately these order attributes would be determined by the parameters included within the request from NinjaTrader to Interactive Brokers via the API. For such an algorithmic order to be placed via the API, the correct parameters would have to be generated by NinjaTrader for such a request.

                Unfortunately we do not have access to NinjaTrader's backend to make such adjustments to these requests, so it would be recommended to reach out to NinjaTrader to see if they have added the capability to send IBALGO orders via the integration they have created around our API.

                Comment


                  #9
                  Hello RaddiFX,

                  Thanks for your response.

                  I will forward your feedback ahead to our Development team.

                  Please let us know if we may assist with any other items.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by NullPointStrategies, Today, 05:17 AM
                  0 responses
                  41 views
                  0 likes
                  Last Post NullPointStrategies  
                  Started by argusthome, 03-08-2026, 10:06 AM
                  0 responses
                  124 views
                  0 likes
                  Last Post argusthome  
                  Started by NabilKhattabi, 03-06-2026, 11:18 AM
                  0 responses
                  64 views
                  0 likes
                  Last Post NabilKhattabi  
                  Started by Deep42, 03-06-2026, 12:28 AM
                  0 responses
                  41 views
                  0 likes
                  Last Post Deep42
                  by Deep42
                   
                  Started by TheRealMorford, 03-05-2026, 06:15 PM
                  0 responses
                  46 views
                  0 likes
                  Last Post TheRealMorford  
                  Working...
                  X