BUG atr and true_range calculation fix

This commit is contained in:
Kevin Johnson
2020-03-17 09:17:06 -07:00
parent 71e9282d8f
commit a1dac5922f
4 changed files with 158 additions and 149 deletions
+2 -2
View File
@@ -126,7 +126,6 @@ examples/ib_trader.ipynb
examples/example2.ipynb
setup.cfg
.README.md
README
note.md
driver.py
doc.py
@@ -141,4 +140,5 @@ qd.py
simple.ipynb
# Indicator
pandas_ta/overlap/ft.py
pandas_ta/overlap/ft.py
pandas_ta/overlap/psar.py
+154 -145
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -13,7 +13,7 @@ def true_range(high, low, close, drift=None, offset=None, **kwargs):
# Calculate Result
prev_close = close.shift(drift)
ranges = [high - low, high - prev_close, low - prev_close]
ranges = [high - low, high - prev_close, prev_close - low]
true_range = DataFrame(ranges).T
true_range = true_range.abs().max(axis=1)
+1 -1
View File
@@ -6,7 +6,7 @@ long_description = "An easy to use Python 3 Pandas Extension with 80+ Technical
setup(
name ="pandas_ta",
packages =['pandas_ta', 'pandas_ta.momentum', 'pandas_ta.overlap', 'pandas_ta.performance', 'pandas_ta.statistics', 'pandas_ta.trend', 'pandas_ta.volatility', 'pandas_ta.volume'],
version ="0.1.37b",
version ="0.1.38b",
description =long_description,
long_description =long_description,
author ="Kevin Johnson",