Update qtpylib from source

This commit is contained in:
Matthias 2019-06-26 19:59:57 +02:00
parent 31a2aac627
commit 1d5c3f34ae

View File

@ -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