Skip to content

Commit

Permalink
REF: Avoid further pandas resample offset-string deprecations
Browse files Browse the repository at this point in the history
Refs 551e7b0
  • Loading branch information
kernc committed Jan 22, 2025
1 parent 78f5167 commit dfcab45
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions backtesting/_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dfcab45

Please sign in to comment.