Checking how pulling prices work in OnData and Shdeduled functions, I noticed that prices (at least in case of SPY) are not correct. Say in attached Backtest, the price of SPY on 21-Mar-2017 at 09;40 is 236.35, while actual was 237.42 .. It looks like adjusted by dividends price, but my resolution is 1 min .. I tried other dates with similar issue. Could you help please?
And one more question. It seems that Scheduled fuctions have priority in action before OnData? Say, if my scheduled function fires at 15:45, OnData main function will start after that at 9:30 same day ?
Thank you!
Alexandre Catarino
The prices are correct. By default, the prices are adjusted in QuantConnect for all resolutions.
If we want Raw prices, we need to set the data normalization mode for each equity:
equity = self.AddEquity("SPY", Resolution.Minute) equity.SetDataNormalizationMode(DataNormalizationMode.Raw)
Yes, Schedule Events events are triggered before OnData.
Iouri Verchok
Thank you, got it
Iouri Verchok
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!