robinhood-unofficial / pyrh

Python Framework to make trades with the unofficial Robinhood API
https://pyrh.readthedocs.io/en/latest/
MIT License
1.78k stars 603 forks source link

Robinhood.place_stop_loss_sell_order() fails with HTTP 400 Client Error #245

Closed Calrider closed 4 years ago

Calrider commented 4 years ago

Checklist

Description

Robinhood.place_stop_loss_sell_order() consistently raises the following error: 400 Client Error: Bad Request for url: https://api.robinhood.com/orders/

Steps/Code to Reproduce

from pyrh import Robinhood, load_session

rh = load_session()
quote = rh.get_quote('RBCN')
instrument_url = quote['instrument']
rh.place_stop_loss_sell_order(
    instrument_URL=instrument_url,
    symbol='RBCN',
    time_in_force='GTC',
    stop_price=7.90,
    quantity=1
)

Results

Order should have been sent

Versions

tyunist commented 4 years ago

Found the same issue. The root cause is: '{"non_field_errors":["Stop market sell order requested, but price provided."]}' Some mentioned here that

Edit: Looks like someone flipped a switch on the back end. Market orders used to require a price (set in the app to last execution) to set the collar. Now, the API is choking on that.

cmaccarone commented 4 years ago

did anyone find a solution to this? I am getting http 400 as well.

stale[bot] commented 4 years ago

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.

stale[bot] commented 4 years ago

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.