Ask HN: How to launch an algo trading side project?
I've been writing my own implementations and using 20 year historical stock data. Have been test trading to see how my logic is working.
However, I have an issue. When I think I am ready to use real money how do I do this? Do I need to get ETrade or Robinhood to actually start automated trading?
An open Ask HN community consultation from 2018 where @jason_slack convened hundreds of developers and bootstrappers to share real experiences, hard numbers, and tactics.
Core Principles for Independent Builders:
Participants share raw revenue figures, churn rates, and stack decisions that corporate PR never publishes.
Recurring answers reveal that distribution, not coding skill, is almost universally the rate-limiting step in developer businesses.
Practical recommendations on bookkeeping, payment gateways (Stripe vs Paddle), and freelance-to-product transitions.
Community Debate Themes:
Hundreds of active indie hackers contributed case studies, pricing heuristics, and pitfalls to avoid when moonlighting on side projects.
CATEGORY Ask HN Roundtables →
HISTORICAL ERA Cloud & Mobile Era (2014–2019)
COMMUNITY SCORE ★ 58 points
TOTAL DISCUSSIONS 88 comments
The Interactive Brokers (IB) API would probably be your best option for trading on the side.
Here are a few words of advice regarding IB:
- Thoroughly read and understand the IB documentation. - Be sure that you never get close to any of IB’s risk limits that can result in the automatic liquidation of some, or all, of your positions. - If you don’t want to put up enough cash in your IB account for day trading, be sure you don’t exceed the trading limits that will get you classified as a day trader and thus prevent you from further trading until you add more cash. - Be aware that the IB market data can have significant inaccuracies and/or delays.
Here are a few words of advice on automated trading:
- Thoroughly understand the exchanges that handle the instruments you want to trade. Each exchange has online documentation explaining details of traded instruments, matching algorithms, pricing, and market data. Even though you won’t be accessing the exchanges directly, these details have an effect. - Thoroughly understand IB’s order routing and how they construct their market data (if you use it). - Just because your historical data says an instrument closed at a particular price, that does not mean you could have actually bought or sold at that price with IB or even with direct market access. The same is true of tick data constructed at 1 minute, 1 second, or even millisecond resolution. Trading simulations can be terribly inaccurate if you don’t have a reasonable approximation of the exchange order books, the exchange latencies, IB’s latencies, and your own trading system latency. To counter this, you need to be extremely conservative in your assumptions about getting an order filled at a particular price. - Even with accurate market data and exact latency measurements, predicting future profits by backtesting over historical data is perilous. I advise having a strong background in the statistical/machine learning methods for constructing and analyzing appropriate training, testing, and validation sets. - Don’t make a trade just because some analysis suggests the market will go in that direction. Doing this will probably get you hurt and it harms markets by pushing them to overshoot or undershoot the correct prices. The trend is your friend until he turns around and stabs you in the back. Make a trade because that’s where the market should go and probably will go eventually.
My best advice for trading profitably is to do something to improve a market. Focus on areas that can benefit from your strongest personal advantages (mathematical, technical, domain knowledge, etc.). Gain an understanding of the exchanges and instruments that allows you to recognize ways to make prices more accurate. This improvement could be in an absolute sense for individual prices or it could be in a relative sense in terms of how instruments should be priced with respect to one another. It could also be in terms of adding liquidity (offering to buy or sell) where needed and justified. Improving markets improves our economy by helping it to better prioritize resources and limit risks. That is a valuable service and the market will pay you for it.
I am working on the same thing. I'm still in the model building phase and I still need to complete my backtesting framework. You seem to be ahead but I've already looked into the trading API process.
Go with whatever broker offers a trading API obviously, and has a fee structure that matches your trading strategy. If you can afford to lose a bit on the trade through commissions and your strategy is swing trading then you can pick pretty much any broker. If you need specific fill times and commission percentages before your strategy pays off then you are stuck with Interactive Brokers ($10k minimum[1], low comms, fast exec) or Robinhood (low minimum, free comms, slow exec). And technically Robinhood doesn't have a public API[2] so you would have to do a little reversing of their app's messaging. And then there's terms of service... yeah. Probably not a big deal for a small fry like yourself.
Next would be testing. You've got isolated tests with historic data but try get a broker that has a paper money version. TDAmeritrade's paper & api is good (but they are expensive). To be clear you would be using your algo to trade in a paper money account. That lets you get more realistic trade tests and if you blow something up you are still ok!
Keep in mind Robinhood is free because they are paid to route your orders to hedge funds and they are re-ordered in the book. You will get ok price execution through them but never the best. One thing you should include in your backtests/simulations is order execution delay and fill price variance. If you place market orders they won't always fill at the quote price. If you place limit orders they may take a while to fill (or not at all) unless the price is within the other side's order prices.
Last is the pattern day trading rule. Make sure you have a strategy that won't make more than 3 day trades in a 5 day window, otherwise your account might get suspended for a few months. It's a pile of horses but you can get around that by simply having more money in your account. > $25k will buy you unlimited day trading privileges.
Just curious what your strategy is based on if you don't mind giving a few details.
Good luck!
[1]https://www.interactivebrokers.com/en/index.php?f=4969 [2]https://support.robinhood.com/hc/en-us/articles/210216823-Robinhood-API-Integrations
I have only tried one algo trading platform, Interactive Brokers. API documentation: http://interactivebrokers.github.io/tws-api/index.html#gsc.tab=0
Their live market data is gated at 250 ms, so definitely not for HFT. Market data subscriptions are only $5 / month (US Equities, and others I don't remember), and commissions are low.
You can program in C#, Java, VB, C++, or Python. I use their C++ platform. It is not particularly pretty, but it seems well-tested and works. Perhaps most importantly, they have an awesome support phone number. They are responsive and very helpful.
Interactive Brokers (IB) is your best bet. However, I’d like to reiterate as others have stated that you need to be prepared to lose it all (and moreover that you likely need much more capital than you realize to stay solvent on down swings).
Don’t take this the wrong way, but it seems like you haven’t done a lot of research into this: Interactive Brokers is one of the first things that comes up when you search on Google (etrade, Robin Hood or any other retail trading just isn’t credible).
Finally, is your 20 years of historical data for just open/close? Is that your execution plan? (Otherwise you can get really tripped up as you move to intraday trading)
1. Read Flashboys
2. a) Realize how CRAZILY far many HFT firms have gone to inch out literally every single microsecond and achieve economies of scale with billions in assets
2. b) individual user-scale tools like ETrade won't get your trades in fast enough/any cost per transaction fees will erase any gains
3. Invest said capital in something like Betterment
If your model has been truly beating the market for a sustainable amount of time, I apologize for my comment and go all out :)