Brokerage APIs


Manual
18 min read

Introduction

Data connections via broker APIs are an incredible resource, and work great 99% of the time, but issues do arise. This document will provide an understanding of what they do, why we use them and how to correct issues when they happen.


Table Of Contents


Why Broker APIs?

Stock, options and futures data is VERY expensive. Most people take it for granted and they believe it is free. Brokerage firms spend tens of millions of dollars for it each year and data is tightly regulated. You might not realize this, but when you open a brokerage account you are consenting to the exchange agreements and you are required to disclose very confidential information. During that process you could be classified as a professional trader and your data fees could increase exponentially compared to retail traders. These agreements are constantly updated.

If we offered consolidated data from all of the exchanges we would have to charge $20 per month (or more) for retail traders and upwards of $100 per month for professional traders. Rightfully, no one wants to pay those fees. Furthermore, we don’t want to collect your personal information. You already have those agreements in place and you are already paying for that data. We take advantage of that existing relationship by using Broker APIs. As an alternative, we also offer a free data feed. Let’s cover that first.


Free Real-time Data

OneOption, LLC offers a free real-time data feed provided by Intrinio. This is not a consolidated tape and instead includes IEX and BATS exchange data which account for approximately 8% of overall volume. For swing traders, this is excellent data. The real-time updates accurately reflect the current price. Being a portion of the total transactions however, volume is a fraction of what is actually traded.

All of our searches and indicators come from our servers and are unaffected by which data feed you choose. Using Option Stalker Pro with Intrinio is a full-feature experience excluding Trade Entry: We do not offer trading through the free data feed because it is not connected to a brokerage account.

To trade with Option Stalker Pro, ensure that you have consolidated real-time data through your broker and it is correctly connected to OSP. If you are having problems with a Broker API connection, try to connect to Intrinio. If this functions properly, the issue is with the Broker API and until resolved the Intrinio feed will serve as a temporary solution.


Intrinio Details

If any of the broker APIs go down, Intrinio is your backup. It is the data source for Option Stalker and can be used for Option Stalker Pro. It reflects BATS + IEX exchange data for prior to 15 minutes ago. The last 15 minutes is IEX realtime which is a limited 2% of total market share. It is pretty spot on as far as the bid and ask because the market makers are bidding with the other exchanges through auto quote. However, they are not there for size. The Last can be a little off because the exchange sees less volume, but it updates fairly well. The volume will not be close to the consolidated tape. I view this solution as excellent for active traders who check the market a few times a day and for swing traders. Looking at an M5 chart is really the only place where you will notice a difference. Even then it is not bad. If you need “readers” when you look at a menu, you can get most of the information you need, but it is hard to see the smaller print. That is how I view the Intrinio solution for active day traders. The searches and indicators come from our servers so there is not difference there.


API Overview

For full consolidated tape, OneOption offers connections to three Brokerage APIs: Tradier Brokerage, Interactive Brokers and Charles Schwab (coming soon!). Not all brokerage firms offer an API and these three firm offer deep discounted commissions. Each has its own advantages and disadvantages and we suggest you read learn about all of them.

Why do we offer the Broker APIs? Brokerage firms have consolidated real-time market data from all of the exchanges. You’ve already completed the exchange agreements when you opened an account and you are already paying for the data so let’s take advantage of that. The Broker APIs also allow you to trade through Option Stalker Pro. Let’s cover some basics and then look at each API separately.

What is an API?

The Broker API opens up a private connection to your brokerage firm. When Option Stalker Pro (OSP) is launched from your computer, enter your OneOption/OSP credentials and select the data feed you would like to use. Click Submit. Once we have verified your subscription, OSP will try to connect to your brokerage account. In the case of Tradier Brokerage and Charles Schwab (soon!), a popup will appear. That is where you enter your brokerage log in. The Interactive Brokers API requires you to have their platform (Traders Work Station or TWS) to be running and there are API settings that need to be configured beforehand (more about this in the section below). Once the “handshake” is completed, the data will start to stream.

For more information about how to connect your Brokerage API, please visit Installation & Setup in the Option Stalker Pro Manual.

