Skip to content
All library documents

Filtering Backtest Buys After Large Opening Gaps

Article BigQuant

Summary

This forum exchange addresses how to skip a planned stock purchase when the stock opens more than 9% above its previous close. The suggested workflow is to add the opening price and prior close to the prediction dataset, merge those values with the predictions, and pass the combined data into the backtest module. A pre-market processing function can then compare the prices and apply a threshold rule before orders are placed.

The document gives an implementation outline and refers readers to an external code example, but it does not reproduce that example or explain the platform’s order-processing details. It therefore teaches the data flow and decision point, rather than providing a complete implementation. The gap threshold is the questioner's proposed condition; the exchange offers no performance evidence, testing results, or guidance on execution timing, missing prices, or whether the rule should apply to other order types.

Key ideas

  • Include opening and previous closing prices in the prediction data used by the backtest.
  • Merge price data with predictions before passing them to the backtest module.
  • Use pre-market processing to check the opening gap before placing a planned buy order.
  • The exchange outlines the approach but does not include a complete code example or performance evidence.

Tags

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