🌾 Slope Distribution Fan
Core Question:
Given the current slope magnitude and direction,
what is the historical distribution of slope values over the next N bars?
🧭 Concept
The Slope Distribution Fan measures the conditional likelihoods of future slope values, conditioned on the current slope.
It answers questions like:
“When the current slope is +0.15, what distribution of slopes historically followed over the next 1, 2, or 3 bars?”
This creates a “fan” of possible slope outcomes — a probabilistic envelope that describes how slope typically evolves.
🖼️ Placeholder: Distribution Fan Visualization
Visual: central slope at time t, with multiple translucent curves fanning out to show slope distributions at +1, +2, +3 bars.
🔢 Mathematical Definition
Let be the slope of a smoothed price series (e.g., SMA or EMA).
For each observation , collect the next N slope values:
Group all observations by current slope bin (e.g., rounded or quantized values),
and compute the empirical distributions of future slopes within each bin:
for horizons .
Each horizon forms one layer of the “fan.”
⚙️ Usage
- Compute slopes from your smoothed series.
- Define current-slope bins (e.g., quantiles or fixed-width buckets).
- For each bin:
- Collect all subsequent slope values up to horizon N.
- Record the empirical distribution .
- Visualize or summarize these conditional distributions.
🖼️ Placeholder: Workflow Diagram
Visual: pipeline showing “Compute slope → Group by slope bin → Aggregate future slopes → Plot fan.”
💡 Example (Pseudocode)
import pandas as pd
import numpy as np
df["sma"] = df["close"].rolling(10).mean()
df["slope"] = df["sma"].diff()
H = 3 # lookahead horizon
bins = np.linspace(df["slope"].min(), df["slope"].max(), 20)
df["slope_bin"] = pd.cut(df["slope"], bins=bins)
records = []
for h in range(1, H + 1):
df[f"slope_future_{h}"] = df["slope"].shift(-h)
grouped = df.groupby("slope_bin")[f"slope_future_{h}"].describe()
grouped["horizon"] = h
records.append(grouped)
fan = pd.concat(records)
🖼️ Placeholder: Code Output Visualization Visual: heatmap showing slope_bin (y-axis) vs. horizon (x-axis) with color for mean or median future slope.
📈 Distributional Interpretation
Each horizon defines its own conditional slope distribution:
| Horizon | What It Describes | Visualization |
|---|---|---|
| +1 | Immediate slope reaction | Narrow distribution; high autocorrelation |
| +2 | Short-term continuation/decay | Broader fan; transitional dynamics |
| +3+ | Medium-term reversion or persistence | Widest spread; slope “fan” shape visible |
This lets you ask:
- How does slope persistence vary with slope magnitude?
- Do extreme slopes tend to revert faster?
- How asymmetric is the fan (e.g., more downside slope expansion than upside)?
🖼️ Placeholder: Multi-Layer PDF Chart Visual: multiple probability curves fanning out with horizon.
🧮 Feature Outputs
| Feature | Description |
|---|---|
slope_fan_mean_h1 | Mean of slope distribution at +1 bar given current slope |
slope_fan_std_h1 | Standard deviation at +1 bar |
slope_fan_median_h3 | Median slope at +3 bars |
slope_fan_skew_h2 | Skewness of slope distribution at +2 bars |
slope_fan_decay_rate | Rate of slope mean reversion with horizon |
These features describe the shape and decay of slope behavior through time.
🖼️ Placeholder: Feature Heatmap Visual: table or heatmap of mean/variance/skew by slope bin and horizon.
📊 Relation to Slope Persistence
- Slope Persistence measures whether slopes tend to continue increasing in magnitude.
- Slope Distribution Fan shows how the entire distribution shifts as a function of current slope.
Persistence is a binary or threshold-based view. The fan is a continuous, probabilistic one — effectively a richer, distributional generalization.
🖼️ Placeholder: Comparison Illustration Visual: slope persistence (single line) vs. slope fan (band of probabilities).
🧩 Integration With Conditional Studies
Slope Distribution Fans can themselves be computed under conditional contexts — e.g., high ATR, specific trading sessions, or RSI zones. Each condition produces a different deformation of the fan’s shape.
| Mode | Description |
|---|---|
| Global | across all data |
| Conditional | under condition C |
| Comparative | Difference or KL-divergence between conditional and global fans |
🖼️ Placeholder: Conditional Fan Comparison Visual: overlapping contour plots showing fan widening/narrowing by regime.
🧠 Notes
- The slope fan is not predictive in isolation — it’s descriptive of conditional dynamics.
- When integrated into a feature pipeline, it can inform forecast uncertainty or expected directional persistence.
- The fan can also be viewed as a distributional regression surface over slope magnitude × horizon.
Summary: The Slope Distribution Fan visualizes how slope values historically evolve after a given slope magnitude. It transforms slope behavior into a multi-horizon likelihood field — a richer way of understanding trend momentum, decay, and variability.
🖼️ Placeholder: Summary Visualization Visual: composite graphic showing slope bins, fan expansion, and persistence overlay.
Comments
No comments yet. Be the first!