question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Orders Limit Price and Stop Price not working

See original GitHub issue

Placing a bracket order as follows should result in an order with a limit and a stop price:

self.buy_bracket(data=d, exectype=bt.Order.Market, stopprice=stop_price, limitprice=take_prof, 
 size=qty)

However, it looks like this order just ends up being a regular buy order with no limit/stop price. Also it looks like all 3 orders of the bracket are accepted, which is strange that we just end up with one regular buy order.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
shlomikushchicommented, May 29, 2020

Hi, I added support for the bracket order. it will be available on pypi in the next release. you could install it directly from github right now like this: pip install -U git+https://github.com/alpacahq/alpaca-backtrader-api

1reaction
kr011commented, Jun 1, 2020

Oh I see. Yeah that works thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

If a Stop-Limit Is Reached, Will It Always Sell? - Investopedia
If a stop-limit order is established, find out if it is guaranteed to be executed even when the market is dropping fast. See...
Read more >
3 Order Types: Market, Limit and Stop Orders | Charles Schwab
A trader who wants to sell the stock when it reached $142 would place a sell limit order with a limit price of...
Read more >
Stop Limit Order: What It Is, How It Works & Examples
If the stop price is reached, but the trade cannot be executed at the limit price or better, the trade will not occur....
Read more >
Stop-Limit Order - Overview, How It Works, Uses, Risks
A stop-limit order does not guarantee that a trade will be executed if the stock does not reach the specified price.
Read more >
Stop-Limit Order: Definition, Examples, When to Use It
Let's say you have a stop price of $50 on a sell stop limit order and your limit price is $45. If market...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found