running Lean using CLI and importing data using csv's
- when I look at the trades json file the “EntryTime” matches the imported bar time with the correct UTC offset.
- when I look at bar.time it matches the json EntryTime minus the UTC offset.
- if I print “bar.Time + time_change” it again matches the “EntryTime”
local = self.algo.Securities[self.security].Exchange.LocalTime.replace(tzinfo=None)
utc = self.algo.UtcTime.replace(tzinfo=None)
time_change = utc - local
****THE PROBLEM****
4. when I print self.algo.UtcTime ONLY I always get the time that is 1 bar interval ahead… I would think that this would print the same time as EntryTime but it is always EntryTime + 1 time interval… IE if EntryTime is 16:00 Utctime is always 16:30 since 1 time interval is 30 minutes.
is there a reason for this?
Varad Kabade
Hi Mathew Blonc,
The entry time mentioned above is the bar start time, so the algorithm time would be the bar end time. Refer to the following doc for more information on understanding time in Lean/QC.
Best,
Varad Kabade
Mathew Blonc
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!