resample_dataframe#

API documentation for tradingstrategy.utils.groupeduniverse.resample_dataframe Python function.

resample_dataframe(df, resample_freq, shift=None)[source]#

Resample a DataFrame to a lower frequency. Use this when your dataframe is not OHLCV candles. e.g. when using pandas_ta.bbands, your returned columns could be BBU_5_2.0, BBM_5_2.0, BBL_5_2.0, clearly not candlestick data

Parameters:
  • df (DataFrame) – DataFrame to resample

  • resample_freq (Timedelta) – Resample frequency

  • shift (int | None) – Shift the resampled data by a certain number of candles

Returns:

Resampled DataFrame