From dfcab45eccf2d69500990e7d448ecad4517c9dfc Mon Sep 17 00:00:00 2001 From: Kernc Date: Wed, 22 Jan 2025 04:22:04 +0100 Subject: [PATCH] REF: Avoid further pandas resample offset-string deprecations Refs 551e7b00f9d533be217b6e4fc4b5caa40e84545b --- backtesting/_plotting.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/backtesting/_plotting.py b/backtesting/_plotting.py index 65cb4950..0d3cd9b4 100644 --- a/backtesting/_plotting.py +++ b/backtesting/_plotting.py @@ -105,18 +105,18 @@ def _maybe_resample_data(resample_rule, df, indicators, equity_data, trades): return df, indicators, equity_data, trades freq_minutes = pd.Series({ - "1T": 1, - "5T": 5, - "10T": 10, - "15T": 15, - "30T": 30, - "1H": 60, - "2H": 60*2, - "4H": 60*4, - "8H": 60*8, + "1min": 1, + "5min": 5, + "10min": 10, + "15min": 15, + "30min": 30, + "1h": 60, + "2h": 60*2, + "4h": 60*4, + "8h": 60*8, "1D": 60*24, "1W": 60*24*7, - "1M": np.inf, + "1ME": np.inf, }) timespan = df.index[-1] - df.index[0] require_minutes = (timespan / _MAX_CANDLES).total_seconds() // 60