mirror of
https://github.com/wassname/pandas-ta.git
synced 2026-08-15 12:45:08 +08:00
BUG atr and true_range calculation fix
This commit is contained in:
+2
-2
@@ -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
File diff suppressed because one or more lines are too long
@@ -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)
|
||||
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user