Hello,
I'm testing MACD, Directional Moving Index (ADX) and EMA indicators.
When I check the values with tradingview's, indicator values do not match.
I am using tradingview coinbase bitcoin chart and using same brokerage on quantconnect too.
tradingview chart;
https://www.tradingview.com/chart/H4oXSPJK/?symbol=COINBASE%3ABTCUSD
I attached backtest.
Thanks
Fred Painchaud
Hi Bahadir,
It may be because TV does not use adjusted data but QC does, since your QC indies look properly set. Have you tried to use SetDataNormalizationMode(). Ref:
Fred
Bahadır Uzel
Hi Fred,
İf I added equity it can be but I worked with bitcoin. Also I checked the 4 hour close prices and it looks almost same with tradingview
Vladimir
Bahadır Uzel,
I think if we will add 5 times more data for warm-up (to mature Exponential Moving Average) , the results will be very close.
Try to test using this code.
Fred Painchaud
Hi Bahadir,
Yes indeed.
1- Are you using the same data source on TV or maybe you use Binance?
2- Moreover, on TV, consolidation can be done differently.
3- Sure thing is that “warmup” on TV is totally different and is done with just the number of bars “necessary” (like 12 for an EMA12).
4- Finally, in QC, the last warmup bar is re-passed to the indicator while on TV it is not.
I see very little reason to compare numbers between QC and TV, IMHO, as most indicators developed on TV “repaints” anyway and cannot even be backtested and live traded as-is with a performance while “live” expected to be similar to the one in backtesting. Just saying…
Cheers,
Fred
Vladimir
Bahadır Uzel,
I think if we will add 5 times more data for warm-up (to mature Exponential Moving Average) , the results will be very close.
Try to test using this code.
Bahadır Uzel
Hi Vladimir and Fred Painchaud
I've been away from the coding for a while so sorry for late answer.
I changed minutes=240 instead of hours=4 but the result did not change.
I don't think the difference in values is due to warming up period
Maybe Fred Painchaud is right; we shouldn't compare two different platforms.
But my concern is same strategy is giving buy and sell signals at different bars on different platforms.
TV is a big data provider and a lot of people trade with TV data and indicators.
In live trading this can be a huge problem.
Thanks
Vladimir
Bahadır Uzel,
Please try to test one more time using this code.
I am sure the results will be much closer than with your original algorithm.
Yuri Lopukhov
Hi, Bahadır Uzel try changing EMA to SMA here and on TradingView. If you get matching results, the problem is in different way both platforms calculate EMA, as it was explained in the Fred's answer:
>3- Sure thing is that “warmup” on TV is totally different and is done with just the number of bars “necessary” (like 12 for an EMA12).
Vladimir
Bahadır Uzel,
Did you have a chance to try what I recommended?
The indicators you have tested use exponential moving average or other recursive filters, also known in digital signal processing as infinite impulse response (IIR) filters.
It is known that the maturation of IIR filters requires 5-7 times more warm-up time than the indicator period.
If TradingView does not use this rule, it makes sense to talk about it on the TradingView forum, not here.
Bahadır Uzel
Hi Vladimir,
I tested 5 times and 7 times more warm-up than the indicator period and compare the results.
Warming up with indicator periods and 5 times warming up gives different results as you say.
5 and 7 times results are same and values are almost same with TradingView values :)
Thanks for help and explanation.
Bahadır Uzel
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!