Open TheTradeBakery opened 4 years ago
This is how I did it. Hope it helps.
# check we have at least one day trade available
account = rh.profiles.load_account_profile('account_number')
url = rh.urls.daytrades(account)
headers = rh.globals.SESSION.headers
rh.globals.SESSION.headers['X-Robinhood-API-Version'] = '1.315.0'
results = rh.helper.request_get(url)
stock_day_trades = results['equity_day_trades']
options_day_trades = results['option_day_trades']
day_trades = len(stock_day_trades) + len(options_day_trades)
rh.globals.SESSION.headers = headers
if day_trades < 0 or day_trades > 2:
print("WARNING: Must have less then 3 day trades available to trade.")
return
I'm not sure if this is related to the same issue, but I get 'results' is not a key in the dictionary after running _rbaccountdaytrades = rs.account.get_daytrades(info=None)
Bump. This is still an issue for me.
Looks like Robinhood might have removed https://api.robinhood.com/accounts/{account_number}/recent_day_trades/
I am getting a: 410 Client Error: Gone for url: https://api.robinhood.com/accounts/XXXXXXXX/recent_day_trades/