Hi,
I want to check the ongoing and fulfilled order stop limit value, how can I get this information?
For example, I put a stop-limit-buy order before, now not matter it is open or fulfilled already, Can I use below syntax to get the stop limit price? It seems I can only get Type/LimitPrice etc, but no stop limit price?
for order in self.Transactions.GetOrders(None): # self.Debug(dir(order)) self.Debug((order.CreatedTime)) self.Debug((order.Symbol)) self.Debug((order.Type)) self.Debug((order.LimitPrice)) self.Debug((order.Id)) self.Debug((order.Price)) self.Debug((order.Tag)) self.Debug((order.Value))Thanks,henry
Derek Melchin
Hi Henry111,
To get the stop limit price, we can use
self.ticket = self.StopLimitOrder(self.symbol, 100, data[self.symbol].Price + 25, data[self.symbol].Price + 50) stop_price = self.ticket.Get(OrderField.StopPrice)
If we don't have the order ticket, we can get it with
ticket = self.Transactions.GetOrderTicket(orderId)
See the attached backtest for reference.
Best,
Derek Melchin
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Henry111
Thanks for the information!
Henry111
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!