robinhood-unofficial / pyrh

Python Framework to make trades with the unofficial Robinhood API
https://pyrh.readthedocs.io/en/latest/
MIT License
1.79k stars 603 forks source link

How to check minimum required price increments #113

Closed badubies closed 6 years ago

badubies commented 6 years ago

I was writing a program that automatically creates limit sell orders for all my positions. For some of the stocks, I'd get a 400 HTTP error. I tried submitting the failed orders on Robinhood, and it gave a minimum price increment error, then allowed me to round my price to the nearest 5 cents. How could I check this beforehand on the API, or make the rounding change. image

jasonleehodges commented 6 years ago

If you hit the instrument endpoint for that particular instrument it looks like there is a min_tick_size property that shows "0.0500" as it's value. If you check the same property for a stock like AAPL the min_tick_size is null. So I think if you check that property first that should give you what you need.