Skip to content

Commit

Permalink
Merge pull request #468 from sanathnair09/master
Browse files Browse the repository at this point in the history
Fixed account number parameter in order method
  • Loading branch information
jmfernandes authored May 11, 2024
2 parents 2ba3148 + d36fae0 commit b4a5172
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions robin_stocks/robinhood/orders.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ def order_buy_market(symbol, quantity, account_number=None, timeInForce='gtc', e
the price, and the quantity.
"""
return order(symbol, quantity, "buy", account_number, None, None, timeInForce, extendedHours, jsonify)
return order(symbol, quantity, "buy", None, None, account_number, timeInForce, extendedHours, jsonify)


@login_required
Expand All @@ -346,7 +346,7 @@ def order_buy_fractional_by_quantity(symbol, quantity, account_number=None, time
the price, and the quantity.
"""
return order(symbol, quantity, "buy", account_number, None, None, timeInForce, extendedHours, jsonify)
return order(symbol, quantity, "buy", None, None, account_number, timeInForce, extendedHours, jsonify)


@login_required
Expand Down Expand Up @@ -380,7 +380,7 @@ def order_buy_fractional_by_price(symbol, amountInDollars, account_number=None,
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", None, None, account_number, timeInForce, extendedHours, jsonify, market_hours)
return order(symbol, fractional_shares, "buy", None, None, account_number, timeInForce, extendedHours, jsonify, market_hours)


@login_required
Expand All @@ -407,7 +407,7 @@ def order_buy_limit(symbol, quantity, limitPrice, account_number=None, timeInFor
the price, and the quantity.
"""
return order(symbol, quantity, "buy", account_number, limitPrice, None, timeInForce, extendedHours, jsonify)
return order(symbol, quantity, "buy", limitPrice, None, account_number, timeInForce, extendedHours, jsonify)


@login_required
Expand All @@ -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, quantity, "buy", None, stopPrice, account_number, timeInForce, extendedHours, jsonify)


@login_required
Expand Down Expand Up @@ -463,7 +463,7 @@ def order_buy_stop_limit(symbol, quantity, limitPrice, stopPrice, account_number
the price, and the quantity.
"""
return order(symbol, quantity, "buy", account_number, limitPrice, stopPrice, timeInForce, extendedHours, jsonify)
return order(symbol, quantity, "buy", limitPrice, stopPrice, account_number, timeInForce, extendedHours, jsonify)


@login_required
Expand Down Expand Up @@ -493,7 +493,7 @@ def order_buy_trailing_stop(symbol, quantity, trailAmount, trailType='percentage
such as the order id, the state of order (queued, confired, filled, failed, canceled, etc.), \
the price, and the quantity.
"""
return order_trailing_stop(symbol, quantity, "buy", trailAmount, trailType, timeInForce, extendedHours, jsonify)
return order_trailing_stop(symbol, quantity, "buy", trailAmount, trailType, None, timeInForce, extendedHours, jsonify)


@login_required
Expand All @@ -518,7 +518,7 @@ def order_sell_market(symbol, quantity, account_number=None, timeInForce='gtc',
the price, and the quantity.
"""
return order(symbol, quantity, "sell", account_number, None, None, timeInForce, extendedHours, jsonify)
return order(symbol, quantity, "sell", None, None, account_number, timeInForce, extendedHours, jsonify)


@login_required
Expand All @@ -544,7 +544,7 @@ def order_sell_fractional_by_quantity(symbol, quantity, account_number=None, tim
the price, and the quantity.
"""
return order(symbol, quantity, "sell", None, None, account_number, timeInForce, extendedHours, jsonify, market_hours)
return order(symbol, quantity, "sell", None, None, account_number, timeInForce, extendedHours, jsonify, market_hours)


@login_required
Expand Down Expand Up @@ -577,7 +577,7 @@ def order_sell_fractional_by_price(symbol, amountInDollars, account_number=None,
price = next(iter(get_latest_price(symbol, 'bid_price', extendedHours)), 0.00)
fractional_shares = 0 if (price == 0.00) else round_price(amountInDollars/float(price))

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


@login_required
Expand All @@ -604,7 +604,7 @@ def order_sell_limit(symbol, quantity, limitPrice, account_number=None, timeInFo
the price, and the quantity.
"""
return order(symbol, quantity, "sell", account_number, limitPrice, None, timeInForce, extendedHours, jsonify)
return order(symbol, quantity, "sell", limitPrice, None, account_number, timeInForce, extendedHours, jsonify)


@login_required
Expand All @@ -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, quantity, "sell", None, stopPrice, account_number, timeInForce, extendedHours, jsonify)


@login_required
Expand Down Expand Up @@ -660,7 +660,7 @@ def order_sell_stop_limit(symbol, quantity, limitPrice, stopPrice, account_numbe
the price, and the quantity.
"""
return order(symbol, quantity, "sell", account_number, limitPrice, stopPrice, timeInForce, extendedHours, jsonify)
return order(symbol, quantity, "sell", limitPrice, stopPrice, account_number, timeInForce, extendedHours, jsonify)


@login_required
Expand Down Expand Up @@ -690,7 +690,7 @@ def order_sell_trailing_stop(symbol, quantity, trailAmount, trailType='percentag
such as the order id, the state of order (queued, confired, filled, failed, canceled, etc.), \
the price, and the quantity.
"""
return order_trailing_stop(symbol, quantity, "sell", trailAmount, trailType, timeInForce, extendedHours, jsonify)
return order_trailing_stop(symbol, quantity, "sell", trailAmount, trailType, None, timeInForce, extendedHours, jsonify)


@login_required
Expand Down

0 comments on commit b4a5172

Please sign in to comment.