Skip to content

Commit

Permalink
Merge pull request #381 from GuitarGuyChrisB/master
Browse files Browse the repository at this point in the history
order_buy_fractional_by_price Patch
  • Loading branch information
jmfernandes committed Jun 17, 2023
2 parents 470a205 + f5ebd82 commit 2a34e26
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion robin_stocks/robinhood/orders.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ def order_buy_fractional_by_price(symbol, amountInDollars, account_number=None,
# turn the money amount into decimal number of shares
price = next(iter(get_latest_price(symbol, 'ask_price', extendedHours)), 0.00)
fractional_shares = 0 if (price == 0.00) else round_price(amountInDollars/float(price))

return order(symbol, fractional_shares, "buy", account_number, None, None, timeInForce, extendedHours, jsonify)


Expand Down Expand Up @@ -827,6 +827,11 @@ def order(symbol, quantity, side, account_number=None, limitPrice=None, stopPric
'side': side,
'extended_hours': extendedHours
}
# BEGIN PATCH FOR NEW ROBINHOOD BUY FORM (GuitarGuyChrisB 5/26/2023)
if side == "buy":
payload['order_form_version'] = "2"
payload['preset_percent_limit'] = "0.05"
# END PATCH FOR NEW ROBINHOOD BUY FORM (GuitarGuyChrisB 5/26/2023)

url = orders_url()

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.0.0',
version='3.0.2',
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 2a34e26

Please sign in to comment.