Hello, I'm new to QC and I'm trying to familiarize myself with some of the content by plotting, however, some of the indicators give different outputs than on TradingView and Yahoo Finance. Now I understand that this is a relatively common question, and have looked into other posts and have tried to test some of the solutions, but I must be implementing it wrong because the output is still just so off (often higher than 50%).
Some of the posts I've looked at:
Post 1: Tried implementing both solutions, nothing (lines 15-19 and 53-54)Post 2: I'm 60% sure this is where my problem is, specifically with how TV and YF consolidate candles differently than QC, however, if this is the problem, I don't know how to fix it, like would I have to subscribe to hourly data them consolidate them into daily points?Post 3: This is also likely the cause of an issue, but the outputs are just too different (Specifically RSI and MACD) for this to be a slight difference.
Aug 14 Data For Reference
TV Aug 14 Data For Reference:MACD: 2.83Signal: 4.50RSI: 43.26Open: 444.7 High: 448.11 Close: 448.11 Low: 444.38
I would be very appreciative to anyone who would help me solve this (and any bonus tips, this stuff is so interesting but so daunting at the same time)
Mia Alissi
Based on the information provided in the extracts, it seems that 'Kyle' is having trouble with the output of some indicators in QuantConnect not matching those on TradingView and Yahoo Finance. This could be due to differences in how these platforms handle data consolidation and calculate indicators.
In QuantConnect, you can use the
Consolidate
method to consolidate data into a custom resolution. For example, if you want to consolidate minute data into daily data, you can use theTradeBarConsolidator
class as shown in the extract from the Custom Resolutions documentation:You can then attach a handler method to feed data into the consolidator and update the indicator with the consolidated bars:
When the consolidator receives 7 days of data, the handler generates a 7-day
TradeBar
and updates the indicator.However, it's important to note that different platforms might use different methods for data consolidation and indicator calculation, which could result in discrepancies in the output. For example, as mentioned in the extract from the forum discussion, the values of indicators calculated with and without consolidation can differ.
In terms of the code provided by 'Kyle', it seems to be correctly implementing the RSI, MACD, and Bollinger Bands indicators, as well as data consolidation. However, without more specific information about the discrepancies 'Kyle' is observing, it's difficult to provide more targeted advice. It might be helpful for 'Kyle' to compare the specific calculations and parameters used by QuantConnect, TradingView, and Yahoo Finance for the indicators in question.
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.
Louis Szeto
Hi Kyle
I'm not sure why you get a charting point for 14 August since it should be that of the 12 August. Please be aware that you're subscribing Resolution.Daily data, which is aggregated at 00:00 of the next day. This means the 12 August charting point is actually referring to 11 August trading day's data. I saw you have set the data normalization mode to Raw and properly warmed up the indicators already. If you put that against the 11 August data, you'll find match.
As for the 14 August trading day, you should find charting point of 15 August 00:00:
The MACD and OHLC are close-matching. Note that the EMA is sensitive to the starting point of the algorithm, so it won't be an exact match with TV. But given the long running time (from 2020), the value should be close.
The RSI value is off, we're not sure about the script of TV but lean sticks with ta-lib's implementation. I don't have additional quota to check the BB, but you may do similar contrast.
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.
Kyle Pontius
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!