Counting Trading Days Since the Most Recent Moving Average Golden Cross
Summary
This discussion explains how to calculate the number of consecutive days since a moving average golden cross using BigQuant’s DAI functions. The suggested approach counts consecutive observations for which the golden-cross condition is false, including the current observation. That count can serve as a days-since measure after a cross has occurred.
The method has a boundary limitation: at the start of each stock’s available data partition, the previous cross may have occurred before the dataset begins. The count there is therefore only a lower bound, not a reliable elapsed time. The discussion proposes filtering out observations before the first detectable cross with a cumulative-cross condition. It is a concise implementation answer and gives no backtest, validation, or detail about how the moving averages define a cross.
Key ideas
- Count consecutive days without a golden cross to estimate time since the last cross.
- Include the current day in the count when using the suggested consecutive-count function.
- At the beginning of a stock’s data partition, the true prior cross may be outside the dataset.
- Filter for at least one observed cross to remove those initial uncertain counts.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.