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

order_buy_limit, order_sell_limit, order_buy_market, order_sell_market errors #394

Open shrawan12321 opened 1 year ago

shrawan12321 commented 1 year ago

Looks like it is trying to convert timeInForce option to float and it fails.

File "/Users/Shrawan/opt/anaconda3/envs/trading-robinhood-python/lib/python3.9/site-packages/robin_stocks/robinhood/helper.py", line 33, in login_wrapper return(func(*args, **kwargs))

File "/Users/Shrawan/opt/anaconda3/envs/trading-robinhood-python/lib/python3.9/site-packages/robin_stocks/robinhood/orders.py", line 593, in order_sell_limit return order(symbol, quantity, "sell", limitPrice, None, timeInForce, extendedHours, jsonify)

File "/Users/Shrawan/opt/anaconda3/envs/trading-robinhood-python/lib/python3.9/site-packages/robin_stocks/robinhood/helper.py", line 33, in login_wrapper return(func(*args, **kwargs))

File "/Users/Shrawan/opt/anaconda3/envs/trading-robinhood-python/lib/python3.9/site-packages/robin_stocks/robinhood/orders.py", line 808, in order stopPrice = round_price(stopPrice)

File "/Users/Shrawan/opt/anaconda3/envs/trading-robinhood-python/lib/python3.9/site-packages/robin_stocks/robinhood/helper.py", line 157, in round_price price = float(price)

ValueError: could not convert string to float: 'gtc'

cpasean commented 1 year ago

Please help to fix this error as soon as possible.

shinwss commented 1 year ago

same error

txavier commented 1 year ago

Hey, @cpasean and @shinwss try this out.

397

Change line 321 in orders.py from return order(symbol, quantity, "buy", None, None, timeInForce, extendedHours, jsonify) return order(symbol, quantity, "buy", None, None, None, timeInForce, extendedHours, jsonify)

Let me know if that works for you.

jmfernandes commented 1 year ago

@txavier @cpasean @shinwss it should be fixed in github and pypi. You can do a

pip install —upgrade robin_stocks

to get the latest version which should be 3.0.4

shrawan12321 commented 1 year ago

Could you also please tell us where the new documentation page is? None of the links below seem to work. I remember it used to work a while ago.

https://www.robin-stocks.com/en/latest/robinhood.html[ https://robin-stocks.readthedocs.io/en/latest/robinhood.html https://robin-stocks.readthedocs.io/_/downloads/en/stable/pdf

shrawan12321 commented 1 year ago

Also, with the latest version, limit sell seems to work properly but not limit buy. Getting - " Error in request_post: Expecting value: line 1 column 1 (char 0)) None " While selling non existing shares of AAPL (as a test), it says - " {'non_field_errors': ['Your app version is missing important stock trading updates. You can still place orders on the web.']} " instead of just saying I dont have enough to sell.

cpasean commented 1 year ago

@txavier @cpasean @shinwss it should be fixed in github and pypi. You can do a

pip install —upgrade robin_stocks

to get the latest version which should be 3.0.4

Dear Boss, I got 3.0.4 and tried:

  1. Sell order: "rs.order_sell_market('BIIB', 1, timeInForce= 'gtc')" ==> "{'non_field_errors': ['Your app version is missing important stock trading updates. You can still place orders on the web.']}"
  2. Buy order: "rs.order_buy_market('BIIB', 1)" ==> "Error in request_post: Expecting value: line 1 column 1 (char 0)"

    Please help dear boss.

sanathnair09 commented 1 year ago

401

Just made a comment on this issue about a similar error I received what I saw was the cause of it.

paraluke23 commented 1 year ago

I still can't buy or sell :( Hope the 401 PR is merged soon. 3.0.5 still has errors.