Hello,
In the documentation of 'Order.LastUpdateTime', it says "Gets the utc time this order was last updated, or null if the order has not been updated". However, all I see is None/null in the logs. Isn't it suppose to change when the OrderState changes? For example, from OrderState of 'Submitted' to 'PartiallyFilled' should trigger the LastUpdateTime field to be changed, no? Or, does 'update' mean actually editing an order, like changing its limit price? I always assumed 'update' means a change of an OrderState
Secondly, there is another field 'OrderTicket.Time' which says "Gets the time this order was last updated". However, this field always returns the order's creation time, whereas 'Order.LastUpdateTime' always returns None/null. So they return different values but the description sounds like they are the same.
I'm trying to find a way to see if an OrderTicket is updated outside of the OnOrderEvent method. By 'update', I mean change of OrderState or partial fill. I don't mean editing an order.
Mia Alissi
Based on the information provided in the extracts, the
Order.LastUpdateTime
attribute indeed gets the UTC time this order was last updated, or null if the order has not been updated. However, the term 'update' here refers to changes made to the order itself, such as changing its limit price, not changes in the order state.As for the
OrderTicket.Time
attribute, it gets the time this order was last updated. However, based on the extracts, it seems that this attribute returns the order's creation time, not the time of the last update.If you want to track changes in the OrderState or partial fills outside of the
OnOrderEvent
method, you might want to consider using theOrderTicket
object. When you create an order, you get anOrderTicket
object to manage your order. This object has several attributes that might be useful for your purpose, such asStatus
(which gets the current status of the order ticket),QuantityFilled
(which gets the total quantity filled for this ticket), andAverageFillPrice
(which gets the average fill price for this ticket).Here is an example of how you can use these attributes:
Please note that this is just a general guidance and you might need to adjust the code to fit your specific needs. For more detailed information, you can refer to the QuantConnect documentation.
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.
Gorkem
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!