Hello,
Assume that I add few types of data, i.e. equity from NYC, futures from Chicago, options etc.
So, when OnData(slice) is called with a new slice that contains all types of data, are they all synchronized? (in light of the time difference between NYC and Chicago)
Thanks,
Nathan
Mia Alissi
The
OnData
method in QuantConnect receives aSlice
object that groups all the data together at a single moment in time. This includes data from different asset classes and exchanges. TheSlice
object represents all of the data for your subscriptions at a single point in time, regardless of the source of the data. Therefore, the data from different exchanges and asset classes are synchronized in theSlice
object.However, it's important to note that the data is passed to the
OnData
method at the end time of the period. For example, if you've asked for minute data, it will emit at the end of the minute with data for the trailing minute.Here is an example of how you can access data in the
Slice
:In this example,
my_data
will contain the data for the symbol you are interested in, at the current point in time.Sources:
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.
Nathan Sela
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!