Back

Major Discrepancies between Indicators from QC and other sites

Hi,

I've been trying to automate my strategies that I use in Oanda, but the technical indicator calculation is completely different, despite both sites (Oanda and QC) using the same formulas apparently. I'm probably doing something very wrong, but I can't get many indicators to line up correctly, even when importing data from Oanda. For example, the MACD is completely different than what i'm seeing on Oanda, and for that matter, other websites, that despite using different data sets, have similar calculations.

 

Here are the MACD (12,26,9) calculations that I see from Oanda, DailyFX/TradingView, and QC respectively.

As you can see, the differences between Oanda and DailyFX are miniscule, but very different in my QC backtests, even when I use Oanda's imported data. I ever so slightly modified the MACD template provided by the  Indicator Example threads, and have attached a backtest. Please let me know what i'm doing wrong (or if something is inherently not working) since the discrepancies are massive, and they do not let me test any of my strategies, with any resolution (EMA, MACD, or otherwise).

Update Backtest








Welcome @Josh! Alex looked into this and discovered we do daily bars differently to other platforms! We're looking around now to see what others do and we'll standardize our daily data.

Short explaination is the Oanda data is in UTC -- but the trading platfoms you listed above are in EST; so the daily OHLC values are totally different. You can test this yourself by using FXCM data which is in EST, or hourly data which isn't sensitive to daily timezones.

Once we find the industry standard we'll convert our daily data across.

0

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.


Thanks for the explanation Jared, although it still isn't lining up for me. The two pictures I attached were from Oanda and DailyFX/Tradingview, both of which are in UTC time (or at least they say they are, maybe the bars aren't consolidated that way), which should be the same as the Oanda data that I'm importing. The issue doesn't seem to be resolved when I switch to FXCM data, nor when I switch to hourly data unfortunately.
0

I quickly just threw together the same backtest plugging in FXCM and hourly, to compare to what I'm seeing in Oanda (in the bottom right it says im in UTC), and they look completely different. Is something wrong with my code this time or is it something else?

0


@Josh, your results look so different because you are comparing different variables. _macd.Fast is EMA(12) and _macd.Slow is EMA(26). The red and blue lines from the Oanda platform graph is our _macd and _macd.Signal:

Plot("MACD", _macd, _macd.Signal);

Like Jared said, hourly resolution backtests are not sensible to timezones. Here is a one-week period comparison: 

We are not beeing fooled by our eyes: when we check the actual values, they are quite similar.

Here is the daily comparison:

Like the hourly graphs, the results are not very different visually (similar using FXCM data). However, if we compare the values, their different is bigger if we compare with the hourly comparison.

Oanda and FXCM platforms consolidate their daily bars starting from 17 EST, thus their result are quite similar. Since we consolidate our data differently, it reflects on the indicators.

 

0

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.


Ah okay, thank you for the detailed explanation!
0

Update Backtest





0

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.


Loading...

This discussion is closed