technical icon indicating copy to clipboard operation
technical copied to clipboard

ATR differences

Open 2W-12 opened this issue 4 years ago • 4 comments

There is still ATR differences with TradingView built-in indicator. Following issue https://github.com/freqtrade/technical/issues/26 when it was fixed, now there is difference again.

2W-12 avatar Jan 07 '21 11:01 2W-12

who defined the tradingview implementation as the "correct" one? This indicator has an original author (as do most others) - implementations should try to follow this formula, not the implementation of a random, closed source tool.

If tradingview deviates from the original author, you should ask them for "their" formula, so an "atr_tradingview" might be added.


That said - ATR is "vendored" from qtpylib (you'll see this from the location of the function / file containing this function).

This means, it's basically a 1:1 copy of the file from qtpylib (with some style changes to make flake pass). If you think it's wrong (based on the original author spec though), an issue should be opened there.

I don't think we should make deviations in our copy of the file (other than stylistic changes) to keep the update-process simple (should their file be updated) - unless we determine for sure that qtpylib (and the indicators provided by it) are no longer supported (confirmation by the original author, basically), in which case we can add a comment specifying that it's now "our" version, no longer kept uptodate with eventual changes in qtpylib.

Feel free to investigate further and propose a PR improving the calculation - personally, i'll not have time to work on this in the forseeable future - mainly because these investigations very often take hours or days - and determining "the correct way" is not straightforward anyway.

xmatthias avatar Jan 07 '21 13:01 xmatthias

I mentioned clearly 'built-in' indicator. NOT written by 3rd party. As TradingView nowadays used almost by everyone I believe many people relay on it. And it was discussed already in https://github.com/freqtrade/technical/issues/26 So it's good for all of us to find out what's issue now.

2W-12 avatar Jan 07 '21 13:01 2W-12

You said Tradingview Builtin. This does NOT mean that the indicator is correct based on the original author - but tradingview could've modified the formula (slightly or fully).

So it's good for all of us to find out what's issue now.

Yes, please let us know what the correct calculation should be once you found out.

xmatthias avatar Jan 07 '21 14:01 xmatthias

https://github.com/freqtrade/technical/issues/89#issuecomment-640200966

I guess 3 different atr calculation codes have been added. Maybe it works for you

acemi1 avatar Jan 10 '21 01:01 acemi1