Submitted by KryptoSC t3_zyaxad in wallstreetbets

As an algorithmic trader that codes in Python, I thought I'd share my experiences on the available choices out there for API trading of US equities. Since my trading algorithms fall under the category of automated, high-frequency trading, my absolute requirements for the platform are:

  1. Trading of US Stocks (NYSE, NASDAQ)
  2. Zero-Commission equity trades
  3. API trading enabled
  4. No re-authentication required for at least 30 days

Not required, but heavily preferred:

  1. Fractional trading
  2. Free NBBO Quotes
  3. Options trading

I investigated 9 brokerage firms and here's my report below:

Ally - Opened an account and API was easy to use. However, quotes from the API calls were 15 minutes delayed and later customer support directed me to a page on their website which explicitly states that no Automated or Algorithmic Trading is allowed, so I closed the account.

Robinhood - Requires you to renew token at least once a day, so I didn't bother going any further.

TD Ameritrade - Opened an account, but when I tried to request an API key, it states that new accounts requesting API trading are discontinued due to acquisition from Schwab. Will close account and wait to see how the integration with Schwab goes.

E-trade - Opened an account long time ago and API was easy to use, but it requires you to manually re-authenticate and renew token daily.

Webull - In process of opening an account. Their API documentation appears thorough. A hack with Google Chrome's Inspect mode is required to retrieve access and refresh tokens in order to bypass daily reauthentication of your tokens, but I haven't verified this yet.

Interactive Brokers - I've had an account with them for 3 years. Zero commissions on equity trades, they support fractional trades, and options trading. However, all trades must go through their TWS software (daily re-authentication) or you need to have an active gateway session opened. Their free quotes were NBBO quotes.

TradeStation - Opened an account and they informed me that they will send me an API key when my account reaches 10k in value. My equities and cash are all at this time in other exchanges and I haven't done any transfers, so I haven't received API keys yet. API documentation is thorough and similar in quality to Tradier and Alpaca. Zero commissins on equities, but they do not appear to support fractional trades. Overall, seems promising and may have potential to be better than Tradier.

Tradier - Opened an account and API was easy to use. Zero commissions. Consumer and token keys never expire. Their free quotes are NBBO. Only drawback is that they do not allow fractional trades for individual accounts, just institutional accounts. They have options trading. I'm very happy with them.

Alpaca - This is the platform I have been running algorithmic trades on for the last 2 years. Zero commissions and they allow fractional trades. Only drawback are their free quotes. They only supply you quotes from one of the exchanges (IEX) and I found the bid-ask spreads to be pretty wide and unreliable at times. You need to pay $99/month for their premium quote service. However, their real-time get_latest_trade API call is accurate and I use that in conjunction with their get_latest_quote API call, so the two combined is good enough for my algorithmic trading. This platform is my benchmark when comparing other brokerages.

Overall, I like Tradier and TradeStation the best. However, if my algorithm requires fractional trades then Alpaca is my go-to platform. Have you guys had similar experiences? Please comment if there is a brokerage firm that allows for API trading of US Stocks that's not in my list.

30

Comments

You must log in or register to comment.

Many_Tank9738 t1_j25ery5 wrote

TL:DR; Algorithmic trader can’t afford $99 for quotes wants to give advice

20

KryptoSC OP t1_j25ifdt wrote

Be nice now :) I would pay $99 for premium quotes if that was necessary to execute my strategy cleanly. But as I stated, the free option works fine with my strategies, so I'm holding off on paying for something I don't need at the moment.

8

DamnCoolGuy t1_j25oocd wrote

Don't be discouraged by manual authentication. You can still automate it using selenium or similar. Not sure if you have it for Python though but was there for C#.

7

KryptoSC OP t1_j25q0vi wrote

Many of the firms now require manual authentication with 2FA, so selenium is not going to work. I've done a substantial amount of web-scraping with selenium for my work, so I'm familiar with what you're suggesting. In the past, I tried using selenium to automate retrieving the refreshed code from eTrade , but they had something that was blocking my script from reading the code that was generated, so I gave up on it.

