Closed benkelley1979 closed 4 years ago
also having this issue, it is very strange. Is also the case for place_limit_sell_order as a matter of fact.
Actually, I think i figured out what it is. Try truncating your float variable to 2 decimal places. That fixed it for me
Hi @davidwang20 I had actually stumbled onto this earlier today and hadn't updated this post yet. I'm glad you got it going too! I would like to understand if this is a limitation of pyrh or of Robinhood's API. When using the mobile app or website I can set orders to 4 decimal places. If possible I would like that option. Also, shouldn't there be an error returned? I am not importing pyrh.Exceptions. Could that be the issue?
Actually, I think i figured out what it is. Try truncating your float variable to 2 decimal places. That fixed it for me
I found it helpful to create round_down and round_up functions. round_down to 2 decimals for limit sell and round_up to 2d for limit buy. This gives you the best chance at executing immediately
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Closing this issue automatically because it has not had any activity since it has been marked as stale. If you think it is still relevant and should be addressed, feel free to open a new one.
Win10 / Python 3.8.2 / working in IDLE x64
TL;DR: I can make
place_limit_buy_order
work from IDLE console when I enterask_price
manually as a float value. Theplace_limit_buy_order
command fails once I use a variable forask_price
I encountered similar issues withplace_buy_order
float(quote.get('last_trade_price'))
type(float(journal.Price[len(journal.index)-1]))
rh.place_limit_buy_order('https://api.robinhood.com/instruments/**GUID**/', 'XTNT', 'GFD', float(journal.Price[len(journal.index)-1]), 5)
rh.place_limit_buy_order('https://api.robinhood.com/instruments/**GUID**/', 'XTNT', 'GFD', 1.70, 5)
My desired result is to pull
instrument_URL
symbol
price
quantity
from lists. Nothing else seems to cause an issue except forprice
lmk if you need clarification or would like to see my entire code.