jmfernandes / robin_stocks

This is a library to use with Robinhood Financial App. It currently supports trading crypto-currencies, options, and stocks. In addition, it can be used to get real time ticker information, assess the performance of your portfolio, and can also get tax documents, total dividends paid, and more. More info at
http://www.robin-stocks.com
MIT License
1.69k stars 459 forks source link

Getting 400 Error on Orders #424

Open robertfitzgibbon opened 1 year ago

robertfitzgibbon commented 1 year ago

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

Any fixes yet?

shinwss commented 1 year ago

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

buy orders are working

AlexU238 commented 1 year ago

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.

robertfitzgibbon commented 1 year ago

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...

eilin75 commented 1 year ago

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)

bvandorf commented 1 year ago

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 commented 1 year ago

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