Duration: 5:19
Level: Advanced

This is lesson 2 of 2 on the TWS BasketTrader. This lesson focuses on creating and uploading a basket file. BasketTrader is accessible through Classic and Mosaic and is used to manage groups of orders.

Study Notes:

In this lesson, investors will create a basket on a spreadsheet, upload it to the BasketTrader, and execute the orders. The video will also go through how to export a basket onto a spreadsheet, modify the orders, load back into the BasketTrader and execute the orders.

An investor can create a basket file in excel from scratch using the correct headers found in the TWS user guide in the Basket Field section under BasketTrader or create a template by manually creating a basket file in TWS and exporting it. In the basket file template, the investor can use examples of the instruments they plan on trading to have the correct headers populate.

First, we’ll go over how to export a basket file from BasketTrader and use it as a template. We’ve pre-populated the BasketTrader with a stock, option, future, and forex position. Click the file in the upper left-hand corner and click “Save Basket.” Choose the directory and name the file. We can call this one Basket Template. A confirmation box will appear telling you the file has been saved.

Now, go into Excel and open the file we just saved. It’s important to note that search criteria can change from Excel to all files since the original template was saved as a .CSV. Once the file is opened, are the appropriate headers will be at the top of each column with some rows being populated for certain instruments and empty for others when they don’t apply, for example the Strike column is blank for everything but options. It is important to note that the order of the columns do not matter when creating a spreadsheet. If the correct headers are entered, then BasketTrader will accept the spreadsheet and create a basket from it.

The investor can now use the instruments entered in the spreadsheet as a template for any orders they would like to create.

First, save the template under a different name, lets choose BasketTrades1. It is important to note that the file should be saved as a .CSV, not an Excel file.

Now enter a stock trade. Looking at the template and using the existing stock trade as a guide for which columns need to be filled in. Action, Quantity, Symbol, Security Type (SecType), Exchange, Currency, Time in Force, Order Type, Limit Price, Basket Tag, Account, Order Reference (OrderRef), and whether or not we want it to trade outside regular trading hours (OutsideRth).

Next enter an option trade and fill in the columns for: Action, Quantity, Symbol, Security Type (SecType), Exchange, Currency, Time in Force, Order Type, Limit Price, Basket Tag, Account, Order Reference (OrderRef), Last Trading Day Or Contract Month, Strike, and Right.

Finally add a Futures trade and fill in the columns for: Action, Quantity, Symbol, Security Type (SecType), Exchange, Currency, Time in Force, Order Type, Select market order so we don’t have to populate Limit Price, Basket Tag, Account, Order Reference (OrderRef), Last Trading Day Or Contract Month, DivPrt, and Multiplier.

When satisfied with the orders entered delete the lines from the template and save the spreadsheet.

Next go back into BasketTrader and upload the file. Click on the plus sign to open a new BasketTrader window. In the top left-hand corner click on Browse and look for the spreadsheet file.

Select the file and click Open in the lower right-hand corner of the pop-up box. The Round Order Sizes configuration box appears, make the appropriate selection.  The investor can choose to click on the white square next to “remember your settings” if they prefer and the box will no longer appear. When ready, click OK to load the basket. An information box will appear asking you to select whether this is or is not a Program Index Arbitrage Trade, pick the appropriate answer and click ok. The basket is now loaded and ready to be sent.

Once the orders have populated the Order tab they can be adjusted. When the investor is ready to send the orders click Transmit and they will be sent to the appropriate exchanges.

BasketTrader allows investors to adjust the multiplier as well to be applied to the file uploaded.  Open up another tab, change the multiplier from 1 to 2, click load and click on the BasketTrades1 file and the pop-up boxes and it is now showing double the total quantity for each order.

BasketTrader is a versatile tool that enables the investor to submit multiple trades at once either by creating the basket in TWS or outside of TWS and uploading it.

BasketTrader User Guide


Join the Discussion

Thank you for engaging with IBKR Campus. If you have a general question, it may already be covered in our FAQs. If you have an account-specific question or concern, please reach out to Client Services.

Your email address will not be published. Required fields are marked *

Disclosure: Interactive Brokers

The analysis in this material is provided for information only and is not and should not be construed as an offer to sell or the solicitation of an offer to buy any security. To the extent that this material discusses general market activity, industry or sector trends or other broad-based economic or political conditions, it should not be construed as research or investment advice. To the extent that it includes references to specific securities, commodities, currencies, or other instruments, those references do not constitute a recommendation by IBKR to buy, sell or hold such investments. This material does not and is not intended to take into account the particular financial conditions, investment objectives or requirements of individual customers. Before acting on this material, you should consider whether it is suitable for your particular circumstances and, as necessary, seek professional advice.

The views and opinions expressed herein are those of the author and do not necessarily reflect the views of Interactive Brokers, its affiliates, or its employees.