Sierra Chart - Interactive Brokers Trading Service

Interactive Brokers Trading Service

  • Introduction
  • What is Included
  • Setup Instructions
  • IB Symbol Formats and Common Symbols
  • Automatically Logging Into TWS
  • Running Multiple TWS Instances
  • Using IB with Another Data/Trade Service
  • Market Depth
  • About IB

  • Introduction

    Sierra Chart works with the Interactive Brokers (IB) trading service. This service provides the Sierra Chart software with historical daily and historical intraday data, streaming real-time data, and trading services for all types of markets around the world. The Sierra Chart trading interface fully supports trading with IB. A trading account is required with IB to access their data. However, their data is low-cost or free and real-time. They provide data from all types of markets from around the world. To use IB with Sierra Chart follow the Setup Instructions below.

    Notice: The Interactive Brokers historical data platform is not the most solid. Historical data access can be problematic at times. We ask that you do not judge Sierra Chart based upon this trading platform if you are a new user of Sierra Chart. There is a user adjustable delay between historical data requests to minimize what is known as Pacing Violations from IB (Global Settings >> Data/Trade Service Settings >> More Interactive Brokers Settings). It is important to understand this and make adjustments to this setting to avoid missing historical data. You also need to be aware that this slows the speed at which historical data can be downloaded. When evaluating the charting performance of Sierra Chart both historically and in real-time you may want to use the Sierra Chart Real Time and Historical Forex Data Feed. Additionally, based on feedback when using the Sierra Chart trading functionality with IB, the IB trading API is not always completely stable and may sometimes give you an odd problem. The Sierra Chart trading functionality is stable though.

    Amount of Historical Data Available: IB provides 1 year of historical daily and intraday data. Sierra Chart will always download the full 1 year of historical daily data for historical charts. For intraday charts, it is not very practical to download 1 year of historical intraday data. The download will likely fail and it will take a very long time. Downloading 30 days is more practical. The instructions below explain how to specify the number of days to download.


    What is Included

    Setup Instructions

    If you are having a problem connecting to the IB data feed, then be sure to follow step number 3 below.

    1. To use the IB trading service, you need an account with them. Go to the Interactive Brokers website and open an account with them if you do not already have one.
    2. Run the IB Trader Workstation (TWS) software. It is highly recommended that you use the stand alone TWS software. Not the browser based TWS.
    3. Select Configure >> Global Configuration on the IB TWS software menu. Go to API and make sure Enable ActiveX and Socket Clients is checked. Also make sure the port is 7496 and that a Trusted IP Address is set to 127.0.0.1. If it is not, then press the Create button and enter 127.0.0.1.

      step3
      View Image
    4. Go to Sierra Chart. Select Global Settings >> Data/Trade Service Settings on the menu. Click on the Service list box arrow. Select Interative Brokers from the list. If you do not see the service in the list box, then please refer to this help topic. Click on the Server list box arrow in the Connection Details frame. Select the localhost:7496 server name from the list. If the TWS software is running on a computer different than Sierra Chart, then the Server can be set to the IP address where TWS is running.

      step4a
      View Image


      Enable the Connect On Program Startup option. Enable the Reconnect On Failure option. Optionally enter your IB username and password in the Username and Password boxes. This enables Sierra Chart to log you into the standalone TWS automatically at the TWS New Login window. See the Automatically Logging Into TWS section below.

      If you want to have Sierra Chart download the historical intraday data from IB, then enable the Download Intraday Data Backfill option and specify the number of historical intraday Days to download. If you have any trouble with receiving historical data, then please refer to help topic 37.

      If this option is checked, then the program will request historical intraday backfill data from IB. For the backfill to work correctly, your computer's date and time need to be set correctly. The last date and time in the chart also needs to be correct for that bar. Otherwise some or all of the data received from IB may be filtered out.

      Multiple Concurrent Connections to TWS: If you want to have multiple copies of Sierra Chart connected to IB TWS, then each copy of Sierra Chart needs to be set to a different Instance ID number, set with the Instance setting in the Connection Details frame.

      Accessing All Trade Orders from TWS: If you want to have access to all trade orders from TWS as well as orders entered from Sierra Chart, then you will need to set the Instance setting to Client ID: 0.

    5. All data is time stamped to UTC (GMT) time. In the Time Zone list box, select the appropriate time zone to display all times in. For complete information, please see the Time Zone Setting documentation page.
    6. Set the Intraday Data Storage Time Unit to what you require. If you are using Tick, Volume, or Range Charts, then set this to 2 Seconds or less.
    7. Press the More Interactive Brokers Settings button. Uncheck the Use IB Managed OCO and Bracket Orders option if you wish to have Sierra Chart provide the OCO and bracket order functionality rather than relying upon what IB provides. Based on user feedback IB OCO and bracket functionality does not always function correctly. However, for the ultimate safety, you should check this option and rely on the IB functionality because if you lose connectivity to IB, then Sierra Chart cannot properly manage Bracket and OCO orders. Press OK.


    8. step4b
      View Image


    9. Click OK to close the Data/Trade Service Settings window.
    10. Make sure TWS is running. To connect to the data and trading server, select File >> Connect to Data Feed on the menu.
    11. If the Message Log window opens and displays messages indicating there was an error connecting to TWS, then select File >> Disconnect to prevent further connection attempts. Next, carefully review the setup steps above again. Try connecting to the data and trading server again by selecting File >> Connect to Data Feed on the menu. If there still is an error connecting and one of the messages says: Failed to connect to the data and trade server. Winsock error: (10061) No connection could be made because the target machine actively refused it., then:
      1. Restart TWS (IB Trader Workstation) and make certain TWS is running.
      2. Carefully review the setup steps above again to be certain all of your settings are correct.
      3. Disable any firewall software you are running. The Windows firewall can be kept enabled, but you may want to try disabling it as well or make sure it is not blocking TWS or the specified Socket Port.
      4. Try using a different socket port. To change the socket port, select Global Settings >> Data/Trade Service Settings. In the Server box enter localhost:7497 (you can use any number). In TWS, select Configure >> API >> Socket Port and enter 7497 (use the same number you use in Sierra Chart). Try connecting to the data and trade server again by selecting File >> Connect to Data Feed.
    12. If there still is an error connecting, then please review help topic 1.5.
    13. Please read the IB Symbol Formats and Common Symbols page for instructions to properly enter symbols when using Interactive Brokers.

      The below images show how to open an intraday chart using a correct symbol:

      step6a
      View Image


      step6b
      View Image
    14. Symbol Limits: IB may limit the number of symbols you can receive data on at the same time. This limit may be increased based on your trading volume. If you try to get charts or quote lines for more than the allowed symbols, then those charts or quotes will not update. You can tell how many symbols Sierra Chart is currently tracking by looking at the number after "ST=" in the right most status box below the Sierra Chart menu. Once you exceed the limit you need to do two things to get updates on the symbols that go over the limit. You will need to reduce the number of charts and quote lines you have open to the allowed number of symbols or less and then reconnect to the data feed by selecting File >> Disconnect on the menu and File >> Connect to Data Feed on the menu.
    15. Continue with step number 2 on the Getting Started documentation page.

    Automatically Logging Into TWS

    When the IB Trader Workstation software is started and the TWS New Login window is displayed, Sierra Chart will enter your TWS username and password into the TWS New Login window and automatically log you in when you connect to the data feed in Sierra Chart or it is waiting to reconnect. In order to take advantage of this feature, you need to enter your IB username and password into Sierra Chart and enable the Reconnect on Failure option following the setup instructions above.

    1. To automatically login to TWS, go to Sierra Chart, select File >> Connect to Data Feed on the menu.
    2. Start the IB TWS software. The IB TWS Login window will display. What we have found in the newer versions of this login window is that you may need to click in the Username box to give it the focus in order for the automatic login process to work properly. The automatic login will occur within a few seconds.
    3. You can also start TWS first, and then connect to the data feed in Sierra Chart. If Sierra Chart is waiting to reconnect to the data feed ("Waiting to reconnect" is shown in the rightmost status window below the Sierra Chart menu), it will also log you into TWS. Keep in mind that when Sierra Chart is waiting to reconnect, the login may not occur right away.
    AutomaticallyLogging1
    View Image


    AutomaticallyLogging1
    View Image

    Running Multiple TWS Instances

    It is possible to use multiple TWS instances and have multiple copies of Sierra Chart using those instances. For example, you can have two instances of TWS running and have two copies of Sierra Chart also running where one is connected to one instance and the other one to the other instance.

    The way this is accomplished is by using different port numbers for each TWS instance. Select Configure >> Global Configuration on the IB TWS software menu. Go to API and make sure the port is different for each TWS instance. You need to use the same port number in the Sierra Chart copy that will be connected to that instance. To set the port number in Sierra Chart select Global Settings >> Data/Trade Service Settings. In the Server box change the number after the colon ":". This is the port number.

    Using IB with Another Data/Trade Service

    You can use IB with another data/trade service to access data IB does not supply. To do so, follow the directions on the Using Multiple Services and Trading Accounts at the Same Time page.

    Market Depth

    There are several features in Sierra Chart which require market depth data. These include Trade >>Show DOM Depth. Trade >> Draw DOM Graph On Chart. When using these, the market depth option may be automatically enabled. However, select Chart >> Chart Settings and make certain Start Market Depth Updates is enabled for the chart. If you have multiple charts for the same symbol, then the option is common among all of these charts and only needs to be enabled on one of them for it to be enabled on all. Keep in mind you can only receive market depth for up to 3 symbols from IB at a time, this is an IB limitation. If you exceed this limitation, you will not get market depth on the additional symbols. So make certain that the Start Market Depth Updates option is enabled only on 3 or less symbols. If it was enabled on more symbols, then you need to select File >> Disconnect and then File >> Connect to Data Feed.

    About IB

    Interactive Brokers, a global electronic brokerage firm, provides professional traders, financial advisors, brokers and institutions low cost execution and clearing services for stocks, options, futures, forex, and bonds. For Interactive Broker's current commissions and information, please visit the IB Commissions page. The IB Universal Account allows customers to trade stocks, options, futures, forex, and bonds on over 50 market centers in 14 countries from a single account.


    *Last modified Wednesday, 08th September, 2010.