Skip to content
All library documents

Filtering Rolling Backtest DataFrames by a Start Date

Article BigQuant

Summary

This short forum entry concerns an error in a data-merging function used for rolling backtests. The shown approach reads a DataFrame from each datasource, selects rows whose date is on or after a supplied cutoff, resets the index, and then combines the selected rows. It also derives start and end dates and a list of instruments for output metadata. The author notes that the earlier approach relied on the deprecated DataFrame indexing method `.ix` after setting a datetime index, and instead demonstrates filtering directly on the date column.

The post marks the issue as solved but gives no explanation of the underlying error, test case, or validation results. The displayed loop assigns each filtered result to the same variable and concatenates only after the loop, so it appears to retain only the final datasource’s rows rather than accumulate all inputs. Users adapting the example should check that their cutoff types match the date column and that every datasource contributes to the combined frame. This is data-preparation guidance, not a trading strategy or evidence about backtest performance.

Key ideas

  • The example filters each datasource to rows on or after its supplied date cutoff.
  • The author replaces an approach based on `.ix` with a comparison on the date column.
  • The output metadata records the resulting date range and instruments.
  • The shown loop overwrites its filtered-data variable, so it may keep only the last datasource.
  • The post reports a resolution without describing tests or confirming the merged output.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.