Hello. I am trying to map my chart/series plot data locally. The X values in the Charts property of [algorithmid].json file don't seem to correlate straight over to a time within the start/end time bounds of my backtest.
For example, I am running a backtest for the month of July; 7/1/2022 - 7/31/2022. In [algorithmid].json file, Charts > Strategy Equity property, the first value is {"x": 1656648000, "y": 100000.0}. Converting 1656648000 to Unix time millis, it is Tue Jan 20 1970 04:10:48, which isn't a time within my start/end time. The very last Strategy Equity X value, 1659128400, converts to Tue Jan 20 1970 04:52:08, so it doesn't make sense as a timespan since the start of my backtest, as the first and last values aren't even an hour apart.
How do I map these X values to a point in time within my backtest?
Nico Xenox
Hey @midaroh
If I understand correctly you have a problem converting timestamp into normal datetime. For this you can use:
Note: ‘1656648000’ is Fri Jul 01 2022 04:00:00 GMT+0000 so the first unix timestamp value is indeed July 7/1/2022 and ‘1659128400’ is Fri Jul 29 2022 21:00:00 GMT+0000.
Nico Xenox
Sry about that heres the C#
Midaroh
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!