robin_stocks icon indicating copy to clipboard operation
robin_stocks copied to clipboard

create market order buy & create market order sell POST 400 ERROR

Open Mariani-code opened this issue 1 year ago • 12 comments

Running into "Error in request_post: Received 400" on sell market orders on 3.0.5, Is anyone else running into this?

Mariani-code avatar Jul 15 '23 14:07 Mariani-code

I have the same issue when using the function order_sell_market in version 3.0.5. "Error in request_post: Received 400"

kshoop250 avatar Jul 18 '23 21:07 kshoop250

Same issue for me, why is it not getting fixed? Thanks.

paraluke23 avatar Jul 21 '23 14:07 paraluke23

I am getting the same error with limit orders as well:

result = api.orders.order_buy_limit(currency, BuyAMT, BuyPrice)

eilin75 avatar Jul 24 '23 14:07 eilin75

same issue on my end. can anyone help us?

superfrank27 avatar Jul 24 '23 19:07 superfrank27

same issue market order not working

shinwss avatar Jul 25 '23 04:07 shinwss

I have the same issue as well

NelsonDane avatar Aug 01 '23 00:08 NelsonDane

I finally got this to work. You have to use the long order per the instructions.

i.e.

robin_stocks.robinhood.orders.order(symbol, quantity, side, limitPrice=None, stopPrice=None, account_number=None, timeInForce='gtc', extendedHours=False, jsonify=True, market_hours='regular_hours')

eilin75 avatar Aug 01 '23 04:08 eilin75

There is a pull request that will fix this. https://github.com/jmfernandes/robin_stocks/pull/421

bvandorf avatar Aug 01 '23 22:08 bvandorf

Thank you @eilin75 , your suggestion worked. Using the broader order function worked great!

NelsonDane avatar Aug 02 '23 03:08 NelsonDane

I had this same error when trying to place a sell order. I was trying to sell fractional shares and I realized I was using the wrong sell order. It didn't work until I used robin_stocks.robinhood.orders.order_sell_fractional_by_quantity("stock", shares)

FranklinDCodes avatar Aug 03 '23 14:08 FranklinDCodes

this is the order structure that I got working:

currency ='SQQQ'

BuyAMT = 1 BuyPrice =1.00 result = api.orders.order(currency,BuyAMT,'buy',float(BuyPrice),stopPrice=None, timeInForce='gtc') print (result)

eilin75 avatar Aug 04 '23 12:08 eilin75

I'm using that and it's been working well for me.

NelsonDane avatar Aug 08 '23 00:08 NelsonDane