Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions robin_stocks/robinhood/orders.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ def order_buy_stop_loss(symbol, quantity, stopPrice, account_number=None, timeIn
the price, and the quantity.

"""
return order(symbol, quantity, "buy", account_number, None, stopPrice, timeInForce, extendedHours, jsonify)
return order(symbol=symbol, quantity=quantity, side="buy", limitPrice=None, stopPrice=stopPrice, account_number=account_number, timeInForce=timeInForce, extendedHours=extendedHours, jsonify= jsonify)


@login_required
Expand Down Expand Up @@ -631,7 +631,7 @@ def order_sell_stop_loss(symbol, quantity, stopPrice, account_number=None, timeI
the price, and the quantity.

"""
return order(symbol, quantity, "sell", account_number, None, stopPrice, timeInForce, extendedHours, jsonify)
return order(symbol=symbol, quantity=quantity, side="sell", limitPrice=None, stopPrice=stopPrice, account_number=account_number, timeInForce=timeInForce, extendedHours=extendedHours, jsonify= jsonify)


@login_required
Expand Down
6 changes: 5 additions & 1 deletion tests/test_robinhood.py
Original file line number Diff line number Diff line change
Expand Up @@ -835,4 +835,8 @@ def isFloat(f):
assert isFloat(order['quantity'])
assert isFloat(order['cumulative_quantity'])
if(order['state'] == 'filled'):
assert (order['quantity'] == order['cumulative_quantity'])
assert (order['quantity'] == order['cumulative_quantity'])

def test_stop_loss_order(cls):
order_details = r.order_sell_stop_loss()
assert ('account_number' in order_details)