LEAN is the open source
algorithmic trading engine powering QuantConnect. Founded in 2013 LEAN has been built by a
global community of 80+ engineers and powers more than a dozen hedge funds today.
Alpha League Competition: $1,000 Weekly Prize Pool
Qualifying Alpha Streams Reentered Weekly Learn
more
I am really struggling to understand when events happen in this system. I am trying to implement a basic algo that operates as follows
1. 20 min before close (Using scheduled event fired 20min before the close) buy 100 shares.
2. After the close that day calculate the Stop and Target for next day(Using scheduled event)
In the logs there are several time stamps, one driven by the Debug command and one from my printing the Time of the slice I am accessing. These times do not line up in any manner, I see info from the day before printed after the infor triggered by the endofDay scheduled event.
Is there a good example of managing time in the algorithms?
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.
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.
Jing Wu
242.2k
,
The data timezone of equity is New York time. The default algorithm timezone is the New York time as well. For equity algorithm, the timestamp in the console and the slice.Time should be consistent. Please see the attached algorithm.
We can not repeat the same issue. Could you please share the algorithm if you still find the inconsistency in the time index?
0
Alexandre Catarino
,
Please share an algorithm (use the attach backtest button below) that shows the issue you are experiencing. This procedure helps us, the community, to answer your questions quickly and effectively.
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.
Loading...
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!