Skip to main content

๐Ÿ” 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:

st=Mtโˆ’Mtโˆ’1s_t = M_t - M_{t-1}

We then evaluate how often the next slope increases in absolute value:

pt=1ย ifย โˆฃst+1โˆฃ>โˆฃstโˆฃ,ย elseย 0p_t = 1 \text{ if } |s_{t+1}| > |s_t|, \text{ else } 0

Persistence is the fraction of those events:

P=โˆ‘ptNP = \frac{\sum p_t}{N}

๐Ÿ–ผ๏ธ Placeholder: Slope Continuation Illustration
Visual: line showing moving average with slope arrows; highlight periods where slope steepens.


Usageโ€‹

  1. Compute slope of a chosen smoothed feature (e.g., SMAโ‚โ‚€).
  2. Identify moments where โˆฃstโˆฃ|s_t| exceeds a threshold (e.g., top decile).
  3. Measure how often slope magnitude increases over the next HH bars.
  4. 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 NameDescription
slope_persistence_h1Probability slope increases next bar
slope_persistence_h3Probability slope increases within next 3 bars
slope_persistence_median_shiftMedian 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).