Skip to content

Commit b4a5172

Browse files
authored
Merge pull request #468 from sanathnair09/master
Fixed account number parameter in order method
2 parents 2ba3148 + d36fae0 commit b4a5172

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

robin_stocks/robinhood/orders.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ def order_buy_market(symbol, quantity, account_number=None, timeInForce='gtc', e
320320
the price, and the quantity.
321321
322322
"""
323-
return order(symbol, quantity, "buy", account_number, None, None, timeInForce, extendedHours, jsonify)
323+
return order(symbol, quantity, "buy", None, None, account_number, timeInForce, extendedHours, jsonify)
324324

325325

326326
@login_required
@@ -346,7 +346,7 @@ def order_buy_fractional_by_quantity(symbol, quantity, account_number=None, time
346346
the price, and the quantity.
347347
348348
"""
349-
return order(symbol, quantity, "buy", account_number, None, None, timeInForce, extendedHours, jsonify)
349+
return order(symbol, quantity, "buy", None, None, account_number, timeInForce, extendedHours, jsonify)
350350

351351

352352
@login_required
@@ -380,7 +380,7 @@ def order_buy_fractional_by_price(symbol, amountInDollars, account_number=None,
380380
price = next(iter(get_latest_price(symbol, 'ask_price', extendedHours)), 0.00)
381381
fractional_shares = 0 if (price == 0.00) else round_price(amountInDollars/float(price))
382382

383-
return order(symbol, fractional_shares, "buy", None, None, account_number, timeInForce, extendedHours, jsonify, market_hours)
383+
return order(symbol, fractional_shares, "buy", None, None, account_number, timeInForce, extendedHours, jsonify, market_hours)
384384

385385

386386
@login_required
@@ -407,7 +407,7 @@ def order_buy_limit(symbol, quantity, limitPrice, account_number=None, timeInFor
407407
the price, and the quantity.
408408
409409
"""
410-
return order(symbol, quantity, "buy", account_number, limitPrice, None, timeInForce, extendedHours, jsonify)
410+
return order(symbol, quantity, "buy", limitPrice, None, account_number, timeInForce, extendedHours, jsonify)
411411

412412

413413
@login_required
@@ -434,7 +434,7 @@ def order_buy_stop_loss(symbol, quantity, stopPrice, account_number=None, timeIn
434434
the price, and the quantity.
435435
436436
"""
437-
return order(symbol, quantity, "buy", account_number, None, stopPrice, timeInForce, extendedHours, jsonify)
437+
return order(symbol, quantity, "buy", None, stopPrice, account_number, timeInForce, extendedHours, jsonify)
438438

439439

440440
@login_required
@@ -463,7 +463,7 @@ def order_buy_stop_limit(symbol, quantity, limitPrice, stopPrice, account_number
463463
the price, and the quantity.
464464
465465
"""
466-
return order(symbol, quantity, "buy", account_number, limitPrice, stopPrice, timeInForce, extendedHours, jsonify)
466+
return order(symbol, quantity, "buy", limitPrice, stopPrice, account_number, timeInForce, extendedHours, jsonify)
467467

468468

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

498498

499499
@login_required
@@ -518,7 +518,7 @@ def order_sell_market(symbol, quantity, account_number=None, timeInForce='gtc',
518518
the price, and the quantity.
519519
520520
"""
521-
return order(symbol, quantity, "sell", account_number, None, None, timeInForce, extendedHours, jsonify)
521+
return order(symbol, quantity, "sell", None, None, account_number, timeInForce, extendedHours, jsonify)
522522

523523

524524
@login_required
@@ -544,7 +544,7 @@ def order_sell_fractional_by_quantity(symbol, quantity, account_number=None, tim
544544
the price, and the quantity.
545545
546546
"""
547-
return order(symbol, quantity, "sell", None, None, account_number, timeInForce, extendedHours, jsonify, market_hours)
547+
return order(symbol, quantity, "sell", None, None, account_number, timeInForce, extendedHours, jsonify, market_hours)
548548

549549

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

580-
return order(symbol, fractional_shares, "sell", account_number, None, None, timeInForce, extendedHours, jsonify)
580+
return order(symbol, fractional_shares, "sell", None, None, account_number, timeInForce, extendedHours, jsonify)
581581

582582

583583
@login_required
@@ -604,7 +604,7 @@ def order_sell_limit(symbol, quantity, limitPrice, account_number=None, timeInFo
604604
the price, and the quantity.
605605
606606
"""
607-
return order(symbol, quantity, "sell", account_number, limitPrice, None, timeInForce, extendedHours, jsonify)
607+
return order(symbol, quantity, "sell", limitPrice, None, account_number, timeInForce, extendedHours, jsonify)
608608

609609

610610
@login_required
@@ -631,7 +631,7 @@ def order_sell_stop_loss(symbol, quantity, stopPrice, account_number=None, timeI
631631
the price, and the quantity.
632632
633633
"""
634-
return order(symbol, quantity, "sell", account_number, None, stopPrice, timeInForce, extendedHours, jsonify)
634+
return order(symbol, quantity, "sell", None, stopPrice, account_number, timeInForce, extendedHours, jsonify)
635635

636636

637637
@login_required
@@ -660,7 +660,7 @@ def order_sell_stop_limit(symbol, quantity, limitPrice, stopPrice, account_numbe
660660
the price, and the quantity.
661661
662662
"""
663-
return order(symbol, quantity, "sell", account_number, limitPrice, stopPrice, timeInForce, extendedHours, jsonify)
663+
return order(symbol, quantity, "sell", limitPrice, stopPrice, account_number, timeInForce, extendedHours, jsonify)
664664

665665

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

695695

696696
@login_required

0 commit comments

Comments
 (0)