bugfix
This commit is contained in:
parent
2b74982a1d
commit
61f92b7460
50
freqtrade/vendor/qtpylib/indicators.py
vendored
50
freqtrade/vendor/qtpylib/indicators.py
vendored
@ -248,45 +248,34 @@ def crossed_below(series1, series2):
|
||||
|
||||
def rolling_std(series, window=200, min_periods=None):
|
||||
min_periods = window if min_periods is None else min_periods
|
||||
try:
|
||||
if min_periods == window:
|
||||
return numpy_rolling_std(series, window, True)
|
||||
else:
|
||||
try:
|
||||
return series.rolling(window=window, min_periods=min_periods).std()
|
||||
except BaseException:
|
||||
return pd.Series(series).rolling(window=window, min_periods=min_periods).std()
|
||||
except BaseException:
|
||||
return pd.rolling_std(series, window=window, min_periods=min_periods)
|
||||
|
||||
if min_periods == window and len(series) > window:
|
||||
return numpy_rolling_std(series, window, True)
|
||||
else:
|
||||
try:
|
||||
return series.rolling(window=window, min_periods=min_periods).std()
|
||||
except BaseException:
|
||||
return pd.Series(series).rolling(window=window, min_periods=min_periods).std()
|
||||
|
||||
# ---------------------------------------------
|
||||
|
||||
def rolling_mean(series, window=200, min_periods=None):
|
||||
min_periods = window if min_periods is None else min_periods
|
||||
try:
|
||||
if min_periods == window:
|
||||
return numpy_rolling_mean(series, window, True)
|
||||
else:
|
||||
try:
|
||||
return series.rolling(window=window, min_periods=min_periods).mean()
|
||||
except BaseException:
|
||||
return pd.Series(series).rolling(window=window, min_periods=min_periods).mean()
|
||||
except BaseException:
|
||||
return pd.rolling_mean(series, window=window, min_periods=min_periods)
|
||||
|
||||
if min_periods == window and len(series) > window:
|
||||
return numpy_rolling_mean(series, window, True)
|
||||
else:
|
||||
try:
|
||||
return series.rolling(window=window, min_periods=min_periods).mean()
|
||||
except BaseException:
|
||||
return pd.Series(series).rolling(window=window, min_periods=min_periods).mean()
|
||||
|
||||
# ---------------------------------------------
|
||||
|
||||
def rolling_min(series, window=14, min_periods=None):
|
||||
min_periods = window if min_periods is None else min_periods
|
||||
try:
|
||||
try:
|
||||
return series.rolling(window=window, min_periods=min_periods).min()
|
||||
except BaseException:
|
||||
return pd.Series(series).rolling(window=window, min_periods=min_periods).min()
|
||||
return series.rolling(window=window, min_periods=min_periods).min()
|
||||
except BaseException:
|
||||
return pd.rolling_min(series, window=window, min_periods=min_periods)
|
||||
return pd.Series(series).rolling(window=window, min_periods=min_periods).min()
|
||||
|
||||
|
||||
# ---------------------------------------------
|
||||
@ -294,12 +283,9 @@ def rolling_min(series, window=14, min_periods=None):
|
||||
def rolling_max(series, window=14, min_periods=None):
|
||||
min_periods = window if min_periods is None else min_periods
|
||||
try:
|
||||
try:
|
||||
return series.rolling(window=window, min_periods=min_periods).min()
|
||||
except BaseException:
|
||||
return pd.Series(series).rolling(window=window, min_periods=min_periods).min()
|
||||
return series.rolling(window=window, min_periods=min_periods).min()
|
||||
except BaseException:
|
||||
return pd.rolling_min(series, window=window, min_periods=min_periods)
|
||||
return pd.Series(series).rolling(window=window, min_periods=min_periods).min()
|
||||
|
||||
|
||||
# ---------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user