Hi QuantConnect Support Team,
I’m running live algorithms that trade U.S. equities in the America/New_York time-zone.
I’ve noticed that the automatically generated “New Order Event:” lines in the Live Logs always show the timestamp in UTC, whereas all timestamps produced by my own code (self.Log, bar.EndTime, self.Time, etc.) are in America/New_York (EDT/EST).
That four-hour gap (UTC − 4) is confusing when reviewing fills in real time and during post-trade analysis.
I understand from the forums and the source that the New Order Event: trace is emitted in Lean.Engine.TransactionHandlers.BrokerageTransactionHandler and hard-coded to UTC.
Questions / Feature Requests
Can we choose the time-zone for the New Order Event line (e.g., inherit Algorithm.TimeZone or a user setting), or at least have a flag to output both UTC and local?
Is there a way to suppress this automatic UTC line entirely and rely only on the timestamps I generate in OnOrderEvent?
If neither is currently possible, would you consider adding an option in the Live tab (or project configuration) to keep log timestamps consistent?
Thank you for your help!
Mia Alissi
Here is an example you can use to supplement or replace the automatic UTC "New Order Event" line in your algorithm. This code will help ensure your logs show order event information in the same time zone as the rest of your algorithm (America/New_York), making post-trade analysis and real-time monitoring consistent and clear.
How this helps you:
self.time
value is always in the algorithm's time zone (e.g., America/New_York if you set it withself.set_time_zone('America/New_York')
).self.debug
,self.log
, etc.) to remain in your preferred time zone for easy correlation with your data and UI.Limitations / Feature Requests:
Let me know if you’d like a template for such a feature request, or additional code examples!
Sources: docs writing algorithms key concepts time modeling time zones, Logging - QuantConnect.com, Handling Data - QuantConnect.com, Time In Force Algorithm, Charting and Logging - QuantConnect.com
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.
Trader Ostburg
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!