Hi experts,
Please feel free to point me to an existing post/answer for my question.
I found that the default Stockplot is not accurate with one-day shifted close prices. For example, I built a sample algo that buys and sells SPY based on daily change. I have a custom plot for OHLC for comparison.
As you can see in my sample below, in the default Stockplot, the close price on Apr 18 2018 doesn't match with my custom plot (purely OHLC). In the default Stockplot, the close price $267.65 on Apr 18 is in fact the close price of Apr 19, hence it's shifted one day forward.
Does anyone know why?
Gurumeher Sawhney
When using daily resolution, the TradeBar data references the day before's OHLC prices because that was the last complete TradeBar. And because this is the data in the algorithm, there will be a one day shift forward. Hence, the stockplot above is showing the expected behavior. Most plotting websites show bars as points without a period, whereas in QuantConnect all our data also has an associated period.
Hugo Lu
I am having a similar problem and cannot work out why my plots are so different to the stockplots - I am having trouble with the following symbols:
GOOGL
AZN (I am confused; I thought this would pull me the AstraZeneca listed shares but then the stockplot I get suggested is for ZEN which is some random company called ZenDesk)
Â
I can replicate the one day lag when doing the code attached for SPY.
Â
Thanks
Hugo
Jonathan Chen
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!