Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Options Support - Market/Limit Place Orders #316

Open
ksvec opened this issue Aug 6, 2024 · 5 comments
Open

Options Support - Market/Limit Place Orders #316

ksvec opened this issue Aug 6, 2024 · 5 comments
Labels

Comments

@ksvec
Copy link

ksvec commented Aug 6, 2024

Could you please look into adding support for placing limit and market orders (buy/sell) on options?

At the moment, I am receiving this error upon placement: HTTPError: 400 Client Error: Bad Request for url: https://api.robinhood.com/orders/

I believe the correct url is https://api.robinhood.com/options/orders/

Thank you

@ksvec ksvec added the feature label Aug 6, 2024
@adithyabsk
Copy link
Member

Hi @ksvec, this repo is in maintenance mode, though we are accepting contributions. Feel free to put up a PR and I'd be happy to review.

@viaConBodhi
Copy link

@ksvec Checkout https://github.com/westonplatter/fast_arrow for options. You'll only need to ensure your requests work across repos or just rebuild the methods.

@ksvec
Copy link
Author

ksvec commented Aug 6, 2024

hi @viaConBodhi - I am getting the same error from that repo when placing an options sell order.
any ideas there? have you used it succesfully?

OptionOrder.submit(client,
direction='credit',
price= str(mark_price),
legs = legs,
quantity=qty,
time_in_force='gtc',
trigger='immediate',
order_type='limit')

HTTPError: 400 Client Error: Bad Request for url: https://api.robinhood.com/options/orders/

@viaConBodhi
Copy link

@ksvec It's been a while so they may have made updates. I remember needing to play around with some of the formatting of the inputs to get it working.

        my_bid_price = float(x)

        my_bid_price_rounded = (math.floor(my_bid_price * 100.0) ) /100.0
        my_bid_price_formatted = str(my_bid_price_rounded)
        price = my_bid_price_formatted


direction = "debit"

legs = [{ "side": "buy",
          "option": targetURL,
          "position_effect": "open",
          "ratio_quantity": 1 }]

quantity = 1
time_in_force = "gfd"
trigger = "immediate"
order_type = "limit"
desired_type = "put"

submit the order

oo = OptionOrder.submit(client, direction, legs, price, quantity, time_in_force, trigger, order_type)

@ksvec
Copy link
Author

ksvec commented Aug 6, 2024

@viaConBodhi understood. I was able to get this repo working on option orders
https://github.com/jmfernandes/robin_stocks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants