While trying to track down a bug in my code, I noticed that the QC indicator values sometimes are quite a bit off from my other sources. I know that QC filter price data in their own way, so the price can be a little different. But what I noticed when comparing to TradingView, was that the price matched, but the indicators gave different values. For instance, NVDA (NVIDIA) on 2021-01-05:
- QC Price: 524.54
- TW Price: 524.54
- QC RateOfChangePercent(100): 14.67
- TW RateOfChangePercent(100): 17.24
EMA20 and EMA50 are also a bit off, but not as much.
ROC and EMA are simple calculations, so I don't understand why the results are different when the price data seems to be the same. I have double checked TradingViews indicator values using Pine Script, and they seem to be correct. TradingView is using bars (and not time periods) when calculating indicator values. I don't know if this is different in QC.
Any explanation?
Shile Wen
Hi Christian,
Please see this post for a few reasons indicators are different.
Best,
Shile Wen
Laurent Crouzet
Christian Piene Gundersen : As for EMA, discrepancies are a given, as even with the same raw data (closes of the bars for instance), what also matters is the FIRST data used in EXPONENTIAL Moving Averages: Tradingview and QC most probably did not use the same "first data", hence inevitable discrepancies.
To check that there are discrepancies of DATA using moving average, you would need to compute SIMPLE moving averages instead (SMA, not EMA)
As for Rate Of Change (ROC), the values should be the same IF prices are the same.
Maybe the older prices used to calculate the ROC are NOT the same, however: it can especially happen when data providers do not use the same data Data Normalization methodes, for instance. You might try using DataNormalizationMode.Adjusted and DataNormalizationMode.Raw
Hope this helps!
Christian Piene Gundersen
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!