Analogue Forecast PRO [EXCAVO]

Regression-Based Historical Analogue Search with Dual Candle Projection
The Analogue Forecast PRO searches historical data for periods where the
price regression slope closely matches the current slope, then projects the
subsequent price action forward as candle-style visualization. In Dual mode,
it simultaneously shows both a bullish and bearish analogue — what happened
when a similar slope led to an upward move, and what happened when it led
to a downward move.
Unlike correlation-based pattern matchers that compare raw price sequences,
this indicator matches the underlying trend direction and steepness through
linear regression slope comparison. Two slopes can match even if the absolute
price levels and candle shapes are different — what matters is the rate of
change.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ HOW TO USE
Step 1 → Add the indicator. Semi-transparent projected candles appear
to the right of the current bar — blue for bullish analogue,
red for bearish.
Step 2 → In Dual mode, both projections are visible. Compare the two
scenarios to see where historical analogues diverge.
Step 3 → Check confidence in the dashboard. Higher % means the
historical slope matched more closely and the regression
fit was similar.
Step 4 → Adjust Slope Tolerance for stricter or looser matching.
Lower values find fewer but more precise analogues.
Step 5 → Increase Search Depth to scan more history (up to 4000 bars).
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ HOW IT CALCULATES
◆ Linear Regression on Price vs Time
The indicator computes a rolling linear regression of close price against
time over a configurable window. The key outputs are:
slope = covariance(close, time) / variance(time)
R² = pearson_correlation² (goodness of fit)
The slope represents the rate of price change per unit of time. R²
measures how well the linear model fits the price data.
◆ Slope Matching
For each historical position within the search depth, the indicator
compares that position's regression slope to the current slope:
match = abs(current_slope - historical_slope) <= tolerance
Only positions where the slope difference is within tolerance are
considered. Among matching positions, the one with the smallest
difference is selected.
◆ Dual Mode Selection
In Dual mode, two separate matches are tracked — one where price moved
upward after the match point (bullish analogue) and one where it moved
downward (bearish analogue). Each is the closest slope match within its
direction category.
◆ Confidence Scoring
Confidence uses a weighted geometric mean of slope proximity and R²
agreement with power-adjusted sensitivity:
slope_prox = max(0, 1 - (slope_diff / tolerance)^0.8)
r2_agree = max(0, 1 - abs(current_R² - historical_R²)^1.2)
confidence = sqrt(slope_prox × r2_agree) × 100%
Higher confidence means both the trend steepness and the regression
quality of the historical period closely match current conditions.
◆ Source Highlight
When a match is found, the historical candles used as the source are
highlighted with a dashed border box on the chart. Blue dashed box marks
the bullish source, red marks the bearish source. This shows exactly
where in history the analogue was detected.
◆ Candle Projection
The historical price action following the matched position is scaled to
the current price level and drawn as projected candles:
scale = current_close / matched_close
projected_OHLC = historical_OHLC × scale
Each projected bar is drawn as a box (body) and a line (wick), preserving
the candle structure of the original historical movement.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ WHAT MAKES IT DIFFERENT
◆ Slope-Based Matching
Most pattern matchers compare price shapes (correlation, DTW, etc.). This
indicator matches the underlying trend rate via linear regression slope.
A steep uptrend at $20,000 matches a steep uptrend at $100,000 — it is
the gradient that matters, not the shape or level.
◆ Dual Scenario Projection
Instead of showing one forecast, Dual mode presents both outcomes. The
same slope can lead to continuation or reversal — seeing both projections
simultaneously provides context for what historically followed similar
trend conditions in both directions.
◆ Candle-Style Visualization
Projected price action is rendered as semi-transparent candles (body boxes
and wick lines) rather than a simple line. This preserves the volatility
structure of the historical period — the projected candle ranges show how
wide the bars were, not just where price ended.
◆ Source Pattern Highlight
The historical candles that serve as the source for each projection are
highlighted with a dashed border box directly on the chart. This makes the
analogue transparent — you can scroll back and see exactly which period
the indicator matched and what happened next.
◆ Regression Quality Filter
The confidence score incorporates R² from both current and historical
periods. A match where both periods have high R² (strong trend) is scored
higher than a match where the regression fit was weak (choppy conditions).
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ DASHBOARD
Real-time panel (configurable position) with key metrics:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ SETTINGS
Search
Visualization
Dashboard
Alert Settings
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ ALERTS
JSON payloads include mode, confidence scores (bull/bear or single), ticker, price, and timeframe.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
This indicator is published as invite-only. The protected source contains
the regression-based slope matching engine, the dual scenario selection
logic, the scaled candle projection system, the source pattern highlight,
and the confidence scoring formula. These components represent original methodology.
The description above provides full transparency on what the indicator calculates and how.
Best regards,
EXCAVO
The Analogue Forecast PRO searches historical data for periods where the
price regression slope closely matches the current slope, then projects the
subsequent price action forward as candle-style visualization. In Dual mode,
it simultaneously shows both a bullish and bearish analogue — what happened
when a similar slope led to an upward move, and what happened when it led
to a downward move.
Unlike correlation-based pattern matchers that compare raw price sequences,
this indicator matches the underlying trend direction and steepness through
linear regression slope comparison. Two slopes can match even if the absolute
price levels and candle shapes are different — what matters is the rate of
change.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ HOW TO USE
Step 1 → Add the indicator. Semi-transparent projected candles appear
to the right of the current bar — blue for bullish analogue,
red for bearish.
Step 2 → In Dual mode, both projections are visible. Compare the two
scenarios to see where historical analogues diverge.
Step 3 → Check confidence in the dashboard. Higher % means the
historical slope matched more closely and the regression
fit was similar.
Step 4 → Adjust Slope Tolerance for stricter or looser matching.
Lower values find fewer but more precise analogues.
Step 5 → Increase Search Depth to scan more history (up to 4000 bars).
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ HOW IT CALCULATES
◆ Linear Regression on Price vs Time
The indicator computes a rolling linear regression of close price against
time over a configurable window. The key outputs are:
slope = covariance(close, time) / variance(time)
R² = pearson_correlation² (goodness of fit)
The slope represents the rate of price change per unit of time. R²
measures how well the linear model fits the price data.
◆ Slope Matching
For each historical position within the search depth, the indicator
compares that position's regression slope to the current slope:
match = abs(current_slope - historical_slope) <= tolerance
Only positions where the slope difference is within tolerance are
considered. Among matching positions, the one with the smallest
difference is selected.
◆ Dual Mode Selection
In Dual mode, two separate matches are tracked — one where price moved
upward after the match point (bullish analogue) and one where it moved
downward (bearish analogue). Each is the closest slope match within its
direction category.
◆ Confidence Scoring
Confidence uses a weighted geometric mean of slope proximity and R²
agreement with power-adjusted sensitivity:
slope_prox = max(0, 1 - (slope_diff / tolerance)^0.8)
r2_agree = max(0, 1 - abs(current_R² - historical_R²)^1.2)
confidence = sqrt(slope_prox × r2_agree) × 100%
Higher confidence means both the trend steepness and the regression
quality of the historical period closely match current conditions.
◆ Source Highlight
When a match is found, the historical candles used as the source are
highlighted with a dashed border box on the chart. Blue dashed box marks
the bullish source, red marks the bearish source. This shows exactly
where in history the analogue was detected.
◆ Candle Projection
The historical price action following the matched position is scaled to
the current price level and drawn as projected candles:
scale = current_close / matched_close
projected_OHLC = historical_OHLC × scale
Each projected bar is drawn as a box (body) and a line (wick), preserving
the candle structure of the original historical movement.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ WHAT MAKES IT DIFFERENT
◆ Slope-Based Matching
Most pattern matchers compare price shapes (correlation, DTW, etc.). This
indicator matches the underlying trend rate via linear regression slope.
A steep uptrend at $20,000 matches a steep uptrend at $100,000 — it is
the gradient that matters, not the shape or level.
◆ Dual Scenario Projection
Instead of showing one forecast, Dual mode presents both outcomes. The
same slope can lead to continuation or reversal — seeing both projections
simultaneously provides context for what historically followed similar
trend conditions in both directions.
◆ Candle-Style Visualization
Projected price action is rendered as semi-transparent candles (body boxes
and wick lines) rather than a simple line. This preserves the volatility
structure of the historical period — the projected candle ranges show how
wide the bars were, not just where price ended.
◆ Source Pattern Highlight
The historical candles that serve as the source for each projection are
highlighted with a dashed border box directly on the chart. This makes the
analogue transparent — you can scroll back and see exactly which period
the indicator matched and what happened next.
◆ Regression Quality Filter
The confidence score incorporates R² from both current and historical
periods. A match where both periods have high R² (strong trend) is scored
higher than a match where the regression fit was weak (choppy conditions).
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ DASHBOARD
Real-time panel (configurable position) with key metrics:
- Bull Analogue - confidence % of bullish match (Dual mode)
- Bear Analogue - confidence % of bearish match (Dual mode)
- Direction - match direction (Best Match mode)
- Confidence - match quality % (Best Match mode)
- Regression Fit - current R² as percentage
- Search Depth - bars scanned in history
- Mode - Dual or Best Match
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ SETTINGS
Search
- Projection Window - 50 (bars to project forward)
- Search Depth - 500 (history bars to scan, up to 4000)
- Slope Tolerance - 0.004 (max slope difference for match)
- Regression Length - 50 (bars for linear regression)
- Projection Mode - Dual (or Best Match for single)
Visualization
- Bullish / Bearish / Highlight Color - customizable
- Projection Opacity - 65 (transparency of projected candles)
Dashboard
- Show Dashboard - ON
- Dashboard Position - Top Right
Alert Settings
- Allow Repainting - OFF
- JSON Alerts - OFF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ ALERTS
- Analogue Updated - projection recalculated with new match
JSON payloads include mode, confidence scores (bull/bear or single), ticker, price, and timeframe.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
This indicator is published as invite-only. The protected source contains
the regression-based slope matching engine, the dual scenario selection
logic, the scaled candle projection system, the source pattern highlight,
and the confidence scoring formula. These components represent original methodology.
The description above provides full transparency on what the indicator calculates and how.
Best regards,
EXCAVO
Disclaimer
Trading involves significant risk. This indicator is a technical analysis tool
and does not constitute financial advice, investment recommendations, or a
guarantee of future results. Past indicator behavior does not guarantee future
performance. Always use proper risk management and your own judgment.
Disponible en el Espacio de pago
Este indicador solo está disponible para suscriptores de EXCAVO PRO: Indicators + My Positions . Suscríbase para acceder a este y otros scripts de EXCAVO.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.
Disponible en el Espacio de pago
Este indicador solo está disponible para suscriptores de EXCAVO PRO: Indicators + My Positions . Suscríbase para acceder a este y otros scripts de EXCAVO.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.