jmfernandes / robin_stocks

This is a library to use with Robinhood Financial App. It currently supports trading crypto-currencies, options, and stocks. In addition, it can be used to get real time ticker information, assess the performance of your portfolio, and can also get tax documents, total dividends paid, and more. More info at
http://www.robin-stocks.com
MIT License
1.69k stars 458 forks source link

Request was throttled purchasing stocks #264

Open parker-moore opened 3 years ago

parker-moore commented 3 years ago

I'm trying to place fractional share orders using the API. (robin.order_buy_fractional_by_price(ticker,dollars))

for ticker in tickers: dollars = 1 res = robin.order_buy_fractional_by_price(ticker,dollars) print(res)

I have about 15 tickers in the list "tickers". After ~8 the return result prints "{'detail': 'Request was throttled. Expected available in 14 seconds.'}" and I'm unable to buy the remaining tickers.

Does anyone know the rate limit for purchasing a large list of tickers on Robinhood? Is there any way to get around this?

cheekylions commented 3 years ago

Making vast assumptions here, but based on your results, the rate limit is probably something about 8 transactions every 15 seconds. I recommend sleeping your script for 15 seconds every 5 transactions to stay low of the governor. The Robinhood API doesn't seem built for this kind of trading style, as it's more of an app-based 'newbie' broker. If you're looking to make a lot of fast scalps, you might look into other brokers that are friendly with developers.