mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 18:23:55 +00:00
Merge pull request #1972 from freqtrade/update_qtpylib
Update qtpylib from source
This commit is contained in:
commit
596cee2dc1
12
freqtrade/vendor/qtpylib/indicators.py
vendored
12
freqtrade/vendor/qtpylib/indicators.py
vendored
|
@ -213,8 +213,7 @@ def atr(bars, window=14, exp=False):
|
|||
else:
|
||||
res = rolling_mean(tr, window)
|
||||
|
||||
res = pd.Series(res)
|
||||
return (res.shift(1) * (window - 1) + res) / window
|
||||
return pd.Series(res)
|
||||
|
||||
|
||||
# ---------------------------------------------
|
||||
|
@ -602,6 +601,14 @@ def pvt(bars):
|
|||
bars['close'].shift(1)) * bars['volume']
|
||||
return trend.cumsum()
|
||||
|
||||
|
||||
def chopiness(bars, window=14):
|
||||
atrsum = true_range(bars).rolling(window).sum()
|
||||
highs = bars['high'].rolling(window).max()
|
||||
lows = bars['low'].rolling(window).min()
|
||||
return 100 * np.log10(atrsum / (highs - lows)) / np.log10(window)
|
||||
|
||||
|
||||
# =============================================
|
||||
|
||||
|
||||
|
@ -629,6 +636,7 @@ PandasObject.rsi = rsi
|
|||
PandasObject.stoch = stoch
|
||||
PandasObject.zscore = zscore
|
||||
PandasObject.pvt = pvt
|
||||
PandasObject.chopiness = chopiness
|
||||
PandasObject.tdi = tdi
|
||||
PandasObject.true_range = true_range
|
||||
PandasObject.mid_price = mid_price
|
||||
|
|
Loading…
Reference in New Issue
Block a user