Skip to content

Commit

Permalink
added support for extended_hours
Browse files Browse the repository at this point in the history
  • Loading branch information
jmfernandes committed Oct 12, 2024
1 parent c033856 commit 4346953
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions robin_stocks/robinhood/orders.py
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,7 @@ def order(symbol, quantity, side, limitPrice=None, stopPrice=None, account_numbe
'time_in_force': timeInForce,
'trigger': trigger,
'side': side,
'market_hours': market_hours, # choices are ['regular_hours', 'all_day_hours']
'market_hours': market_hours, # choices are ['regular_hours', 'all_day_hours', 'extended_hours']
'extended_hours': extendedHours,
'order_form_version': 4
}
Expand All @@ -868,8 +868,7 @@ def order(symbol, quantity, side, limitPrice=None, stopPrice=None, account_numbe
# regular market sell
elif orderType == 'market' and side == 'sell':
del payload['price']
elif market_hours == 'all_day_hours':

elif market_hours in ('extended_hours', 'all_day_hours'):
payload['type'] = 'limit'
payload['quantity']=int(payload['quantity']) # round to integer instead of fractional

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
long_description = f.read()

setup(name='robin_stocks',
version='3.1.3',
version='3.2.0',
description='A Python wrapper around the Robinhood API',
long_description=long_description,
long_description_content_type='text/x-rst',
Expand Down

0 comments on commit 4346953

Please sign in to comment.