Importing Data from Interactive Brokers
Interactive Brokers is a brokerage which includes Trader Workstation (TWS) software for accessing account information and prices. TradingSolutions can interact with Trader Workstation to download intraday and end-of-day historical data over the Internet directly from Interactive Brokers. This allows you to keep all of the data in your portfolio up-to-date with the push of a few buttons.
TradingSolutions also supports importing real-time streaming intraday data over the Internet directly from Interactive Brokers. This allows you to get updated trading signals throughout the day while the market is open.
Ä Note: TradingSolutions cannot be used to issue or monitor trades on your Interactive Brokers account. TradingSolutions can only interact with Interactive Brokers to access historical and streaming data.
Configuring TradingSolutions to Use Interactive Brokers
Interactive Brokers is defined as a "data source" in TradingSolutions. Interactive Brokers requires you to open a trading account with them in order to use their Trader Workstation software and access data through it.
The Interactive Brokers Trader Workstation software must be open in order for TradingSolutions to access it. The software must be logged into your account in order to access data. It is not necessary to enter your Interactive Brokers username and password into TradingSolutions.
Configuring Trader Workstation to Work with TradingSolutions
Interactive Brokers Trader Workstation must be set up to allow external programs to interact with it.
1. In Trader Workstation, select Global Configuration… from the Configure menu.
2. Select the API page from the Configuration folder
3. Select Enable ActiveX and Socket Clients
4. Verify Socket port is set to 7496.
5. Press OK to exit the configuration window or perform steps 3 and 4 below.
Each time TradingSolutions begins communications with Trader Workstation, Trader Workstation will ask: Accept incoming connection attempt? Press the Yes button to allow TradingSolutions to access data through it.
To eliminate this step, you can specify requests coming from other programs on your computer as coming from a "Trusted IP Address".
1. In Trader Workstation, select Global Configuration… from the Configure menu.
2. Select the API page from the Configuration folder
3. Next to Trusted IP Addresses, press Create
4. Enter the number 127.0.0.1 and press OK. This IP address means the "local machine".
5. Press OK to exit the configuration window.
Ä Note: There is no way to differentiate TradingSolutions requests from requests from other programs. Therefore, be aware that specifying your computer as a "Trusted IP Address" could leave your brokerage account vulnerable to malicious software.
& For help signing up for and configuring data sources, see Configuring Data Sources.
Importing Data from Interactive Brokers
New data series can be imported from Interactive Brokers using the Import Data Wizard and selecting Download new data from the Internet. This will display the Select Data to Download page, where you can select Interactive Brokers as the data source.
Ä Note: These options will not be available if the Interactive Brokers data source has not yet been configured.
& For help importing historical data, see Importing Historical Data.
Existing data series can be updated from Interactive Brokers using the Import Data Wizard and selecting Update data in the target group. Individual data series are updated based on their currently selected data source. The data source for each data series can be viewed or modified from the Modify Data Series Dialog: Properties page. The data source for entire groups can be viewed or modified from the Modify Group Dialog: Properties page.
& For help updating data, see Updating Data.
Streaming Intraday Data from Interactive Brokers
To stream intraday data from Interactive Brokers, it is recommended that you first download historical data for the symbol(s) you are interested in the periodicity or periodicities you would like to stream. This allows you to create any signals or other calculations before beginning streaming.
Once you have downloaded historical intraday data, turning on streaming will automatically update any intraday data which has not had the streaming option turned off.
& For help with streaming updates, see Streaming Intraday Data.
Specifying Special Download Symbols for Interactive Brokers
The Interactive Brokers programming interface requires the asset type and exchange to be defined before any data is downloaded. This differs from other data sources which have only one set of data for each symbol. TradingSolutions will make a "best guess" as to what these values should be. However, they can be overridden by appending optional values to the symbol.
Symbols for Interactive Brokers in TradingSolutions can take any of the following forms:
· Symbol
· Symbol-Exchange
· Symbol-Exchange-Type
· Symbol- -Type
If exchange is not specified, the following defaults are used:
· Futures: GLOBEX
· FOREX: IDEALPRO
· Indices: AMEX
· Otherwise: SMART
The following values are available for type:
· STK Stocks
· IND Indices
· FUT Futures Contracts
· CASH FOREX Spot
· OPT Options
· FOP Futures Options
Ä Note: It should only be necessary to specify type when overriding the default type selected for a symbol.
Special Considerations with Interactive Brokers
Interactive Brokers streaming data support requires your computer’s clock to be periodically synchronized with a time server. In Windows XP, this default setting can be verified from the Control Panel, Date and Time, on the Internet Time tab. For previous Windows versions, external software can be downloaded to perform this synchronization.
Historical End-of-Day FOREX Data from Interactive Brokers includes data from 5pm of the date through 5pm of the next day. This can cause problems when mixing end-of-day data and intraday data since TradingSolutions expects end-of-day data to start from midnight. Specifically, intraday data using at historical FOREX end-of-day data from Interactive Brokers will be using future values. To work around this, always lag the end-of-day data by one bar to ensure you are using the most recent past values.
Historical Hourly Bars from Interactive Brokers are aligned to hours, regardless of when the exchange opens. For non-FOREX data, this can cause discrepancies between streaming and historical data.
Ä Note: This issue can also effect smaller periodicities for exchanges which do not open on the hour or half hour.
Interactive Brokers restricts the speed at which historical data can be downloaded. Specifically, only a few days of data can be requested every 10 seconds. Because of this, downloads and gaps in streaming data can take significantly longer than other data sources.
Interactive Brokers may have one year or less data available. Because of this, Interactive Brokers may not be a practical data source for end-of-day data.