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 459 forks source link

`order_buy_option_limit` throws a 404 Client Error #498

Closed ad1t7a closed 2 days ago

ad1t7a commented 2 days ago

I was trying out the API r.order_buy_option_limit and the code snippet looks like this:

import robin_stocks.robinhood as r
login = r.login("username", "password", mfa_code=code)

r.order_buy_option_limit('open','debit', 0.01, 'SPY', 1, '2024-10-17', 580, 'put','gfd')

but it's been giving me an error on execution:

404 Client Error: Not Found for url: https://api.robinhood.com/accounts/gfd
Error in request_post: Received 500

Not sure what is missing. I was able to do other things with the API like r.profiles.load_account_profile()

ad1t7a commented 2 days ago

Whoops, got it. It needed timeInForce='gfd' to be specified explicitly.