Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Basket order for Interactive Brokers

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

    Basket order for Interactive Brokers

    Is it possible to send a basket order to IB from NT strategy. IE: buy these 'x' stocks at market, all from one order send?

    #2
    Hi vjsworld,

    Thanks for your post.

    This would not be possible. NinjaTrader submits individual orders on a per instrument basis.

    However, your strategy can use multiple instruments and submit the individual orders at once for these instruments.

    Please take a look at the SampleMultiInstrument script that is included with NinjaTrader to see how this could be done.
    Last edited by NinjaTrader_ChelseaB; 08-19-2013, 08:03 AM.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      If I wanted to do this, would I have to use an IOrder per instrument added (currently using unmanaged orders)? Is there anyway to use one IOrder for multiple instruments to throw them at once (or nearly at once with a loop)? Then filter the onExecution events by BarsInProgress?

      Comment


        #4
        Hello vjsworld,

        The IOrder is used to manage the order after it has been submitted. It is not required to use an IOrder handle to submit orders. With the unmanaged method you can use SubmitOrder() without an IOrder handle. However, it may be difficult to later manage the order.

        With SubmitOrder() you could submit orders by looping over the BarsArray.length.

        For example:
        Code:
        for (var i=0; i<=BarsArray.length; i++)
        {
        SubmitOrder([B]i[/B], OrderAction.Buy, OrderType.Market, 1, 0, 0, "", "Enter Long");
        }
        This would submit one order for each added data series.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Thanks again Chelsea!

          That worked. I had it like this (almost!), but for some reason I was checking for my IOrder to be null before I sent it... Took that line away and they fire way fast now.

          Comment


            #6
            Originally posted by vjsworld View Post
            Is it possible to send a basket order to IB from NT strategy. IE: buy these 'x' stocks at market, all from one order send?
            Here's a free tool for creating basket files from the IB market scanner. May It can help coding Your ninjascript.
            https://bas****rderbuilder.wordpress.com/
            Step 1. Create Your Market Scanner Buying or Selling rules. Eg. stock over 200 days Moving Average and oversold based on the MACD indicator. There are a lot of field and filters You can add to the scanner. You can create complex strategies with different rules and update them daily, weekly or monhly. Eg: every…

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by rocketman7, Today, 02:12 AM
            5 responses
            22 views
            0 likes
            Last Post rocketman7  
            Started by trilliantrader, 04-18-2024, 08:16 AM
            7 responses
            28 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Started by samish18, 04-17-2024, 08:57 AM
            17 responses
            66 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Started by briansaul, Today, 05:31 AM
            1 response
            15 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by PaulMohn, Today, 03:49 AM
            1 response
            12 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Working...
            X