The API does not give OneOption the ability to see your account or to remove funds from the account. This is a private connection, only accessible you you on your computer, and the API acts as a conduit. It simply pulls data that is available from your broker to your personal computer. If the data is slow or delayed, it is not a function of Option Stalker Pro. The issue is with your broker and Broker API.

Alongside the brokerage connection, OSP establishes a private connection to OneOption’s servers in order to provide Scanner search results and Indicators. OSP processes the data from both sources. With very few exceptions, these APIs work incredibly well, allow us to take advantage of data plans already available to you. Unfortunately, Brokerages place these APIs at lower priority than connections to their own trading software (e.g. TradeHawk, thinkorswim and Trader Workstation). Issues do occur. Let’s review each Broker API and then troubleshoot some common problems.


Tradier Brokerage

Tradier Brokerage (https://tradier.com/) is our preferred solution for many reasons. First of all, their business was built around their API. When they started their business, Tradier did not have its own platform and all connections to the API had the highest priority. Thus, the Tradeir Broker API is robust and reliable. In contrast, Charles Schwab and Interactive Brokers restrict data consumption to their APIs (more about that below). Tradier does not. This is why we recommend Tradier to our members.

Opening An Account

Tradier will often open your account within 24 hours and if you mention OneOption as the referral source they will turn the data on as soon as the account is opened. Your account needs to be funded after 30 days or they will turn the data off. This is a fantastic way to try Option Stalker Pro with real-time streaming consolidated data without immediately moving funds. For customer support, it has also been our experience that the Tradier trade desk is easy to reach. They also offer a $10/month flat-fee commission rate that includes data and unlimited stock and options trades (they do pass through exchange fees which are negligible: Tradier Commissions). Tradier is licensed in many countries and that list is growing. They also offer paper trading and you can view/trade other accounts that share that same log in. At this time, they do not offer futures trading.


Schwab (Coming soon!)

The big advantage of using Schwab as your broker is their platform thinkorswim (TOS). It is one of the better charting platforms on the market with a large user base. Unfortunately, they were late to the API game. Tradier and Interactive Brokers have been offering their APIs for many years. Schwab released their API much later and it seems in many ways to be a work in progress. After the takeover, I believe the API went to the back-burner with development focused on the merger. It is uncertain whether Schwab will continue to support it, but I suspect they will. We are waiting for them to finish building it.

Setup & Usage

Before Schwab will enable your data, you need to fund your account. If the account has less than $500 in it, you will only have access to delayed data. The account log-in with Schwab has to be for a single account and it is through a web based popup window that appears during Option Stalker Pro sign in. This API requires no further configuration. If more than one account is associated with the same log in, you have to ask them to separate the account logins. Charles Schwab only allows two concurrent connections. If you have TOS running and Option Stalker Pro (OSP), that is fine. However, if you forget to close the mobile app or a web connection elsewhere, the API will not work. Unfortunately, there is no error message from TDA asking if you want to close one of the other connections. While they do offer paper trading accounts, they do not offer an API connection to it.

Overall, this API works well, and while we have had issues with the TDA in the past, we have been able to resolve them all. The greater concern is that the API team did not respond to multiple help requests over a period of months regarding these issues. Also, TOS is a “heavy” application from a processing standpoint and that could slow your computer down. Their commissions are a bit on the high side, but when you consider the advantages of using TOS, they can be justified. TDA is also licensed in many countries and they offer futures trading.


Interactive Brokers

Interactive Brokers (IBKR) was the first to offer a data API. In fact, their success forced other brokers to offer one. Their trading platform, Trader Work Station (TWS), can be used to trade almost any product in the world: IBKR is licensed in almost every country including Canada, where most firms do not register. Their commissions are reasonable, but they do charge for data, which by default is disabled until the account is fully opened and funds have “cleared”. This can take time so give yourself more than a week to get started.

Selecting Your Data Plan

Once your account is funded, select a data plan to access realtime data. Navigate to “Market Data Subscriptions” where you can subscribe for the US Equity and Options Add-On Streaming Bundle and US Securities Snapshot and Futures Value Bundle. That includes all of the US stock and options exchanges. Most of the data fees are waived for non-professional traders once certain commission thresholds are reached each month.

Interactive Brokers API Setup

The IBKR data connection is established in conjunction with their platforms Trader Workstation (TWS) and IB Gateway (IBG). TWS is a full-feature trading platform. IBG is a lean application that provides the data connection and nothing more. Both must run in the background before you can open Option Stalker Pro. Make sure to keep TWS or IBG up-to-date.

To work correctly, configure the TWS and IBG API settings.

  1. Navigate to Settings > API Settings > API
  2. Select “Enable ActiveX and Socket Clients”
  3. Deselect “Read-Only API”
  4. Enter 7496 in “Socket Port”. (If you have another trading software program connected to the IBKR API you need to use the next sequential port number for Option Stalker Pro (7497))
  5. Deselect “Send market data in lots for US stocks for dual-mode API clients”
Check “Enable Active X and Socket Clients”, uncheck “Read-Only API”, Set Socket port to “7496”, uncheck “Send market data in lots…”
TWS/IBG Time Zone Setup

In the TWS and IBG login page, click “More Options” to adjust the time zone. Usually, this works when the TWS/IBG time zone matches your operating system. That said, many non-US customers have to select US Eastern Time for this setting and set the time on their computers to US Eastern time. If your charts are not showing an entire day of price, this is the issue. The time between your computer and TWS is not in sync. You might think that changing one of the settings will fix this, but it does not. You need to change both to US Eastern time. This is not documented anywhere and it took us months to figure this out. Fortunately, the API only needs to be configured once.

User Limits

Interactive Brokers restricts market data to a single session per user. This can cause conflicts when using TWS for Option Stalker Pro (OSP) and the IBKR mobile or web platform simultaneously. To bypass this, you can create a second user on your IBKR account that shares the same market data subscriptions. This way, OSP can run on one session, while the main user accesses IBKR through TWS or other platforms without disconnections.

  1. Log into the IBKR Client Portal.
  2. Go to Settings > Users & Access Rights.
  3. Click the + button and create a new user ( we haven’t really experimented with what rights we need for OSP to work, right now my user just has almost full access), and follow the prompts to create.
  4. Wait until the user is confirmed (this can take about a week, and you won’t be notified, you’ll need to try and login with it until you are successful)
  5. Once it is approved, login to the client portal and assign the same Market Data Subscriptions you have on your main user.
  6. Launch TWS / IB Gateway, login with the new user, and change the settings again as per API setup instructions above.
  7. Launch OSP.


This allows seamless multi-device access without session conflicts.

Data Limits

IBKR limits data consumption via their API to 100 symbols. That means you should only have a few indices streaming realtime data on TWS to maximize use of OSP. Eliminate all of the other symbols on TWS or you will hit those limits when you run Custom Searches or Scanners on OSP. Our searches are designed to max out at 70 results to avoid this issue. Also create watchlists in OSP with under 70 symbols. If you click Trade in Option Stalker Pro to view real-time option chains, nothing will automatically appear. In the middle of the chain where the strike prices are listed you will see a yellow highlighted area. Move that to the strike prices you want to view and click it. The data for those options will start to stream. This was another creative solution we came up with to avoid hitting those symbol limits. Speaking of options chains, they remove the last after the close so you can’t see that options data – very frustrating. Fortunately, you can use the Option Pricing feature in Option Stalker Pro to get those values an hour after the close. IBKR does not offer an API connection for paper trading and if more than one account is associated with a login, you have to ask them to separate the accounts. This might result in additional data fees. Interactive Brokers does offer futures trading. Since TWS has to be running to use the API, it provides an added strain on your processor. It is a “heavy” program and you might not even be using it. The web connections provided by Schwab and Tradier are better solution for the API connection. Given the limitations above, once you learn the nuances you will be able to use this API very effectively. Start TWS and then start Option Stalker Pro. The two will connect automatically. Use this document as a resource and you will be in good shape.


Common Issues

Almost every other issue can be attributed to a slow internet connection, a “busy signal” during the broker connection or a slow computer.

“My charts are slow”

Option Stalker Pro charts should load in less than a second. If not, this could be your internet. “My internet is fine.” That might seem true, but we are pulling in hundreds of tiny packets of data and if some are missing, we will have a problem. The largest internet service providers (ISPs) have temporary disruptions. Check your internet speed online. The best practice is to connect directly to the internet cable modem using an Ethernet cable. There could be an issue or latency if you use a Wifi router. We also suggest checking other users in your household. Gamers and streaming video watchers are going to compete for your broadband width. Slow charts could also be an issue with the processing speed of your computer. You might need to upgrade to a faster computer. First try to close other applications. As mentioned earlier, TOS and TWS are heavy compared to Option Stalker Pro. OSP calculates all of the indicator values when a chart is requested. The more indicators you are using, the longer it will take to calculate and display those values. 99.9% of the time this is not an issue, but if it is, you might need a new computer.

“My charts are freezing”

We have resolved this issue as far as I am concerned. We are ramming data requests through the API as fast as we can. If you are running an older version of Option Stalker Pro, we suggest removing it and doing a fresh install. You can do that by going to your C:/ drive. Look for the directory /1Option Trading Platform in /Program Files and execute the uninstaller: uninst. When prompted, save user files. Then go to the Dashboard on the website and re-download Option Stalker Pro. By the way, this solves most issues.

“TOS is running fine, but OSP is slow”

This is rare. Realize that the Charles Schwab API is on a lower priority than TOS.

“Why is my data delayed?”

Option Stalker Pro pulls what is there. If you are with IBKR, you need to select a data plan. If you are with Charles Schwab or Tradier, you might need to add funds to the account.

“Failed To Initialize API”

This error message is usually nothing. TRY AGAIN IMMEDIATELY. It could have been a temporary internet disruption on your end right when the connection was attempted or the broker API could have been busy. Try to connect well before the open and always close Option Stalker Pro overnight. Make sure you are always running the latest version of OSP. You can update it in the Dashboard on the OneOption website.

“Failed to make html connection”

This is a Charles Schwab error message. You have too many connections open. Close the web connection or the mobile app.

“Will you provide other broker APIs?”

We don’t plan to. The broker choices we offer are excellent and supporting these APIs keeps us plenty busy.

“How do I know the API connection is not an OSP problem?”

If you are not able to connect to a broker API, select Intrinio as the data feed in the Option Stalker Pro log-in pop-up. That is the free data feed I mentioned earlier. If you can connect to it, you are connected to our servers and it is a broker API issue. Use this connection as a back-up.

Troubleshooting

Once you’ve entered your Option Stalker Pro log in information and clicked Sign In, it will try to connect to the broker API you’ve selected. During that time you might receive a “Failed To Initialize API” pop-up message. If you have never logged into the API, please read the API document carefully. There are easy fixes for each broker and each one is different. If you have been logging in successfully, here are the steps you can take to troubleshoot the issue. 

  1. Try to log in again immediately. Often your ISP might have a temporary delay or the broker connection might be busy. This solves most of the problems.
  2. Check your internet speed. It could be an issue with your ISP or your wireless router. We recommend connecting your computer directly using an Ethernet cable.  
  3. Go to the Dashboard and update Option Stalker Pro… even if you think it is current. 
  4. Close all other trading applications. Some of them are very “heavy” and they take up a lot of resources. Then try to log into Option Stalker Pro. If it runs fine, it might be time to upgrade your computer. 
  5. Log in using the Intrinio feed instead of the broker API. It is a free real-time data feed and you will not notice any difference after hours or on the weekend. This is your back up. If it connects fine, the issue is with the API. 
  6. This is the last resort. Uninstall Option Stalker Pro from your computer C:/1OptionPlatform. When prompted, save user files (your searches and settings). Then do a fresh download from the Dashboard. 

It is best practice to close Option Stalker Pro each day and to start it well before the open. 

For all tech support, please Contact Customer Support.

Top