Counting Large Daily Gains with a Rolling Window
Summary
The document answers how to count the number of days on which a security’s daily gain exceeded 5% within a recent 90-day window. It proposes forming a daily indicator that is one when the close-to-previous-close return is above the threshold and zero otherwise, then summing that indicator over the window. The resulting feature is a rolling count of qualifying sessions.
This is a compact example of turning a trading condition into a time-series feature using conditional logic and a rolling sum. The note does not discuss how the feature should be used in a strategy, whether the window includes the current session, or how missing observations and corporate actions are handled. It provides no empirical testing or evidence about predictive value; the expression only describes how to calculate the count.
Key ideas
- A daily return threshold can be represented as a binary condition.
- Summing the binary condition over a rolling window counts qualifying sessions.
- The example uses a gain threshold of 5% and a window of 90 days.
- The document gives a feature-construction example, not evidence of trading performance.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.