Is anyone able to help me understand the differences between the ADX calculations in Tradingview vs. QC.
I am using consolidators and trying to align those using Time (making sure to account for differences in time zones) and am getting inconsistent results. Can anyone help me understand how I can resolve the issues? Ideally I'd like to be able to get the results from TV on QC (which I successfully did on TD's platform as well).
Thanks in Advance
Yuri Lopukhov
You need to consider quite a few things and you didn't provide any information on what data and timeframes you are using.Â
For example, for stock markets TradingView is using bars with different start/end times for timeframes > 30 minutes. E.g. for 1h timeframe first bar will be 9:30-10.30, and last bar will be 15:30-16:00. In QuantConnect hourly bars will be 9:30-10:00 (actually, 9:00-10:00), and 15:00- 16:00.
Also, unless you have purchased NASDAQ/NYSE for $3/month each, stock data in TradingView will be from CBOE BZX exchange, which may have different prices from NASDAQ/NYSE:
Echoes McCarthur
Hey Yuri, Thanks for the message. Sorry I left out details. Been focused on the code I was writing in the other post.
So yes I realize there are potential differences. But I'm not discussing realtime - only historical. I also had paid for the CME/CBOE datafeed from Tradingview. But the other point is that I had previously ported over the tradingview code to TD/Schwabs Think or Swim and they matched nicely (within a few hundredths or less of each other).
As for the time frames, as a continuation of thought from that post, I was referring to my consolidators that occur at 30 minute intervals (which is a timeframe that Tradingview also supports). Â I am a bit bogged down at the moment but I will try to get some matching historical data that shows what I am talking about. I'm not a great coder so the numbers from QC will be extracted in Debug after warmup but I'll get to that in a bit.Â
Â
Echoes McCarthur
We may have to chock this one up to user error. I'm still reviewing but considering the issues with my implementation, that may explain it. Will post again if I discover any issues of note.
Vijayananth M
Were you able to solve this issue? I am having similar discrepancies on the daily ADX between QC and tradingView. QC doesn't have smoothing factor, but trading view has smoothing factor. What is QC's method of smoothing factor?
Echoes McCarthur
I can't answer what the smoothing factor is but I was able to rectify most of the differences with a lot of extra code. It's not the best way but it involves basically calculating and resetting the ADX from a rolling window. So it's like manually updating the ADXs with a very long ADX warmup period ( like 5 to 7x the actual period of the ADX). Though I've not tried longer to see if they get closer. I now get +/- 1 or so on all 3 values in various time frames.Â
Echoes McCarthur
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!