Sell order occurred with the price never existed.
With equity TQQQ
stockPicked = self.AddEquity("TQQQ", Resolution.Minute)
stockPicked.SetDataNormalizationMode(DataNormalizationMode.Adjusted)
self.SetBrokerageModel(BrokerageName.InteractiveBrokersBrokerage, AccountType.Margin)
def OnData(self, data: Slice):
#....
self.SetHoldings(self.stock, percentage= 1, liquidateExistingHoldings=False, tag= "bb=" + str(self.bb.LowerBand.Current.Value))
Backtest Order executed on 2021-11-23 11 am at $81.223 (This is lower than the lowest price on the date)
But, according to Trading view the lowest price on the date is $81.41
Is this a bug? Or Did I configure something wrong?
Louis Szeto
Hi Terra
You're using adjusted price, which accounts for dividends and splits. Switch the DataNormalizationMode into DataNormalizationMode.Raw or DataNormalizationMode.SplitAdjusted before comparing.
Best
Louis
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.
Yuri Lopukhov
TradingView always shows split-adjusted prices, you can also switch dividend adjustment on/off in symbol settings. I suppose you have it off otherwise prices would match Adjusted mode.
Also, if you don't pay extra for NYSE/NASDAQ prices on TradingView, intraday prices are taken from CBOE One instead, this may also cause differences:
Terra Lim
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!