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:
|
else:
|
||||||
res = rolling_mean(tr, window)
|
res = rolling_mean(tr, window)
|
||||||
|
|
||||||
res = pd.Series(res)
|
return pd.Series(res)
|
||||||
return (res.shift(1) * (window - 1) + res) / window
|
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------
|
# ---------------------------------------------
|
||||||
@ -602,6 +601,14 @@ def pvt(bars):
|
|||||||
bars['close'].shift(1)) * bars['volume']
|
bars['close'].shift(1)) * bars['volume']
|
||||||
return trend.cumsum()
|
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.stoch = stoch
|
||||||
PandasObject.zscore = zscore
|
PandasObject.zscore = zscore
|
||||||
PandasObject.pvt = pvt
|
PandasObject.pvt = pvt
|
||||||
|
PandasObject.chopiness = chopiness
|
||||||
PandasObject.tdi = tdi
|
PandasObject.tdi = tdi
|
||||||
PandasObject.true_range = true_range
|
PandasObject.true_range = true_range
|
||||||
PandasObject.mid_price = mid_price
|
PandasObject.mid_price = mid_price
|
||||||
|
Loading…
Reference in New Issue
Block a user