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

Is there a way to enter a bracket order? #1104

Open
erdult opened this issue Jan 11, 2024 · 1 comment
Open

Is there a way to enter a bracket order? #1104

erdult opened this issue Jan 11, 2024 · 1 comment
Labels
question Not a bug, but a FAQ entry

Comments

@erdult
Copy link

erdult commented Jan 11, 2024

Is there a way to enter a bracket order

For reference:

Bracket order is a type of market order that is placed during intraday trading only. Such orders combine a buy order with a stop-loss and target order. Bracket orders are meant to help stock market traders square off a favourable position by the end of the trading session.

So this order is path dependent (need to determine if profit taking limit or stop-loss will trigger first), with OHLC data I am not sure how it could work.

@kernc
Copy link
Owner

kernc commented Feb 2, 2025

Simply calling Strategy.buy() with sl= and tp= should do it?

self.buy(size=10, limit=limit_price, sl=sl_price, tp=tp_price)

?

@kernc kernc added the question Not a bug, but a FAQ entry label Feb 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Not a bug, but a FAQ entry
Projects
None yet
Development

No branches or pull requests

2 participants