Merge pull request #2858 from freqtrade/fix/rolling_max

Fix implementation of rolling_max
This commit is contained in:
hroff-1902 2020-02-04 14:05:05 +03:00 committed by GitHub
commit f5fb129483
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -288,9 +288,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:
return series.rolling(window=window, min_periods=min_periods).min()
return series.rolling(window=window, min_periods=min_periods).max()
except Exception as e: # noqa: F841
return pd.Series(series).rolling(window=window, min_periods=min_periods).min()
return pd.Series(series).rolling(window=window, min_periods=min_periods).max()
# ---------------------------------------------