5

uwu2420 t1_j27tbvf wrote

If the 2FA is TOTP, then get a TOTP generator library

If the 2FA is SMS, set up a $3/mo number through Twilio.

What is the problem?

3

golden_bear_2016 t1_j29sua4 wrote

Interactive Brokers got you beat because you they run their own 2FA protocol with their IB Key authentication.

5

uwu2420 t1_j29uncq wrote

I’m a reverse engineer (mostly as a hobby) so I welcome the challenge should I need that at some point. :)

Although… it’s well known in information security to not roll your own cryptography or to rely on security by obscurity. And in my experience, most proprietary 2FA apps do use some form of standard 2FA algorithm, they might just be using a proprietary way of sharing the 2FA secret, have undocumented APIs for rolling secrets, or are using lesser-known (but still, standardized) 2FA algorithms like HOTP, which are all reasonably easy to figure out for a determined enough developer.

3

golden_bear_2016 t1_j29w5qh wrote

If you manage to do it, please let me know. Would be more than happy to buy you a coffee if you have the steps.

Right now I have sort of a workaround that's pretty janky and not reliable enough.

3

mazarax t1_j24tbx3 wrote

Zero commission?

How is the broker supposed to make money?

3

SUPRVLLAN t1_j25t8of wrote

What rock have you been living under img

3

Ezzoud t1_j253eyr wrote

Just out of curiosity, compared to just going full regard like 80% of the sub, how much more profitable is api trading

2

uwu2420 t1_j27twdj wrote

If you have a profitable strategy, very profitable

If you have a shitty strategy, you’ll lose money faster.

6

KryptoSC OP t1_j254hln wrote

That's the wrong question to ask. They way I look at it, API trading facilitates programmatic trading which facilitates algorithmic trading which facilitates automating a strategy that has manually worked for you profitably in the past.

0

fruitbatz-maru t1_j25ckad wrote

I totally agree. Personally, I use the etrade API to automate my bagholding.

It does have the problem you mention re: having to log in again every day.

Also I'm ok with paying commission.

5

MoreBurpees t1_j261xpb wrote

>Just ... how much more profitable is api trading

I would also like to know this, please.

3

unix_enjoyer305 t1_j28bf21 wrote

there are lots of people on YT who write algorithms and go over the algo's trades and P & L's

3

MoreBurpees t1_j28vkh4 wrote

Would you be kind enough to drop a link to one that was useful to you?

2

KryptoSC OP t1_j264dl8 wrote

I'll answer it this way. API trading for the most part frees you from having to constantly look at the monitor and eliminates emotional trading decisions. You still have to monitor the win rate to make sure your algorithm is net positive. You also need to backtest at least once a month to see if your strategy is still the most profitable option or if there is a more profitable alternative. Again, it's about automating what has worked well for you.

My most profitable algorithmic trading strategy has been netting me consistently between $1200-$1500 per month and I've been slowly scaling it up.

2

MoreBurpees t1_j26b6ok wrote

Oh nice. I think I understand now in that it's utilizing your strategy versus its own. Thank you for teaching me.

2

Ezzoud t1_j28rcbp wrote

I had a friend couple of years ago offer automated trading based on their set criteria. Was about to drop 500 to him, nearly all i had back then, and he then told me it will be 1.2k monthly for the bot img

2

KryptoSC OP t1_j28wd2d wrote

$1200? Not much of a friend then. I'll say this, my automated trading activity will flag my account as a "Pattern Day Trader" due to the multiple back and forth buying and selling, which means that if I don't have a minimum $25k in the account then the brokerage firm will be forced (by FINRA) to liquidate my account.

2

m0nk_3y_gw t1_j27lid3 wrote

> or you need to have an active gateway session opened

I was going to go down the path. Seems like you can just leave the gateway signed in.

2

VisualMod t1_j24qlnt wrote

1

colino11 t1_j250p20 wrote

Should be illegal

0

OB1KENOB t1_j273t7e wrote

Congrats and fuck you

0