๐ Slope Persistence
Question:
When a smoothed series (e.g., SMA, EMA) shows a steep slope, how likely is that slope to maintain or intensify over the next N bars?
Conceptโ
Slope persistence quantifies trend continuity โ it measures whether the rate of change in a smoothed price series tends to sustain or accelerate once it reaches a certain magnitude.
At each step:
We then evaluate how often the next slope increases in absolute value:
Persistence is the fraction of those events:
๐ผ๏ธ Placeholder: Slope Continuation Illustration
Visual: line showing moving average with slope arrows; highlight periods where slope steepens.
Usageโ
- Compute slope of a chosen smoothed feature (e.g., SMAโโ).
- Identify moments where exceeds a threshold (e.g., top decile).
- Measure how often slope magnitude increases over the next bars.
- Compare persistence across regimes such as:
- high vs. low volatility (ATR-based)
- different time windows
- rising vs. falling markets
This produces both global and conditional distributions โ showing how slope continuation behaves under different contexts.
Example Pseudocodeโ
df["sma"] = df["close"].rolling(10).mean()
df["slope"] = df["sma"].diff()
# Define "steep" slope threshold (e.g., 90th percentile)
S0 = df["slope"].abs().quantile(0.9)
mask = df["slope"].abs() > S0
# Compare with next bar's slope magnitude
df["next_slope"] = df["slope"].shift(-1)
persistence = (df.loc[mask, "next_slope"].abs() > df.loc[mask, "slope"].abs()).mean()
๐ผ๏ธ Placeholder: Distribution Comparison Chart Visual: two PDFs comparing slope persistence under different ATR regimes.
Distributional Interpretationโ
- The global distribution represents persistence rates across all conditions.
- Conditional distributions isolate contexts where slope continuation differs โ e.g., during high volatility or specific sessions.
This links directly to Conditional vs. Non-Conditional Studies and can be expressed as a distribution pipeline:
D0 = get_distribution("slope_persistence")
D1 = condition(D0, where="ATR_percentile > 0.8")
compare_distributions([D0, D1])
Potential Featuresโ
| Feature Name | Description |
|---|---|
slope_persistence_h1 | Probability slope increases next bar |
slope_persistence_h3 | Probability slope increases within next 3 bars |
slope_persistence_median_shift | Median difference between future and current slope magnitudes |
Notesโ
- High persistence often marks early-trend acceleration zones.
- Low persistence commonly appears in chop or exhaustion phases.
- Conditional analysis can reveal how persistence interacts with other metrics (ATR, RSI, funding, etc.).
- Persistence metrics can serve as both features (for regime classification) and signals (for entry/exit timing).