Im using a dailyCheck bool to set the opening price when i receive the first bar of the day, but when looking through backtests i found that on the morning of july 28th, 2023, instead of it setting to the current candles opening price, it sets it to the closing price of july 27th. I have checked that this works on roughly 60 other days and it seems to be completely fine. The only difference that ive noticed is that there was a gap up from 452.79 (which its returning) to 455.85. What is causing this?
Mia Alissi
Based on the information provided in the extracts, it seems like the issue you're experiencing might be related to how QuantConnect handles opening and closing prices. According to the documentation, the opening and closing price of the day is set by very specific opening and closing auction ticks. The official opening price for a stock is the opening auction on the exchange where it was listed.
In your case, it's possible that the opening price for July 28th, 2023, was set to the closing price of July 27th due to the gap up. This could happen if the opening auction price on the exchange was not available or was delayed for some reason, causing the algorithm to use the previous day's closing price as the opening price.
However, without seeing your code or having more specific information about the data and the algorithm you're using, it's difficult to provide a more precise answer. I would recommend checking your data source and the specific logic you're using to set the opening price in your algorithm. If you're using QuantConnect's data, you might want to reach out to their support or post a question on their forum for more help.
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.
Connor Brandenberger
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!