robin_stocks icon indicating copy to clipboard operation
robin_stocks copied to clipboard

Getting 400 Error on Orders

Open robertfitzgibbon opened this issue 2 years ago • 6 comments

Anyone else still getting 400 Error when attempting to order (in my case a fractional order by price)??

Any fixes yet?

robertfitzgibbon avatar Aug 03 '23 18:08 robertfitzgibbon

i tried #414 , not working for me. especially market sell , limit sell order.

buy orders are working

shinwss avatar Aug 03 '23 18:08 shinwss

The problem still persists when I try order_sell_market. order_buy_market works fine.

I tried these, like @eilin75 suggested in https://github.com/jmfernandes/robin_stocks/issues/414

import robin_stocks.robinhood as robin #it is how I have in my file

robin.orders.order(xSymbol, qty_list[y], "sell", limitPrice=None, stopPrice=None, account_number=None, timeInForce='gtc', extendedHours=False, jsonify=True, market_hours='regular_hours')

robin.orders.order(xSymbol, qty_list[y], "sell", None, None, None, 'gtc', True, 'regular_hours')

robin.order(xSymbol, qty_list[y], "sell", limitPrice=None, stopPrice=None, account_number=None, timeInForce='gtc', extendedHours=False, jsonify=True, market_hours='regular_hours')

robin.order(xSymbol, qty_list[y], "sell", None, None, None, 'gtc', True, 'regular_hours')

robin.orders.order_sell_market(xSymbol, qty_list[y])

robin.order_sell_market(xSymbol, qty_list[y])

but did not work

also tried the @bvandorf fix https://github.com/jmfernandes/robin_stocks/issues/414#:~:text=will%20fix%20this.-,%23421,-NelsonDane%20commented%202, still error 400 when trying to sell.

AlexU238 avatar Aug 03 '23 18:08 AlexU238

i tried #414 , not working for me. especially market sell , limit sell order.

buy orders are working

Do you have fractional buying working? Can you share your library by chance? Maybe I'm missing something...

robertfitzgibbon avatar Aug 03 '23 19:08 robertfitzgibbon

This is the order structure I am using:

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

let me check, it is telling me it is having trouble connecting to the Api and to check my internet. so, when I get a chance to figure that out quick, I will try it out.

bvandorf avatar Aug 06 '23 19:08 bvandorf

I have updated the pull request and am able to submit the orders from the examples above

bvandorf avatar Aug 06 '23 21:08 bvandorf