Regression Market Profile [BOSWaves]Regression Market Profile - Curve-Following Distribution Analysis with TPO Letters, Heatmap, and Profile Modes
Overview
Regression Market Profile is a regression-anchored market profile system that maps the distribution of price activity relative to a best-fit regression curve rather than within fixed horizontal price boundaries, where row assignment, POC identification, value area construction, and interior visualization are all derived from how far actual price deviated from the regression prediction on each bar rather than from absolute price levels.
Instead of constructing a profile against a static price range, this system fits either a linear or polynomial regression to recent price history and measures each bar's deviation from the fitted curve, distributing that activity into horizontal rows centered on the regression line. As the curve bends and trends through price space, the entire profile follows it, revealing where price consistently clustered above or below the regression prediction and identifying the deviation offset with the highest time-at-price concentration as a dynamic POC that moves with the trend rather than anchoring to a fixed session boundary.
This creates a market profile framework that adapts to the prevailing directional structure of price rather than imposing a fixed container. The interior visualization communicates distribution in three configurable modes: a heatmap that reveals how the distribution migrated across time columns, a profile extending from the right edge showing the cumulative distribution shape, and TPO letter boxes that follow the regression curve encoding chronological time progression through gradient coloring. Standard deviation bounds, value area boundaries, and a dual-line POC glow all follow the curve simultaneously, providing a complete structural reference system that moves with the trend rather than remaining static.
Price is therefore evaluated not for its absolute level but for its position relative to the regression expectation, with the profile revealing which deviation offsets attracted the most sustained activity throughout the regression window.
Conceptual Framework
Regression Market Profile is founded on the principle that meaningful participation clustering should be measured relative to the expected price path defined by recent price history rather than within arbitrary time or price containers that carry no relationship to the actual directional structure of the market.
Traditional market profile approaches anchor distributions to calendar sessions or fixed price ranges, producing profiles that reflect where price traded within a time box rather than where it clustered relative to its own trend. This framework replaces fixed-container profiling with regression-relative distribution measurement, where each bar's contribution to the profile is determined by how far actual price deviated from the best-fit curve rather than where it sat in absolute price space. The profile therefore reveals the structural tendencies of price relative to its own trend dynamics rather than its behavior within an externally imposed boundary.
Three core principles guide the design:
Profile distribution should be measured as deviation from a fitted regression curve rather than as absolute price position, ensuring the profile captures participation clustering relative to trend expectation rather than within arbitrary price boundaries.
The interior visualization mode should be configurable between temporal migration analysis, cumulative distribution shape, and chronological letter encoding, allowing the same structural data to be interpreted through different analytical lenses depending on the trader's workflow.
All structural reference elements including POC, value area, standard deviation bounds, and centerline should follow the regression curve continuously rather than anchoring to static horizontal levels, maintaining relevance to the current trend structure throughout the regression window.
This shifts market profile analysis from session-bounded horizontal distribution tracking into regression-relative participation mapping where the profile reveals structural clustering tendencies within the context of the prevailing trend curvature.
Theoretical Foundation
The indicator combines matrix-based polynomial and linear regression fitting to recent HL2 price data, rolling standard deviation for channel scaling and SD bound construction, deviation-based row assignment for distribution building, POC identification through maximum row count, value area expansion from POC outward, and three distinct interior visualization systems that present the same distribution data through different geometric representations following the regression curve.
The regression is computed using ordinary least squares matrix operations: the design matrix is constructed with powers of bar index up to the polynomial degree, transposed and multiplied to form the normal equations, inverted, and multiplied by the price vector to produce regression coefficients, which are then applied to generate the full prediction array. Standard deviation of the HL2 series over the regression window provides the channel scaling unit and drives the SD bound envelopes. Row assignment divides the channel height by the number of rows and places each bar's deviation from its predicted value into the corresponding row bin. POC and value area use the same maximum-count and outward-expansion logic as conventional market profile, applied to the curved row counts.
Four internal systems operate in tandem:
Regression Engine : Computes linear or polynomial best-fit predictions for all bars in the lookback window using matrix least squares, providing the curved baseline that all distribution measurements, row positioning, and visual elements follow.
Distribution Construction System : Measures each bar's deviation from its regression prediction, assigns it to a horizontal row within the standard deviation channel, accumulates row counts across the full window, and derives POC and value area from the resulting distribution.
Interior Visualization Engine : Renders the distribution data inside the channel in one of three modes: curved polygon cells per time column normalized independently for heatmap temporal migration display, curved profile bars extending from the right edge scaled to global row counts for distribution shape display, or TPO letter boxes positioned at the regression-relative row boundaries with gradient chronological coloring for time period encoding.
Structural Reference System : Draws the dual-line POC glow following the regression curve at the POC row offset, value area boundary polylines at the VA top and bottom offsets, standard deviation envelope polylines at one through three sigma above and below the curve, and a dashed centerline following the regression prediction directly.
This design ensures the distribution and all structural reference elements continuously adapt to the regression curve while the three interior modes provide complementary analytical perspectives on the same underlying participation data.
How It Works
Regression Market Profile evaluates price through a sequence of regression-aware distribution and visualization processes:
Regression Calculation : On the last bar, the design matrix is constructed from bar index values raised to polynomial powers up to the configured degree. Ordinary least squares solves for the coefficient vector and applies it to produce a prediction array covering all bars in the lookback window.
Channel Scaling : The standard deviation of HL2 over the regression window multiplied by the configured channel width defines the maximum deviation distance, establishing the vertical extent of the distribution channel centered on the regression curve.
Row Assignment and Count Accumulation : Each bar's actual HL2 is compared to its regression prediction and the deviation is assigned to a horizontal row bin derived from the channel height divided by the row count. Row counts accumulate across all bars in the window.
POC Identification : The row with the maximum accumulated count is identified as the Point of Control, representing the deviation offset from the regression curve where price spent the most time during the lookback window.
Value Area Construction : Starting from the POC row, adjacent rows are added in order of greater count until the cumulative total reaches the configured value area percentage of all bar counts, defining the high-activity zone around the POC.
Interior Rendering - Heatmap Mode : The lookback window is divided into time columns and each column builds its own per-row counts, normalized independently so each column's internal distribution is shown on its own scale. Curved polygon cells are rendered for each occupied cell with hot-cold gradient coloring by normalized density.
Interior Rendering - Profile Mode : Each row's global count is expressed as a fraction of the maximum row count and scaled to a configurable proportion of the total regression length. Curved polygon bars extend leftward from the right edge by the scaled bar length, forming a profile shape that follows the regression curve.
Interior Rendering - Letters Mode : Each bar is assigned a sequential alphabetical letter based on its time period index relative to the TPO timeframe. Letters are accumulated per row and rendered as individual boxes positioned at the regression-relative row boundaries, with gradient coloring that progresses from cold to hot as the letter index advances chronologically.
POC Polyline Rendering : A wide low-opacity glow polyline and a thinner full-opacity core polyline follow the regression curve at the POC deviation offset, providing a continuously curving reference for the maximum activity level throughout the window.
Value Area and SD Bound Rendering : Dotted polylines follow the regression curve at the value area high and low offsets and at one, two, and three standard deviation distances above and below the curve, with opacity increasing with distance from the curve.
Together, these elements form a continuously recomputed regression-relative distribution system where every visual element adapts to the current curve shape and all three interior modes present the same participation data from different analytical perspectives.
Interpretation
Regression Market Profile should be interpreted as a regression-relative structural distribution system where clustering above or below the fitted curve reveals directional bias tendencies and participation concentration within the prevailing trend:
Regression Centerline : The dashed curve following the best-fit prediction represents the trend's expected price path. Price consistently above it indicates sustained positive deviation bias; price consistently below indicates sustained negative deviation bias.
POC Line : The dual glow and core polyline following the curve at the maximum activity offset marks the deviation level where price spent the most time relative to the regression prediction, representing the most accepted deviation from expected trend behavior during the window.
Value Area Boundaries : Dotted polylines above and below the POC line mark the deviation range containing the configured percentage of total activity, identifying the zone of concentrated acceptance around the POC.
Standard Deviation Bounds : One, two, and three sigma dotted envelopes around the curve mark statistically extreme deviation distances, with progressively greater opacity indicating greater statistical rarity of price reaching those offsets.
Heatmap Mode : Each time column displays its own normalized distribution, with hot colors indicating the most active deviation level within that column and cold colors indicating less active levels. Reading across columns from left to right reveals how the distribution migrated as the window progressed.
Profile Mode : Curved bars extending from the right edge show the cumulative distribution shape across the full window, with longer bars indicating deviation levels with greater total activity and hot coloring marking the densest regions.
Letters Mode : Sequential alphabet letters fill the channel rows at their regression-relative positions, with gradient coloring from cold early-window letters to hot late-window letters encoding chronological time progression. Single-letter rows indicate price visited that deviation level in only one time period, functioning as regression-relative single prints.
POC Offset Interpretation : A POC positioned above the regression centerline indicates that price has consistently traded at a positive deviation from expectations, reflecting bullish structural bias within the window. A POC below the centerline indicates bearish structural bias.
POC offset direction, value area extent, distribution shape across modes, and SD bound interactions collectively provide more structural context than any element in isolation.
Signal Logic & Visual Cues
Regression Market Profile does not generate discrete buy or sell signals but provides continuous structural reference through distribution-derived levels:
POC Reaction : Price returning to the deviation level corresponding to the POC polyline encounters the most accepted level within the regression window, frequently acting as magnetic reference for reversion or continuation assessment.
Value Area Boundary Interaction : Price moving outside the value area boundaries enters statistically less accepted deviation territory, suggesting either trend extension beyond typical participation or the beginning of structural repositioning relative to the regression curve.
Standard deviation bound interactions provide additional reference for statistically extreme deviation events that historically attract mean reversion activity back toward the regression curve and POC.
Strategy Integration
Regression Market Profile fits within regression-informed structural analysis and distribution-based approaches:
POC Reversion Framing : Use the POC polyline as a dynamic reversion target when price has extended to the outer standard deviation bounds, with the curved POC providing a continuously updating level that reflects the trend's accepted center rather than a static price.
Value Area Acceptance Testing : Monitor whether price is trading within or outside the value area boundaries to assess whether current price activity represents accepted trend behavior or extended deviation warranting mean reversion consideration.
Heatmap Migration Analysis : Use temporal migration visible in heatmap mode to assess whether distribution is shifting toward positive or negative deviation over the course of the window, providing directional bias evidence from the distribution's evolution rather than from price alone.
Profile Shape Assessment : Use profile mode to assess distribution symmetry around the regression curve. A distribution skewed above the centerline suggests persistent positive bias; skew below suggests persistent negative bias. A symmetric bell shape suggests balanced acceptance around the regression expectation.
Single Print Monitoring in Letters Mode : Treat single-letter rows in letters mode as regression-relative thin participation levels that price is likely to revisit, analogous to single prints in conventional market profile.
Regression Mode Selection : Use Linear mode for markets trending in a consistent direction where a straight best-fit line accurately represents the price path. Use Polynomial mode for markets with visible curvature in their trend structure where the quadratic bend better fits the actual price trajectory.
Technical Implementation Details
Regression Engine : Matrix OLS computation using design matrix construction, normal equation formation, matrix inversion, and coefficient application for linear or polynomial curve fitting to HL2
Channel Construction : Rolling standard deviation-scaled channel with configurable width multiplier providing deviation row boundaries
Distribution System : Deviation-based row assignment with global count accumulation, POC maximum identification, and outward value area expansion
Heatmap Engine : Per-column count normalization with curved polygon cell rendering using hot-cold gradient by normalized density
Profile Engine : Global count-scaled curved bar polylines extending from the right edge by proportional bar length
Letters Engine : TPO timeframe-ratio letter assignment with per-row accumulation and gradient chronological box rendering at regression-relative boundaries
Structural System : Dual-line POC glow, dotted VA boundary polylines, three-sigma dotted SD envelopes, and dashed centerline all following the regression curve via chart.point arrays
Performance Profile : All rendering triggered only on the last bar with full object cleanup and rebuild on each update, polyline-based curved geometry for all structural elements
Optimal Application Parameters
Timeframe Guidance:
1 - 5 min : Intraday regression profiling with shorter length and tighter channel for fast-adapting curve that captures intraday trend structure
15 - 60 min : Session-level distribution analysis with balanced length and moderate channel width for meaningful participation mapping across typical session trends
4H - Daily : Swing-level regression profiling with longer lookback and polynomial mode for curve-following distribution across multi-session directional structures
Suggested Baseline Configuration:
Length : 200
Mode : Polynomial
Channel Width (SD×) : 3.0
Inner Display : Letters
Rows : 12
TPO Timeframe : 30
Value Area % : 70
Show POC : Enabled
Show Value Area : Enabled
Show SD Bounds : Enabled
These suggested parameters should be used as a baseline; their effectiveness depends on the instrument's trend characteristics, volatility profile, and preferred distribution granularity, so fine-tuning is expected for optimal performance.
Parameter Calibration Notes
Use the following adjustments to refine behavior without altering the core logic:
Curve fits too loosely to recent price : Decrease Length to shorten the regression window, producing a curve that adapts more quickly to recent price structure. Switch to Polynomial mode if the trend has visible curvature that a linear fit cannot capture.
Curve too reactive to short-term price movement : Increase Length to smooth the regression across more history, producing a more stable curve that reflects longer-term directional structure and reduces sensitivity to recent fluctuations.
Channel too narrow or wide : Adjust Channel Width to scale the standard deviation multiplier, expanding the channel to capture more price activity within the distribution or contracting it to focus on the core deviation range.
Distribution too coarse or granular : Adjust Rows to increase or decrease the number of horizontal price bins, calibrating vertical resolution to the channel height and the instrument's typical deviation behavior within the regression window.
Heatmap columns too few or many : Adjust Heatmap Columns to control the time resolution of the migration display, with fewer columns showing broader temporal patterns and more columns revealing finer migration detail at the cost of visual density.
Profile bars too short or long : Adjust Profile Width to scale the maximum bar length as a fraction of the regression window, calibrating how far the longest bars extend from the right edge relative to the available chart space.
Too few or many letters per row : Adjust TPO Timeframe to change the time period each letter represents. Higher timeframes produce fewer, broader letters; lower timeframes produce more letters with finer time resolution.
Adjustments should be incremental and evaluated across multiple session types rather than isolated market conditions.
Performance Characteristics
High Effectiveness:
Trending markets where the regression curve accurately represents the directional price path and the distribution reveals consistent deviation bias that reflects genuine structural tendencies
Instruments with smooth, curving price trends where polynomial mode produces a better-fitting curve than a straight line and the distribution around the curve is more meaningful than a session-anchored profile
Market profile-informed approaches that benefit from a continuously adapting POC and value area that follow the trend rather than anchoring to fixed session boundaries
Distribution analysis workflows where heatmap temporal migration or profile shape provides directional bias evidence from participation patterns rather than from price indicators alone
Reduced Effectiveness:
Choppy, directionless markets where the regression curve has no clear shape and the distribution is uniform across rows, reducing the interpretive value of POC location and value area extent
Markets with frequent sharp reversals where the regression window spans multiple opposing structural moves, producing a curve that represents none of them accurately and a distribution without meaningful clustering
Extremely short lookback windows where the matrix regression calculation is underdetermined or the distribution contains too few bars per row to produce statistically meaningful counts
Instruments with discontinuous price action including frequent gaps where the HL2 series used for regression produces curves that follow gap-distorted price paths rather than genuine trend structures
Integration Guidelines
Confluence : Combine with BOSWaves structural tools, momentum oscillators, or volume analysis to validate POC and value area interactions with broader analytical context before acting on regression-relative distribution levels
POC Offset Bias : Monitor the position of the POC relative to the centerline across successive sessions as a structural bias indicator. A POC consistently above the centerline across multiple regression windows suggests a persistent positive deviation tendency in the current trend phase.
Mode Selection by Objective : Use Letters mode for structural time-at-price analysis analogous to conventional market profile. Use Heatmap mode to assess how distribution shifted over the regression period. Use Profile mode to quickly assess distribution shape and skew relative to the centerline.
Regression Mode Discipline : Commit to a regression mode based on the instrument's observed trend curvature rather than switching between modes reactively. Polynomial mode adds a second degree of freedom that can overfit short-term noise if the lookback window is too short.
Window Length Stability : Maintain a consistent regression length when using the POC and value area as ongoing structural references. Changing the length significantly shifts the curve and redistributes the profile, making successive POC comparisons unreliable.
Disclaimer
Regression Market Profile is a professional-grade regression-relative distribution and market profile analysis tool. It uses ordinary least squares curve fitting with deviation-based participation mapping but does not predict future price movements. Results depend on market conditions, instrument trend characteristics, parameter selection, and disciplined execution. BOSWaves recommends deploying this indicator within a broader analytical framework that incorporates order flow context, structural analysis, and comprehensive risk management. Indikator

Arbor_Gradient_Boosting_GainzAlgoGainzAlgo is excited to bring the ability to perform gradient boosting and feature importance selection to Pine Script. Currently, there are no native capabilities within Pine Script for gradient boosting or feature importance selection. Arbor fills this significant gap by introducing a from-scratch Gradient Boosting Machine (GBM) engineered with XGBoost-style mechanics.
Designed to support both classification and regression tasks, and building on our Random Forest approach to Pinescript, Arbor utilizes depth-1 stumps, meaning it performs one split per round without column subsampling.
Because TradingView automatically lists the exported types and function parameters, the following outlines the core mechanics and capabilities you unlock by importing Arbor.
Core Mechanics
Arbor brings advanced machine-learning concepts directly into your Pine Script workflows:Advanced Training: Utilizes Newton leaf steps (second-order hessian weighting) and the exact XGBoost gain formula.
Regularization & Pruning: Integrates L2 regularization (lambda), minimum gain pruning (gamma), and minimum child weight checks to manage model complexity and prevent overfitting.
Stochasticity: Implements Fisher-Yates row subsampling to provide genuine round-to-round stochasticity matching XGBoost's subsample behavior.
Reproducibility: You can pass an optional seed to any fit function to ensure reproducible training runs across reloads.
Model Tiers
The library supports models scaled across three specific feature tiers:
GBM (1 Feature): Built for rapid classification or regression implementations.
GBM3 (3 Features): Purpose-built specifically for classification tasks.
GBM4 (4 Features): Supports both classification and regression, and uniquely offers XGBoost-style, gain-based feature importance evaluation.
Library "Arbor_Gradient_Boosting_GainzAlgo"
Arbor — gradient boosting for Pine Script. From-scratch GBM v2
with XGBoost-style mechanics: Fisher-Yates row subsampling, Newton leaf steps
(second-order hessian weighting), exact XGBoost gain formula with L2
regularization (lambda), minimum gain pruning (gamma), and minimum child
weight. Trees are depth-1 stumps (one split per round) and there is no
column (feature) subsampling — this is an XGBoost-style boosting scheme,
not a full XGBoost reimplementation. Supports classification and regression
across three feature tiers:
- GBM (1 feature) : gbm_fit / gbm_predict
classification or regression via is_classifier
- GBM3 (3 features) : gbm3_fit / gbm3_predict
classification only
- GBM4 (4 features) : gbm4_fit / gbm4_predict / gbm4_importance_pct
classification or regression with XGBoost-style
gain-based feature importance
All variants use Newton leaf steps, exact gain formula, L2 regularization,
Fisher-Yates shuffle subsampling, and gamma/min_child_weight pruning. Pass
an optional seed to any fit function for reproducible training runs.
gbm_fit(feat, target, n_rounds, lr, n_thresh, is_classifier, lambda, gamma, min_child_w, subsample, seed)
Fits a single-feature gradient-boosted stump ensemble using
XGBoost-style mechanics: Newton leaf steps (second-order hessian weighting),
exact gain formula with L2 regularization, gamma pruning, minimum child
weight, and Fisher-Yates row subsampling. Each round fits one depth-1 stump
(this is not a full multi-level tree, and there is no column subsampling).
Supports both binary classification (log-odds + sigmoid) and regression (MSE).
Parameters:
feat (array) : Array of feature values, one per training row
target (array) : Array of targets — 0.0/1.0 for classification, continuous for regression
n_rounds (int) : Number of boosting rounds / stumps to fit
lr (float) : Learning rate / shrinkage applied to each round's leaf contribution
n_thresh (int) : Candidate split thresholds to scan per round
is_classifier (bool) : True = binary classification, False = squared-error regression
lambda (float) : L2 leaf regularization — Ridge-style shrinkage toward zero (XGBoost default: 1.0)
gamma (float) : Minimum gain required to accept a split — prunes weak splits (XGBoost default: 0.0)
min_child_w (float) : Minimum hessian sum per child node — prevents tiny noisy splits (XGBoost default: 1.0)
subsample (float) : Fraction of rows randomly sampled per round via Fisher-Yates (default: 1.0 = all rows)
seed (int) : Optional seed for the row-subsampling shuffle — pass a fixed value for reproducible fits across reloads (default: na = unseeded/random each time)
Returns: Fitted GBM object ready for gbm_predict()
gbm_predict(model, x)
Scores a single feature value against a fitted GBM ensemble.
Parameters:
model (GBM) : A GBM object previously returned by gbm_fit()
x (float) : Feature value to score (same feature definition used in training)
Returns: Predicted probability if classifier, raw predicted value if regressor
gbm3_fit(feat1, feat2, feat3, target, n_rounds, lr, n_thresh, lambda, gamma, min_child_w, subsample, seed)
Fits a 3-feature gradient-boosted classifier using XGBoost-style
mechanics: Newton leaf steps, exact gain formula, L2 regularization, gamma
pruning, minimum child weight, and Fisher-Yates row subsampling. Selects the
best (feature, threshold) pair each round and boosts in log-odds space.
Each round fits a single depth-1 stump; there is no column subsampling.
Parameters:
feat1 (array) : Array of feature 1 values, one per training row
feat2 (array) : Array of feature 2 values, one per training row
feat3 (array) : Array of feature 3 values, one per training row
target (array) : Array of binary targets (0.0 or 1.0), one per training row
n_rounds (int) : Number of boosting rounds
lr (float) : Learning rate / shrinkage
n_thresh (int) : Candidate thresholds scanned per feature per round
lambda (float) : L2 leaf regularization (Ridge shrinkage, XGBoost default: 1.0)
gamma (float) : Minimum gain to accept a split (XGBoost default: 0.0)
min_child_w (float) : Minimum hessian sum per child node (XGBoost default: 1.0)
subsample (float) : Row sampling fraction per round via Fisher-Yates (default: 1.0)
seed (int) : Optional seed for the row-subsampling shuffle — pass a fixed value for reproducible fits across reloads (default: na = unseeded/random each time)
Returns: Fitted GBM3 object ready for gbm3_predict()
gbm3_predict(model, x1, x2, x3)
Scores 3 feature values against a fitted GBM3 classifier.
Parameters:
model (GBM3) : GBM3 object from gbm3_fit()
x1 (float) : Current value of feature 1
x2 (float) : Current value of feature 2
x3 (float) : Current value of feature 3
Returns: Predicted probability
gbm4_fit(feat1, feat2, feat3, feat4, target, n_rounds, lr, n_thresh, is_classifier, lambda, gamma, min_child_w, subsample, seed)
Fits a 4-feature gradient-boosted ensemble with Newton steps, exact gain
formula, L2 regularization, gamma pruning, minimum child weight, Fisher-Yates
row subsampling, and gain-based feature importance tracking.
Supports both binary classification and regression. Each round fits a single
depth-1 stump; there is no column subsampling.
Parameters:
feat1 (array) : Array of feature 1 values, one per training row
feat2 (array) : Array of feature 2 values, one per training row
feat3 (array) : Array of feature 3 values, one per training row
feat4 (array) : Array of feature 4 values, one per training row
target (array) : Array of targets — 0.0/1.0 for classification, continuous for regression
n_rounds (int) : Number of boosting rounds
lr (float) : Learning rate / shrinkage
n_thresh (int) : Candidate thresholds scanned per feature per round
is_classifier (bool) : True = binary classification, False = regression
lambda (float) : L2 leaf regularization (Ridge shrinkage, XGBoost default: 1.0)
gamma (float) : Minimum gain to accept a split (XGBoost default: 0.0)
min_child_w (float) : Minimum hessian sum per child node (XGBoost default: 1.0)
subsample (float) : Row sampling fraction per round via Fisher-Yates (default: 1.0)
seed (int) : Optional seed for the row-subsampling shuffle — pass a fixed value for reproducible fits across reloads (default: na = unseeded/random each time)
Returns: Fitted GBM4 object with importance scores, ready for gbm4_predict() / gbm4_importance_pct()
gbm4_predict(model, x1, x2, x3, x4)
Scores 4 feature values against a fitted GBM4 ensemble.
Parameters:
model (GBM4) : GBM4 object from gbm4_fit()
x1 (float) : Current value of feature 1
x2 (float) : Current value of feature 2
x3 (float) : Current value of feature 3
x4 (float) : Current value of feature 4
Returns: Predicted probability if classifier, raw predicted value if regressor
gbm4_importance_pct(model, feat_idx)
Returns normalized feature importance as % of total gain for one feature.
Importance = accumulated gain credited to this feature across all boosting rounds,
matching XGBoost's xgb.importance() Gain column definition.
Parameters:
model (GBM4) : GBM4 object from gbm4_fit()
feat_idx (int) : Feature index to query (0-3)
Returns: Percentage of total ensemble gain attributed to this feature (0.0–100.0)
GBM
Holds a fitted gradient-boosted stump ensemble (1 feature).
Fields:
thresh (array) : Split threshold for each round's stump
left_val (array) : Newton leaf value when feature < threshold
right_val (array) : Newton leaf value when feature >= threshold
base_score (series float) : Log-odds of training mean (classifier) or mean (regressor)
lr (series float) : Learning rate stored for inference
is_classifier (series bool) : True = sigmoid probability output, False = raw regression output
GBM3
Holds a fitted 3-feature gradient-boosted stump ensemble (classification only).
Fields:
stump_feat (array) : Which feature index (0-2) each round's stump split on
thresh (array) : Split threshold for each round's stump
left_val (array) : Newton leaf value when feature < threshold
right_val (array) : Newton leaf value when feature >= threshold
base_score (series float) : Log-odds of training mean
lr (series float) : Learning rate stored for inference
GBM4
Holds a fitted 4-feature gradient-boosted ensemble with gain-based importance.
Fields:
stump_feat (array) : Which feature index (0-3) each round's stump split on
thresh (array) : Split threshold for each round's stump
left_val (array) : Newton leaf value when feature < threshold
right_val (array) : Newton leaf value when feature >= threshold
importance (array) : Accumulated gain per feature (indices 0-3), raw — normalize via gbm4_importance_pct()
base_score (series float) : Log-odds (classifier) or mean (regressor)
lr (series float) : Learning rate stored for inference
is_classifier (series bool) : True = sigmoid probability output, False = raw regression output Perpustakaan

Smart Ichimoku | GainzAlgoOverview
Most Ichimoku indicators give you the same signal everyone else gets, a raw cloud cross with no filter, no context, and no target. This indicator rethinks the system from the ground up by combining a smoothed Ichimoku cloud with an inline logistic regression classifier that scores every cloud break in real time, then projects statistically-derived price targets the moment a confirmed signal fires.
The result is a cleaner, higher conviction version of one of the most respected trend frameworks in technical analysis.
The Foundation: Why Smooth the Ichimoku?
Traditional Ichimoku uses simple high-low midpoints (Donchian midlines) for its Tenkan, Kijun, and Senkou components. This makes the cloud visually choppy and prone to false crosses on noisy, volatile instruments like crypto or high-beta equities.
This indicator replaces all three components with Hull Moving Averages (HMA), which are designed to be simultaneously smooth and responsive, reducing lag without the whipsaw of standard smoothing. The cloud body itself becomes cleaner, the baseline is less noisy, and the cross events that trigger signals are more structurally meaningful.
All default periods match classic Ichimoku settings (9 / 26 / 52 / 26 displacement) so the logic stays true to the original system, it's just rendered with better math underneath.
The Signal: Logistic Regression Cloud Break Classifier
Here's where this indicator separates itself. A cloud cross alone is not a signal, it's a candidate. What actually matters is whether the market conditions at the moment of the cross are consistent with a real, sustained breakout or breakdown.
The classifier answers that question with a probability score.
How it works
At the exact bar where price exits the cloud body, four normalized features are computed and fed into a logistic regression model:
1. RSI (centered at 50, scaled by 25)
Measures momentum. On a bearish break, is RSI already extended to the downside? On a bullish break, is it pointing up? RSI near 50 adds little conviction; RSI at 30 on a bear break adds a lot.
2. Stochastic Oscillator (centered at 50, scaled by 25)
Short-term overbought/oversold confirmation. Works similarly to RSI but captures faster-cycle momentum, giving the model a second read on the same question.
3. Z-Score (price vs 20-bar mean, normalized by standard deviation)
Measures how statistically extended price is relative to recent history. A cloud break accompanied by a Z-Score of -2 is much more meaningful than one at Z = -0.2. This feature effectively asks: "Is this break happening from an already-stretched position?"
4. Cloud Break Depth (normalized by ATR)
How far did price close through the cloud boundary, relative to recent volatility? A close that barely clips the edge is very different from one that punches through by a full ATR. This is the most direct measure of breakout conviction.
The Math
Each feature is multiplied by a weight and summed into a single score (z). That score is passed through the sigmoid function:
P = 1 / (1 + e^(-z))
This compresses the output to a probability between 0 and 1. If the probability clears the threshold (default 0.60), the break is confirmed and a signal fires. Below threshold, the cross is rejected — instead of being ignored, it's labeled with a risk tier so you can see exactly how close (or far) it came to confirming.
The probability score is displayed as a small percentage label directly on the signal bar so you always know how strong the classifier rated that particular break.
Self-Calibrating Weights — No Manual Tuning
Unlike a typical multi-feature model, none of the four weights are set by hand. Each one is derived automatically from that feature's own rolling correlation with next-bar returns, recalculated continuously over a user-set lookback window (the "Self-Calibration Window," default 100 bars).
In practice this means: if RSI has been a genuinely useful predictor of direction on this instrument and timeframe recently, its weight rises on its own. If Z-Score has been mostly noise in the current regime, its weight shrinks toward zero — automatically, without anyone touching a slider.
This was a deliberate design choice. Letting people hand-tune regression weights invites a lot of well-intentioned guesswork that usually overfits to a handful of recent candles. By having the model score its own features based on demonstrated, rolling predictive power, the classifier adapts to changing market conditions instead of running on opinions baked in at setup time.
Rejected Crosses: Risk-Tiered Labels
Not every cloud cross clears the threshold, and that's the point. Rather than silently discarding rejected crosses, this indicator labels every one of them with a risk tier so you know exactly what the model saw and how close it came to confirming:
Low Risk: Probability fell just short of the threshold (within 10 points below). A near-miss — the break had real conviction behind it, it simply didn't clear the bar.
Moderate Risk: Probability landed meaningfully below threshold (10–25 points). A weaker break with mixed signals underneath it.
High Risk: Probability came in far below threshold (25+ points). A break with little to no underlying conviction — most consistent with chop or noise.
Each label shows its tier and the actual probability (e.g. "Low Risk ▼ 54%"), so nothing is a black box. A cluster of Low/Moderate Risk labels in one zone often signals a contested area that's likely to resolve into a real breakout once it's worked through — useful context even though no trade signal fired. These labels can be toggled off entirely in settings if you'd rather only see confirmed signals.
The Targets: Mean, Median, Mode
Once a confirmed break fires, three dashed horizontal target lines project from the signal bar. These are not arbitrary multiples, they are derived from the actual statistical distribution of bar-to-bar price moves over the lookback window.
Mean (Yellow): The average absolute bar move over the lookback period, scaled by the target multiplier. This is the "expected" target under normal conditions.
Median (Cyan): The 50th percentile of historical moves. Because move distributions are right-skewed (a few large moves pull the mean up), the median is typically more conservative than the mean and often a more realistic first target.
Mode (Hot Pink): The most frequently occurring move size, derived by bucketing historical moves into ATR-width bins and finding the most populated bin. This represents what the market most commonly does — not what it averages, not the middle value, but the single most likely outcome based on observed frequency.
Together, the three targets give you a realistic range rather than a single arbitrary level — grounded in what this instrument has actually done over the recent past. Bull and bear target sets are tracked independently, so a new bearish break won't erase an active bullish target set still in play, and vice versa.
The Target Multiplier (default 3×) scales all three targets proportionally. Lower it for tighter, shorter-term targets; raise it for swing trades or higher-volatility instruments.
Reading the Chart
Green triangle (▲) below bar: Confirmed bullish cloud break. Price has exited the top of the cloud with sufficient classifier probability. Three upward target lines appear.
Pink triangle (▼) above bar: Confirmed bearish cloud break. Price has exited the bottom of the cloud with sufficient classifier probability. Three downward target lines appear.
Percentage label: The LR probability score for that break (e.g. "73%"). Higher is stronger.
Risk-tiered label (amber/orange/red): A cloud cross that was rejected, with its tier and probability shown.
Yellow dashed line: Mean target
Cyan dashed line: Median target
Hot pink dashed line: Mode target (thicker, as it represents the highest-frequency outcome)
Settings Guide
Smooth Ichimoku
Tenkan / Kijun / Senkou Period: Standard Ichimoku periods. Default 9/26/52 follows the classic system. Shorter periods = more sensitive, more signals. Longer = slower, fewer but stronger signals.
Displacement: How far forward the cloud is projected. Default 26.
Break Classifier
Self-Calibration Window: How many past bars the model uses to learn each feature's weight from its recent correlation with price moves. Shorter windows adapt faster to regime changes but can be noisier; longer windows are more stable but slower to react. Default 100.
Break Probability Threshold: The minimum probability required to confirm a signal. Default 0.60. Raise toward 0.75+ for fewer, higher-conviction signals. Lower toward 0.50 to see more cloud breaks confirmed (effectively turns the filter off at 0.50).
Targets
Lookback (bars): How many bars of historical move data to use for the distribution calculation. Default 60. Longer lookback = more stable targets based on longer-term behavior. Shorter = more reactive to recent volatility.
Target Multiplier: Scales all three target lines proportionally from the signal close. Default 3×. Adjust based on your timeframe and typical holding period.
Risk Labels
Show Risk Labels on Rejected Crosses: Toggles the Low/Moderate/High Risk labels on rejected cloud crosses. Off by default for a cleaner chart; turn on to see every cross the model evaluated, not just the confirmed ones.
How to Use It
As a trend confirmation tool: Use the cloud direction (cyan dominant = bullish structure, pink dominant = bearish) as your bias filter, and only trade signals that align with the cloud color. Bull signals below a cyan cloud, bear signals above a pink cloud.
As a breakout entry trigger: Wait for price to consolidate inside or near the cloud, then take the confirmed break as an entry signal. The probability label tells you how much conviction the model has at that moment.
Using rejected crosses as context: A string of Low Risk labels in a zone suggests the cloud is being tested seriously without quite breaking — often a precursor to a real move once the level finally gives.
For target setting: Use the median as a conservative first target, the mean as a mid-range objective, and the mode as a guide to where the most "normal" move tends to land. The hot pink mode line is often the most useful for setting realistic profit expectations.
For alerts — Four alert conditions are built in: "Confirmed Bull Break," "Confirmed Bear Break," "Rejected Bull Cross," and "Rejected Bear Cross." Set them on your preferred timeframe and let the classifier notify you rather than watching the chart.
Timeframe Notes
This indicator works across all timeframes but behaves differently depending on context:
1H–4H: Good balance of signal frequency and reliability. Recommended starting point.
Daily: Fewer signals, higher structural significance. Best for swing traders.
15m and below: More signals, more noise. Consider raising the threshold to 0.65–0.70 and reducing the lookback to 30. Watch the risk-tiered labels here in particular — they're most useful for filtering chop on fast timeframes.
Example on the Daily with SPY ETF:
Example on the 4 Hour with BTCUSD;
Example on the 15 Minute with QQQ:
A Note on the Model
The logistic regression here is not trained on historical data in the machine learning sense, and it no longer relies on manually-set weights either. Each feature's weight is derived from its own rolling correlation with subsequent price action, recalculated continuously. Think of it less as a black-box ML model and more as a structured, self-adjusting way to combine four momentum and positioning indicators into a single probability score, similar to our Directional Logistic Oscillator.
The advantage over a traditional multi-condition filter (RSI < 40 AND stoch < 30 AND...) is that the sigmoid function produces a continuous probability rather than a binary pass/fail, which means the model degrades gracefully, a break with three strong features and one neutral one still scores well, rather than getting blocked by an arbitrary threshold on the weak feature. And because every rejected cross is shown with its tier and score rather than discarded silently, nothing the model does is hidden from you.
We hope you enjoy! Indikator

Indikator

Regression-Slope Divergence with Reliability ScoringRegression-Slope Divergence with Reliability Scoring
Most divergence tools tell you a divergence exists. This one tells you whether that divergence has historically mattered on the symbol and timeframe you're actually looking at — and states the conclusion in plain words on the chart.
What it plots
A normalised momentum oscillator with stretch bands and divergence markers, plus a verdict panel that scores those divergences in real time. By default the chart stays minimal — just the oscillator and the verdict panel — with an optional key-info table and a per-direction track-record grid you can switch on in settings.
Why these components are combined, and how they work together
Three classical pieces are fused into a single pipeline — not stacked as independent signals:
Linear-regression slope of price — the direction price is genuinely trending.
RSI-based momentum, z-score normalised — the direction momentum is trending.
A binomial-proportion confidence test — whether the disagreement between the two has preceded a favourable move often enough to beat a same-zone baseline.
Components 1 and 2 only become a signal where they disagree — that disagreement is the divergence. Component 3 is the layer that makes this original: it records every past divergence on the current instrument, measures how often the expected move actually followed within a fixed look-ahead, compares that to what a random entry from the same stretched zone would have achieved, and wraps a confidence interval around the result. The parts are interdependent — remove any one and the script can no longer answer its core question, "is this divergence worth trading here?"
How to read it
The verdict panel translates the statistics into four states:
GREEN — edge confirmed: these divergences have beaten a same-spot baseline here. Worth acting on.
RED — no edge here: they've lost to a coin-flip from the same spot. Skip them, or try a higher timeframe (counter-trend divergence often fails on fast timeframes).
AMBER — unproven: edge not statistically established yet; treat as low-confidence.
GREY — learning: still collecting completed samples.
It also shows whether a signal is live right now and a reward-vs-risk figure — the average best move vs the average worst move after a signal, in ATR. Below 1:1 means signals have hurt more than they've helped. The optional grid breaks the record down into Bullish / Bearish with hit-rate, baseline, edge and reward:risk.
A divergence itself is simply price making a higher high / lower low while the momentum line does the opposite.
What's original
Off-the-shelf divergence indicators fire and leave you to guess. This one keeps a self-updating, confidence-scored track record against a same-zone baseline and tells you, in words, whether the current setup has earned your attention on this specific market.
Universal across markets
It reads only the chart's own price (the source is configurable in settings), so it runs on any symbol, any timeframe, in any market with no external data. Defaults are tuned for NIFTY futures; change the source and lengths for other instruments.
Outputs for other scripts
Generic EXP_* values — oscillator, signal, probability, edge, edge lower-bound, sample count, regime, trend strength and verdict tier — are published to the Data Window so other indicators can read them via input.source().
Concept credits
Relative-strength momentum and average true range — J. W. Wilder. Binomial score confidence interval — E. B. Wilson. Trend-efficiency regime measure — P. Kaufman. Least-squares regression — classical statistics.
Disclaimer
For research and education only. This is not financial advice, not a recommendation to buy or sell, and not a guarantee of future results. All performance shown is in-sample and past-only. Markets carry risk — do your own research and manage your own risk. Indikator

Indikator

Adaptive Volumetric Reversion Channel Fade ValidatorAdaptive Volumetric Reversion Channel — Fade Validator (AVRC)
What it is
AVRC is an anchored, volume-weighted regression channel that frames mean-reversion ("fade") setups and then gates, scores and validates them — so you can see whether fading stretched price actually has an edge on your symbol and timeframe instead of taking it on faith. It is a study / analysis framework, not a strategy and not a signal service.
Why these components are combined (the mashup rationale)
Fading an extreme asks three different questions, and no single classic tool answers all three. AVRC coordinates several non-redundant lenses on one shared geometry (an anchored regression channel) and one shared volatility unit (residual σ), so each lens can check the others rather than echoing it:
WHERE is price stretched? A volume-weighted regression centerline with residual-σ bands is drawn against a slower macro trend-relative volume map — volume binned by σ-distance from a longer regression line. Whether the tactical band sits in a thin (fast-traversed) or thick (heavily-traded) macro node tells you if a fade is likely clean or absorbed. This cross-read is the connective tissue between the two layers.
Is a reversion ACTUALLY firing? Independent "tells" at the band — a close-back rejection, a band-confluent momentum divergence, an equal-high/low liquidity sweep, and the macro-density read. Because these tells are correlated, their agreement is shrunk by a design-effect correction so echoes can't masquerade as independent confirmation.
Is the market in a reverting STATE? A regime gate (variance-ratio test + a reversion-trust correlation) only passes fades when price increments offset rather than compound. An entry-time ride-risk score (macro-trend alignment, the two-centerline spread, an already-walking band, momentum, mean-reversion half-life, and multi-timeframe trend consensus) flags fades likely to be "walked" rather than reverted.
The components share one geometry and one volatility unit, and each can veto the others. The goal is to suppress low-quality fades more than to generate them.
How the validation layer works (what makes this more than a drawing)
Every fade is logged and, a fixed horizon later, resolved: its forward return is measured in ATR units and tabulated Gate ON vs Gate OFF — follow-through %, a Wilson 95% interval, whipsaw %, and mean R per fade. Outcomes are additionally split Reverted vs Rode, by macro node (thin/thick), and by ride-risk (low/high at the running median). The panel's Edge line synthesizes this into a single read: is Gate ON's follow-through interval clearing the ungated baseline with positive mean R and enough samples? Per-fade rows also export to the Data Window for your own analysis. Every filter has to earn its place against the ungated baseline.
How to use it
Set the Price source (top of settings). Defaults are tuned for an intraday index future; the source is user-selectable so the framework runs on any symbol or market. Volume-based parts (heatmap, profile, POC) need a real volume feed.
Read the panel top-down: Now (live setup) → State (regime + spread + compression) → the A/B scoreboard (Gate OFF, Gate ON, Revert, Ride) → Edge verdict.
A fade arms when price tags the outer band and at least one tell prints, then passes only if the regime (and optional ride-risk) gate agrees. Target is the centerline or the nearest untested POC.
If Gate ON does not beat Gate OFF on follow-through and mean R with non-overlapping intervals and enough samples, the edge isn't there on this symbol/timeframe — change them, don't force it. The signal is clearest on higher intraday timeframes; 1-minute is mostly noise.
What is original here
The original work is the coordination: a shared-σ, timeframe-adaptive regression channel used as a reversion frame; a trend-relative volume map cross-read against the band; decorrelated tells fused by a design-effect shrink; a statistical regime gate; an entry-time ride-risk score; and a built-in A/B + forward-return validation harness — combined so each lens can veto the others and the tool reports its own hit rate. It is not a re-skin of any single indicator.
Concept credits (techniques are standard; this implementation is original)
Volume-weighted least-squares & polynomial regression; residual-σ channels; anchored VWAP (all standard); Volume Profile / Value Area / Point of Control — Market Profile (Steidlmayer / CBOT); Variance-Ratio test — Lo & MacKinlay (1988); design effect / effective sample size — Kish (1965); proportion confidence interval — Wilson (1927); mean-reversion half-life — Ornstein–Uhlenbeck process; ATR, RSI, Parabolic SAR — Wilder; Stochastic — Lane; Supertrend (classic, MTF context). Builds on established open-source regression-channel and anchored-VWAP techniques.
Settings (all defaults are on; tuned for an intraday index future)
Data/Source · Volatility unit · Macro volume heatmap · Tactical channel & bands · Interrelation & band-walk · Ride-risk filter · Density cross-read · Reversion tells · Regime gate · POC targets · Fade signal · Validation & export · Dashboard & theme (auto light/dark) · MTF trend context. The two signal-suppression gates (walk-gate, ride-gate) ship off so the indicator shows its signals and lets the validation panel tell you whether enabling them helps.
Disclaimer
For research and education only. NOT financial advice, NOT a recommendation, and NOT a guarantee of future results. All statistics shown are in-sample on loaded history, close-to-close at the horizon, without costs or slippage — a study aid, not a backtest. Mean reversion fails in trends and during regime breaks. Do your own research and manage your own risk. Indikator

Volumetric Regression Heatmap [LuxAlgo]The Volumetric Regression Heatmap indicator is a sophisticated market analysis tool that combines dynamic linear regression with volume profile density to visualize fair value and liquidity zones. By projecting volume-weighted heatmaps within a trend-following channel, it allows traders to identify where the bulk of trading activity has occurred relative to the current price trajectory.
🔶 USAGE
The indicator provides a multi-layered view of market structure. The central heatmap shows the "hottest" areas of volume concentration, acting as a magnet for price, while the outer bands represent statistical extremes.
🔹 Mean Reversion Signals
The script includes a built-in signal system designed for sideways or "flat" markets. When the indicator detects a "Contraction" state (determined by the ratio of channel height to standard deviation), it plots small circles at the +2/-2 standard deviation levels.
Green Circles: Potential long opportunities when price crosses below the lower signal band during a flat market.
Red Circles: Potential short opportunities when price crosses above the upper signal band during a flat market.
🔹 Future Projections & Profile
The heatmap extends beyond the current bar, providing a "Future Projection" zone. This allows traders to anticipate where support and resistance levels will be in the coming sessions. To the right of the projection, a Bookmap-style volume profile histogram displays the total volume distribution, helping to identify high-volume nodes (HVN) and low-volume nodes (LVN) at a glance.
🔶 DETAILS
🔹 Dynamic Auto-Adjusting Period
Unlike standard regression channels that use a fixed lookback, this tool features an adaptive engine. It calculates the ratio between short-term and long-term volatility (ATR).
In high-volatility environments, the channel period shrinks to become more reactive.
In low-volatility or ranging environments, the period expands to capture a broader structural view.
🔹 Volumetric Delta Histograms
The script calculates the approximate buying and selling volume for every candle within the lookback period. This data is visualized as histograms extending from the outer bands:
Top Band (Green): Displays buying pressure delta.
Bottom Band (Red): Displays selling pressure delta.
This allows traders to see not just where price is, but the intensity of the volume driving it toward the channel extremes.
🔶 SETTINGS
🔹 Core Settings
Source: The price source used for the regression calculation.
Base Period: The anchor length for the regression fit.
Dynamic Auto-Adjusting Period: Enables/disables the volatility-based adaptive lookback.
🔹 Heatmap Settings
Grid Rows Each Side: Determines the vertical resolution of the heatmap bands.
Gradient Smoothing: Applies a smoothing algorithm to the volume distribution for a cleaner visual gradient.
Colors 1-5: Customizable colors ranging from low-volume areas to high-volume "hot" zones.
🔹 Mean Reversion Signals
Signal Band (SD Multiplier): The standard deviation level required to trigger a signal.
Flat Slope Threshold: Controls how "flat" the channel must be to allow signals to appear, preventing counter-trend signals in strong trending markets.
🔹 Delta Histograms
Histogram Height Scale: Adjusts the vertical magnitude of the delta bars.
Histogram Bar Width: Sets the thickness of the individual delta lines.
🔹 Style & Options
Future Projection Length: How many bars to project the heatmap into the future.
Show Volume Profile Histogram: Toggles the right-sided volume distribution boxes.
🔹 Dashboard
Dashboard: Toggles the on-screen analytics panel.
Position/Size: Adjusts the location and scale of the dashboard UI.
Indikator

Event HorizonEvent Horizon is a historical analog projection fan designed to answer one practical question:
What has price tended to do after market conditions similar to the current one?
Instead of using a fixed crossover, oscillator threshold, or trend flip, this indicator builds a market fingerprint from the current chart, searches historical bars for similar conditions, and projects how those past analogs moved forward. The result is a visual forward fan showing possible path behavior, consensus direction, dispersion, confidence, and the closest historical analog path.
The goal is not to predict the future with certainty. The goal is to give traders a structured way to compare the current setup against similar historical environments and quickly see whether the analogs are aligned, scattered, bullish, bearish, or not useful.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
What makes this script different
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Most projection tools draw a channel, regression, moving average extension, or volatility cone from a fixed formula.
Event Horizon uses a historical analog engine. Each bar is converted into a multi-factor feature profile, then compared against prior market states using weighted Euclidean similarity. The closest historical analogs are used to create a forward projection fan.
The script combines:
• Historical analog matching
• Weighted Euclidean distance
• Regime-aware scoring
• Volatility and trend-state filtering
• Consensus projection logic
• Closest historical path overlay
• Agreement and confidence scoring
• Directional historical event dots
• A visual fan that shows uncertainty instead of one hard prediction
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
How it works
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1. Market fingerprint
The script measures the current market using multiple dimensions, including:
• Recent price movement
• Trend slope
• ATR expansion and compression
• Candle range and body behavior
• Wick imbalance
• Position relative to recent structure
• Breakout distance
• Volume ratio and volume trend
• ATR percentile
• ADX / trend strength
• Historical shape samples
This creates a multi-dimensional profile of the current setup.
2. Historical analog search
The current profile is compared to historical profiles on the same chart. Similarity is calculated with weighted Euclidean distance, so higher-value features such as trend, volatility regime, and price-shape behavior can matter more than smaller candle details.
Closer historical examples receive stronger match scores.
3. Regime awareness
The script also classifies the current environment into regimes such as trend, compression, volatility expansion, volume shock, or range/chop. Historical examples from incompatible regimes are penalized, helping reduce weak comparisons.
4. Forward projection
Once the best analogs are selected, the script looks at what actually happened after those historical setups. Those forward moves are normalized and projected from the current anchor point.
5. Consensus and confidence
The indicator summarizes the analog group with:
• Directional bias
• Agreement percentage
• Dispersion
• Confidence score
• Edge state: TRADEABLE, CAUTION, or NO EDGE
• Historical self-test statistics
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
How to read the fan
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The colored fan shows the projected analog field.
The colored median shows the consensus path of the analog set.
The white line shows the closest visible historical analog path. It is not a guaranteed target. It is the path taken by the most similar past setup selected by the engine.
The wider the fan, the more disagreement there is between analogs.
The tighter the fan, the more historically aligned the analogs are.
The confidence and edge label are important. A bullish-looking fan with low confidence or high dispersion should be treated differently than a bullish fan with strong agreement and cleaner regime structure.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Historical dots
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Historical event dots help visually review where prior projection events occurred.
• Bullish projection dots appear below price
• Bearish projection dots appear above price
• Mixed or neutral readings are visually separated
This makes it easier to inspect whether the indicator has been identifying useful directional conditions on the current symbol and timeframe.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
How to use it
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
For newer traders:
1. Start on the Daily or 4H chart.
2. Look at the colored median.
3. Check whether the white analog path agrees with the median.
4. Check confidence and agreement.
5. Avoid forcing trades when the label says NO EDGE or when dispersion is high.
A stronger bullish read usually has:
• Median path rising
• White analog path also rising
• Agreement above roughly 65%
• Confidence above roughly 70
• Low or medium dispersion
• Edge state showing TRADEABLE or CAUTION, not NO EDGE
A weaker or avoidable read usually has:
• Median and white path disagreeing
• Agreement near 50%
• High dispersion
• Low confidence
• Range/chop regime
• NO EDGE label
For experienced traders:
Use the fan as an analog-based context layer. It is most useful when combined with your own structure, liquidity, trend, support/resistance, volume, or macro view. The script is designed to show whether historical analog behavior supports or conflicts with the trade idea you already see on the chart.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Suggested settings
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Balanced stocks / ETFs:
• Mode: Current Bar Projection
• Visual Mode: Cinematic
• Fan Style: Hybrid Swarm + Contours
• Horizon: 30
• Memory Lookback: 1800
• Max Analogs: 30
• Minimum Analogs: 6
• Pre-Event Window: 20
• Shape Samples: 6
• Path Scale: 1.0
Crypto:
• Horizon: 24
• Memory Lookback: 2000 to 2500
• Path Scale: 0.75 to 0.90
• Flexible direction matching
Intraday:
• Horizon: 20 to 24
• Minimum Analogs: 8
• Path Scale: 0.75 to 1.0
• Use liquid symbols only
Trend continuation:
• Direction Matching: Strict
• Mirror Opposite Direction: Off
• Path Scale: 1.0
Reversal / exhaustion:
• Direction Matching: Flexible
• Mirror Opposite Direction: On
• Path Scale: 0.75
• Shorter horizon preferred
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Best use cases
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Event Horizon is best suited for:
• Liquid stocks
• Major ETFs
• Index products
• Major crypto pairs
• Trend continuation setups
• Post-compression expansion
• Structure breaks
• Swing-trade context
• Daily and 4H analysis
It is less suitable for:
• Illiquid symbols
• Very new tickers with limited history
• Low-volume penny stocks
• Earnings gaps
• Binary news events
• Extremely short scalping timeframes
• Markets with sudden one-off catalysts
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Important notes
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
This is an analog projection tool, not a standalone buy/sell system.
Historical similarity does not guarantee future behavior. Market structure, liquidity, volatility, news, and macro conditions can change quickly. The fan should be used as a decision-support layer, not as a guaranteed forecast.
The strongest readings occur when the median, white analog path, agreement, confidence, and regime state all point in the same direction.
The weakest readings occur when analogs are scattered, confidence is low, dispersion is high, or the script identifies a no-edge environment.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Summary
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Event Horizon turns historical market behavior into a forward analog projection fan.
It helps traders see:
• What similar past setups did next
• Whether those analogs agree or disagree
• Whether the current regime supports the projection
• Whether the projected path is tight or scattered
• Whether the setup has enough confidence to matter
Use it to add historical context, probability awareness, and regime-based discipline to your chart analysis.
Indikator

Dual Log Regression Channels [BigBeluga]Dual Log Regression Channels is a highly advanced multi-timeframe mathematical modeling terminal engineered for TradingView. It maps, projects, and blends two independent logarithmic regression channels directly onto your asset layout screen to deliver an institutional-grade perspective on trend structure, market cycles, and structural volume distributions.
By separating price discovery parameters into a long-term Macro Channel and an execution-focused Short Term Channel, this tool effectively resolves the classic trader conflict of assessing structural trend directions while looking for immediate micro execution setups. Rather than treating market space as flat, standard geometric lines, this engine runs an advanced curve-fitting algorithm over your data to follow the exponential nature of capital expansion and distribution.
🔵 INTUITIVE SYSTEM ARCHITECTURE & ENGINE FEATURES
1. Logarithmic Regression Curve Optimization
Non-Linear Structural Tracking: Standard linear regression struggles with volatile crypto or high-growth equity trends over massive lookback structures. This script continuously converts incoming data matrices into mathematical log-space, computes a best-fit ordinary least squares (OLS) linear progression, and converts the output back into exponential value curves.
Dual Horizons Convergence Layer: Tracks an extensive trend anchor block (defaulting to 300 bars) simultaneously with a highly responsive, high-velocity swing lookback matrix (defaulting to 50 bars). This exposes localized micro contractions occurring right at major macro boundary extremes.
Visual Deviation Spacing Bands: Channels automatically map out distinct volatility boundaries based on real-time Standard Deviation multipliers. This defines predictable mathematical risk corridors where asset expansions typically exhaust and snap back toward the median baseline.
2. Predictive Channel Extension & Real-Time Trend Direction Arrows
Dynamic Origin Trend Arrows: The engine processes a dedicated directional diagnostic framework at the precise historical start (origin node) of each lookback channel. It generates sharp, high-visibility glyph trend arrows ( ⇗ for structural uptrends and ⇘ for structural downtrends). These arrows offer an instant, real-time assessment of the mathematically calculated baseline slope, entirely bypassing visual guesswork when channels run relatively flat.
Forward-Projected Space Models: When enabled, both the Macro and Short-Term structural bands project forward into the future chart space blank zone (e.g., 50 bars ahead for Macro, 20 bars for Short-Term). This lets you visually identify intercept locations and major trend crossroads long before price action arrives.
3. Adaptive Embedded Channel Volume Profiles (VP)
Integrated Block Volume Binning Matrix: Moving beyond basic fixed or visible range volume profiles, this module segments and collects transacted volume profiles exclusively inside the exact coordinate boundaries of each respective channel.
Dynamic Coordinate-Aligned Shading Bars: The volume profile rows scale and project outward utilizing advanced polyline geometry arrays, maintaining structural alignment with the slope of the moving channel boundaries.
Point of Control (POC) Trailing Baselines: Automatically tracks and renders a crisp, high-visibility solid horizontal baseline ( POC Line ) marking the exact price bin location that attracted the highest volume concentration throughout that lookback phase.
4. Volumetric Delta Tracking Panels
Buy vs. Sell Volume Accumulation Blocks: Aggregates total execution volume during the lookback period, classifying volume based on bar polarity.
Net Order Flow Delta Percentages: Computes and prints the precise net mathematical buying/selling pressure delta inside the channel. This reveals quiet accumulation behavior or hidden distribution trends directly alongside your spatial boundary drawings.
🔵 SYSTEMATIC EXECUTION STRATEGIES & RISK INTERPRETATION
Confluence Zone Intercept Trading: Look for setups where the Short Term Channel’s outer standard deviation boundaries align directly with the Macro Channel's major structural lines. When a high-velocity micro asset trend exhausts itself at a long-term macro floor or ceiling, it marks a highly efficient, asymmetric inflection zone for trend continuation entries or macro reversals.
Volume Profile POC Mean Reversion Matrix: The volume profile POC lines show where massive institutional blocks shifted hands inside that channel's lifespan. If the market stretches thin near an upper outer boundary but net volumetric volume indicators begin shifting toward seller control, look for a swift mean-reversion move down toward the high-liquidity POC baseline node.
Trend Acceleration vs. Overextended Breakouts: When an asset forces a candle close completely outside the projected log channel boundaries, it flags an exceptional shift in trend velocity. If the Volume Delta percentage prints an explosive spike in that direction, it supports a trend acceleration play. If volume is thin, it warns you of a predatory, overextended fakeout structure that is likely to snap back into the central channel values.
🔵 INTERFACE CONFIGURATION AND PARAMETERS
Lookback & Deviation Tuning Blocks: Customize historical calculation boundaries and volatility widths separately for both trend layers to match any asset class or time frame preference.
Volume Profile Customization: Control the precise resolution of the volume profile by adjusting row count bins and max bar widths to match your specific layout.
Clean Workspace Overrides: Toggle visibility filters to hide median baselines, remove raw background asset lines, or completely customize color theme hex codes to fit cleanly within your setup without causing visual clutter.
Transform your charting environment from basic straight lines into an exponential, volume-weighted structural map with the Dual Log Regression Channels terminal. Indikator

Machine Learning: Volume-Weighted Mean Reversion [Dots3Red]█ MACHINE LEARNING: VOLUME-WEIGHTED MEARN REVERSION KERNEL REGRESSION
Nadaraya-Watson kernel regression is a non-parametric machine learning method. Unlike moving averages which apply fixed, predefined weights to historical bars, kernel regression derives each bar's weight from a mathematical function — the kernel — that measures how relevant that bar is to the current estimate. No hardcoded coefficients. No assumed shape. The model adapts purely from the data.
This script introduces a fundamental extension to the standard method: volume as a second weighting dimension . The result is a regression curve that gravitates toward price levels where real market participation occurred — not toward price levels where a clock happened to tick.
█ WHY KERNEL REGRESSION IS MACHINE LEARNING
The term machine learning describes algorithms that derive structure from data rather than from manually specified rules. Kernel regression satisfies this definition formally. The estimator computes:
ŷ = Σ [ w(i) × close ] / Σ
where each weight w(i) is determined by a kernel function — not by the programmer. The model decides, from the data, how much each historical bar should influence the current estimate. This is the same mathematical family as K-Nearest Neighbors, which weights neighbors by proximity. It is cited as a foundational non-parametric ML method in Bishop (2006) and Hastie et al. (2009), and is described as an attention mechanism in deep learning literature — the same concept behind transformer models. The claim is accurate, not cosmetic.
█ THE CORE INNOVATION — VOLUME WEIGHTING
Every existing Nadaraya-Watson implementation on TradingView uses a pure time kernel:
• Standard NW: w(i) = K(i/h)
This means a bar with 10,000 shares traded and a bar with 10,000,000 shares traded receive identical weight if they are the same number of bars away. A thin overnight drift and a high-volume institutional session influence the regression equally. That is statistically incorrect — volume is a direct measure of how much informational content a price bar carries.
This script uses a volume-weighted kernel:
• This script: w(i) = vol_norm(i) × K(i/h)
where vol_norm(i) is the bar's volume normalized against the peak volume in the lookback window, raised to a configurable power exponent. The regression estimate is therefore:
ŷ = Σ [ vol_norm(i) × K(i/h) × close ] / Σ
High-volume bars anchor the curve. Low-volume bars — thin sessions, overnight drift, holiday trading — contribute minimally. The regression finds where the market actually agreed on price, not just where the clock recorded a tick.
█ THREE KERNEL FUNCTIONS
All three apply the same volume weighting. The choice controls how rapidly influence decays with time distance:
• Rational Quadratic (default) — heavier tail than Gaussian. Bars from 40–60 periods ago still contribute meaningfully if they had high volume. Best for daily and weekly charts where old high-volume levels remain structurally relevant.
• Gaussian — standard bell curve decay. Weight drops sharply with distance. Best for intraday charts where recency matters more than historical anchors.
• Epanechnikov — hard cutoff at the bandwidth boundary. Anything beyond h periods receives zero weight. Produces the most locally sensitive regression. Best for fast charts requiring tight responsiveness.
█ SIGNAL LOGIC
The envelope bands are placed at a configurable multiple of ATR, standard deviation, or a fixed percentage above and below the regression line. Three band width methods are available to match different volatility contexts.
Two signal modes are available:
• Reversion mode (default) — a signal fires when price crosses back through the band after an extension. The ▲ label appears on the bar where price returns inside the lower band. The ▼ label appears on the bar where price returns inside the upper band. This confirms reversion has begun rather than anticipating it.
• Extension mode — enable Signal on extension close to fire a signal the moment price closes outside a band. This is an early warning — useful for alerts before the reversion bar arrives.
Additional signal filters: minimum bars between signals to prevent repeat firing, optional slope direction gate so signals only fire when the regression slope agrees with the signal direction.
█ WHAT YOU SEE ON THE CHART
Regression line
The volume-weighted fair value curve. Cyan when slope is rising, magenta when falling. This is where the model estimates price should be given the recent history of high-participation price levels.
Envelope bands
Upper and lower boundaries built from ATR, standard deviation, or a fixed percentage. The upper band is tinted red — resistance zone. The lower band is tinted green — support zone.
Bar coloring — 4 states
• Bright red — price closed above the upper band. Extended, statistically stretched above fair value.
• Bright green — price closed below the lower band. Extended, statistically stretched below fair value.
• Dim silver — price inside bands, regression rising or falling, i.e normal bullish or bearish context.
The contrast between fully saturated outside-band bars and dimmed inside-band bars makes overextension immediately visible without reading the scale.
Signal labels
▲ REVERT or ▼ REVERT with VW=XX% showing the volume weight of the signal bar. A signal at VW=85% fired on a high-participation bar. A signal at VW=9% fired on a thin bar — lower confidence.
Signal bar highlighting
Two additional layers available: a background flash on the signal bar and a thick vertical line through the bar's full range. Both are independently toggleable. The vertical line uses width=4 — the maximum Pine Script allows — making the signal bar visually distinct even when zoomed out.
Dashboard
Displays: current regression value, slope direction, band width, Bar Vol Weight meter (▰▰▰▱▱▱) showing how much influence the current bar has on the regression, active kernel type, volume weighting status, percentage distance from the regression midline, and non-repainting mode status.
█ NON-REPAINTING
When Non-Repainting Mode is enabled (default), all calculations use a bar offset. The current bar's close does not enter its own regression estimate. Historical signals visible on closed bars will not change as new bars form. Disable this to see a predictive (repainting) version where the current bar participates in its own estimate — useful for visual exploration but not recommended for backtesting or alerts.
█ HOW TO USE
Core use case — mean reversion
This is a mean reversion tool. It works best when price is oscillating rather than trending directionally. The recommended workflow:
1 — Confirm a ranging regime with a separate regime classifier before acting on signals.
2 — Wait for price to reach or pierce the upper or lower band (bars turn bright red or green).
3 — Check the VW% in the signal label. Higher volume weight on the signal bar = higher confidence.
4 — Enter on the reversion signal (▲ or ▼ label). Stop beyond the wick of the signal bar.
5 — Target the regression midline as the primary exit. The % from mid dashboard row tracks progress in real time.
Timeframe guidance
The volume-weighting advantage increases with timeframe because higher timeframes produce more meaningful volume data per bar. H4 and Daily are the strongest timeframes for this tool. For intraday use, reduce the Volume Weight Power to 0.3–0.5 to soften the impact of individual volume spikes.
Quick-start settings by asset class
• Stocks daily: Window=100, Bandwidth=8, Vol Power=1.0, ATR×2.0
• Crypto daily: Window=80, Bandwidth=6, Vol Power=0.7, ATR×1.8
• Forex H4: Window=100, Bandwidth=10, Vol Power=1.0, ATR×1.5
• Indices H1: Window=120, Bandwidth=12, Vol Power=0.8, Stdev×2.0
█ SETTINGS REFERENCE
Kernel Settings
• Lookback Window — number of historical bars in the regression. Larger = smoother, more lag.
• Bandwidth (h) — controls how fast kernel weight decays with time. Higher = older bars still contribute.
• Kernel Type — Gaussian / Rational Quadratic / Epanechnikov. See kernel section above.
• RQ Alpha (α) — Rational Quadratic only. Lower = smoother mixture of length scales.
• Non-Repainting Mode — uses offset. Recommended ON for backtesting.
Volume Weighting
• Enable Volume Weighting — toggle the core innovation on or off. OFF = standard NW.
• Volume Normalization Window — peak volume reference window. Match or exceed the lookback window.
• Volume Weight Power — exponent on the volume weight. 1.0 = linear. 2.0 = quadratic. 0.5 = softer.
• Volume Weight Floor — minimum weight for any bar. Prevents zero-volume bars from being ignored entirely.
Envelope Bands
• Band Width Method — ATR (volatility-adaptive), Stdev (statistical), or Percent (fixed).
• ATR Length — period for ATR calculation.
• ATR / Stdev Mult — multiplier applied to ATR or standard deviation.
• Percent Offset % — used when Percent method is selected.
Signals
• Signal on band crossover — enable signals on band cross events.
• Signal on extension close — fire signal when price closes outside a band (early warning mode).
• Require slope change — only signal when regression slope direction agrees.
• Min bars between signals — gap guard to prevent repeat signals.
Visuals
• Dashboard — regression stats and live metrics table.
• Signal labels — ▲/▼ REVERT labels with volume weight percentage.
• Band fill — fill between upper and lower bands.
• Background flash — bright background color on signal bars.
• Vertical line on signal bar — thick line through full bar height at signal.
• Large dot marker — additional plotchar layer on signal bars.
• Dashboard position — Top Right / Top Left / Bottom Right / Bottom Left.
█ ALERTS
Seven alert conditions are available:
• Long signal — reversion through lower band
• Short signal — reversion through upper band
• Any signal — either direction
• Extended below lower band — early warning before reversion fires
• Extended above upper band — early warning before reversion fires
• Regression slope turned bullish
• Regression slope turned bearish
█ DISCLAIMER
This indicator is a decision-support tool. It does not constitute financial advice and does not guarantee future results. Past statistical patterns do not predict future price behavior. Always use proper risk management.
Method: Nadaraya-Watson Kernel Regression (Non-Parametric ML)
Innovation: Volume × Time Kernel Weighting
Kernels: Gaussian · Rational Quadratic · Epanechnikov
Signals: Mean Reversion (band crossover or extension)
Repainting: Configurable — non-repainting mode available Indikator

Regression Trend Reversal Signals & Forecasts [AlgoAlpha]🟠 OVERVIEW
Regression Trend Reversal Signals & Forecasts combines multiple regression methods into a single trend and reversal framework. It allows traders to choose between Linear Regression, Theil-Sen Regression, LOESS smoothing, Nadaraya-Watson smoothing, Polynomial Regression, and a Kalman Filter to estimate the underlying price path.
The selected regression line acts as the center of a dynamic channel. The channel width is based on the standard deviation of the distance between price and the regression line, allowing it to adapt to changing market conditions.
The script also identifies potential reversal conditions when price extends beyond the channel and then shows signs of rejection. In addition, it can project the current regression slope forward to provide a simple forecast of the current trend path.
🟠 CONCEPTS
Regression Line — A statistical estimate of the underlying price trend. Different methods can be selected, ranging from straight-line regressions to adaptive smoothing techniques.
Theil-Sen Regression — A robust regression method that uses median slopes from all point pairs, reducing the influence of outlier price spikes.
LOESS Regression — A locally weighted regression that fits nearby observations more heavily than distant observations to create a smooth trend curve.
Nadaraya-Watson Smoothing — A kernel-weighted averaging method that estimates trend by assigning larger weights to recent observations.
Kalman Filter — A recursive estimation method that continuously updates the trend estimate as new prices arrive.
Polynomial Regression — A curved regression model that can capture non-linear trend structures using higher-order polynomial functions.
Regression Deviation Bands — Channel boundaries calculated from the standard deviation of price relative to the regression line.
Regression Slope — The rate of change of the regression estimate used to determine trend direction and forecast projections.
🟠 FEATURES
Regression Channel — Dynamic bands expand and contract based on how far price deviates from the regression line.
Trend Flip Signals — Generates directional markers when the regression trend changes from rising to falling or from falling to rising.
Reversal Signals — Marks potential bullish and bearish reversals when price extends beyond the channel and begins rejecting those extremes.
Forecast Projection — Extends the current regression slope into future bars and optionally displays projected channel boundaries.
🟠 HOW TO USE
Select a regression method that matches the market behavior you want to analyze. Linear and Theil-Sen are suited to directional trends, while LOESS, Nadaraya-Watson, and Kalman provide smoother adaptive estimates.
Use the regression line as the primary trend reference. Rising regression values indicate strengthening conditions, while falling values indicate weakening conditions.
Monitor the channel boundaries for extended price movement away from the regression estimate.
Watch for bullish reversal markers below the lower band after downside extensions and bearish reversal markers above the upper band after upside extensions.
Use trend flip signals as confirmation that the regression slope has changed direction.
Compare price location within the channel to gauge whether price is trading near trend equilibrium or at an extreme deviation.
Use the forecast projection as a continuation estimate of the current regression slope rather than a prediction of future market behavior.
🟠 CONCLUSION
Regression Reversal Signals combines multiple regression techniques, adaptive deviation channels, reversal detection, and forward projections into a single framework. By allowing traders to switch between several trend estimation methods, it provides different perspectives on trend structure and price deviation. The indicator helps identify trend direction, potential reversals, and areas where price has moved unusually far from its estimated path. Indikator

Polynomial/Linear Regression Volume Profile [BigBeluga]Polynomial/Linear Regression Volume Profile is a state-of-the-art charting framework that blends advanced statistical modeling with localized volume distribution analysis. By evolving past traditional, static horizontal volume profiles, this indicator dynamically curves the volume profile matrix around mathematical trend baselines, giving you a hyper-localized view of value zones, support, and resistance across the trend’s lifecycle.
Equipped with a switchable Ordinary Least Squares (OLS) calculation engine, traders can analyze price distribution relative to a straight path (Linear) or an adaptive structural arc (Polynomial).
🔵 RECURSIVE REGRESSION BASELINES
Adaptive Curve Fitting Engine: Choose between a straight-line trend tracking framework (Linear) or an advanced second-degree curved path (Polynomial). This non-linear baseline curves dynamically to track real institutional momentum shifts, avoiding the lag or rigid delays typical of standard moving averages.
Symmetric Grid Segmentation: The indicator slices the regression space into dynamic parallel layers above and below the center line. These tracking cells act as a structural map of the trend, automatically expanding or contracting based on the mathematical bounds of the lookback period.
Standard Deviation Wave Bands: Plots dedicated tracking envelopes at 1, 2, and 3 Standard Deviations. This maps statistical extremes instantly, highlighting key valuation zones directly on the chart.
🔵 CURVED ORDER FLOW PROFILE
Dynamic Trend-Anchored Volume Profile: Traditional volume profiles are anchored strictly to vertical price grids. This framework bends the profile horizontally along the path of the regression curve. This ensures volume is localized directly relative to the trend's value matrix rather than arbitrary static prices.
Dynamic Point of Control Matrix (POC): The tool calculates cumulative transaction weights across each regression row. The absolute highest volume cluster is highlighted across the entire lookback window as a vivid Point of Control (POC) baseline, serving as a primary target magnet for price discovery.
Gradient Density Mapping: Volume bins are colored with a responsive heat-map gradient. Low-volume zones fade into deep baseline tones, while high-volume institutional interest areas light up dynamically, reflecting heavy positional accumulation.
🔵 DATA INTERFACE & CONTROLS
Regression Matrix Dashboard (Top-Right): A neat information center providing live metrics, including current trend direction (Bullish/Bearish), the numerical value of the POC level, the exact transactional volume resting at that key node, and structural $\pm3\text{ SD}$ channel limits.
Precision Profile Scaling: Adjust the profile width parameters to limit or extend how far back profile bins stretch across your chart space to prevent layout clutter.
Complete Style Personalization: Individualized visual controls allow you to switch line architectures (Solid, Dashed, Dotted) across baselines, boundaries, and POC paths.
🔵 STRATEGIC APPLICATION
Trading the Trend Value Nodes: Treat the dynamic POC line as a trend anchor. In a strong bullish trend, pullback entries occurring at a highly concentrated, heat-mapped POC node represent low-risk, high-probability entry criteria.
Mean Reversion at Statistical Boundaries: When price extends completely out to the dynamic outer channel limit and volume density in that outer bin thins out, look for a swift mean-reversion snapback toward the baseline.
Volume Profile Breakouts: Low-volume zones (gaps in the curved profile) indicate price levels that the market skipped quickly due to high momentum. If price breaks past a thick volume node into a low-volume zone, it is likely to sprint quickly toward the next major heat-mapped node.
Structural Regime Tracking: Use the upper-right dashboard to instantly evaluate macro status. If the matrix shifts between Bullish and Bearish while price hovers consistently near a high-volume POC, it implies heavy institutional distribution is occurring before the next major expansion.
Polynomial/Linear Regression Volume Profile redefines volume structure. By wrapping the laws of order flow directly around mathematical curves, it gives trend traders an elite perspective to trade with precision, statistical logic, and institutional order flow visibility. Indikator

Structural Inefficiency Radar [JOAT]Structural Inefficiency Radar
Introduction
Structural Inefficiency Radar measures regression fair value, residual z-score, path asymmetry, volatility clustering, and repair/extension force.
This open-source indicator is designed as a context tool, not a standalone trading system. It focuses on explaining the current market state with restrained visuals and confirmed-bar logic where signals are used.
Core Concepts
1. Regression Fair Value
A linear regression spine represents statistical fair value.
2. Residual Z-Score
Distance from fair value is normalized by residual standard deviation.
3. Path Asymmetry
Upward and downward path movement are compared to detect directional distortion.
4. Repair and Extension Force
Deviation, slope, asymmetry, and clustering determine whether price is extending or repairing.
z = (close - fairValue) / residualDeviation
Features
Fair-value spine
Inner and outer inefficiency bands
Residual z-score
Repair and extension scoring
E+ and E- labels plus repair markers
Input Parameters
Regression and residual windows
Deviation gate
Repair quality gate
Cooldown
Bands, candles, and HUD toggles
How to Use This Script
Use the spine and bands to frame structural stretch. Extension labels indicate directional inefficiency; gold markers indicate fair-value repair.
Limitations
The script uses historical OHLCV data and cannot know future prices.
Signals and states can be late during fast reversals because confirmed-bar logic is used to reduce repainting.
Model outputs should be interpreted with market context, risk controls, and independent analysis.
No visual state should be treated as a certain trade outcome.
Originality Statement
SIR is original in combining regression residuals, path asymmetry, clustering, repair force, and extension force.
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice, investment advice, or a recommendation to buy or sell any financial instrument. All calculations are derived from historical market data and may produce inaccurate readings in some market conditions. No indicator can predict future market behavior. Use proper risk management and independent judgment.
-Made with passion by jackofalltrades
Indikator

Bitcoin Compressing Power Law ChannelBitcoin Compressing Power Law Channel
Most Bitcoin power-law channels draw bands of a fixed width around a long-term trendline. This one is different: the channel width is not constant. It starts wide and compresses exponentially as Bitcoin matures, modeling the idea that long-term volatility around the trend tends to shrink over time. That decaying width is the core idea of this indicator.
Why a compressing channel
A standard power-law channel assumes the spread between its upper and lower bounds stays the same across Bitcoin's entire history. In practice, an asset's relative volatility tends to fall as it grows larger and more liquid. This indicator captures that by letting the channel narrow over time toward a configurable floor, so the bounds reflect a maturing market rather than a permanently fixed range.
How it works
The model assumes log(price) scales linearly with log(days since the genesis block), producing a fair-value trendline: logFair = intercept + slope * log10(days). A lower bound is offset below that line, and the upper bound is placed above the lower bound at a distance set by the channel width.
The width itself is the original part: width = minWidth + startWidth * exp(-decaySpeed * yearsSinceGenesis). Early in Bitcoin's history the exponential term is large and the channel is wide. As years pass, that term shrinks toward zero and the width converges to a minimum floor (minWidth). The result is a channel whose envelope tightens over time instead of staying fixed.
What it plots
Three lines in price space (upper, middle, lower) with a shaded fill between the upper and lower bounds. Optionally, a 200 SMA of the current timeframe and a 200 SMA from the weekly timeframe, each toggleable. The weekly SMA is requested from a higher timeframe with lookahead disabled, so it does not repaint using future data. A normalized "Decay Channel Oscillator" is exposed in the Data Window, showing where the current close sits within the channel on a 0 to 1 scale (0 = lower bound, 1 = upper bound).
Inputs
Every model parameter is adjustable: the genesis date, the power-law intercept and slope, the lower offset, the initial and minimum channel widths, and the decay speed that controls how fast the channel compresses. Colors for each line, the fill, and both SMAs are configurable.
How to use it
Apply it to a Bitcoin chart on a longer timeframe such as Daily or Weekly, where a power-law model is most meaningful. The middle line is the model's central estimate; the upper and lower lines describe the expected long-term range, narrowing as time goes on. The Data Window oscillator lets you read how stretched price is within the channel numerically.
Parameters and calibration
The default intercept and slope are starting values that approximate Bitcoin's historical power-law fit. They are not fixed truths. You should re-evaluate them and adjust them, along with the offset, widths, and decay speed, to suit your own analysis and the data range you are studying. Different calibrations will move the channel and change how aggressively it compresses.
Limitations and cautions
This is a model, not a prediction. The power-law relationship is an empirical observation that may break down at any time, and the decay parameters are assumptions, not facts. The compressing width is a hypothesis about volatility maturing over time; it may not hold. This indicator is built for Bitcoin and is not intended for other assets. Nothing here forecasts future prices, and the past behavior of the channel does not guarantee anything about how price will behave going forward.
The code is open-source under the Mozilla Public License 2.0. You are welcome to study it and build on it. Indikator

Kinetic Inertia Field [JOAT]Kinetic Inertia Field
Introduction
Kinetic Inertia Field models price like a noisy particle using velocity, acceleration, jerk, kinetic energy, potential displacement, and equilibrium deviation.
This open-source indicator is designed as a context tool, not a standalone trading system. It focuses on explaining the current market state with restrained visuals and confirmed-bar logic where signals are used.
Core Concepts
1. Velocity and Acceleration
Log returns are normalized by volatility to create velocity, then differentiated into acceleration and jerk.
2. Kinetic Energy
Inverse volatility acts as a mass proxy and squared velocity creates energy context.
3. Equilibrium Displacement
A regression/VWAP blend creates a fair path and ATR-normalized displacement.
4. Inertia Field
Energy, acceleration, and displacement combine into inertial up, inertial down, or elastic state.
kineticEnergy = 0.5 * mass * velocity * velocity
Features
Velocity, acceleration, and jerk model
Kinetic and potential energy scoring
Regression/VWAP equilibrium
Energy rails and impulse trace
K+ and K- labels plus snapback markers
Input Parameters
Velocity smoothing
Volatility memory
Equilibrium horizon
Energy and inertia gates
Cooldown and display toggles
How to Use This Script
Use K+ and K- as confirmed high-energy state changes. Gold markers show elastic snapback conditions.
Limitations
The script uses historical OHLCV data and cannot know future prices.
Signals and states can be late during fast reversals because confirmed-bar logic is used to reduce repainting.
Model outputs should be interpreted with market context, risk controls, and independent analysis.
No visual state should be treated as a certain trade outcome.
Originality Statement
KIF is original in applying kinetic energy, potential displacement, and inertia scoring to price-state analysis.
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice, investment advice, or a recommendation to buy or sell any financial instrument. All calculations are derived from historical market data and may produce inaccurate readings in some market conditions. No indicator can predict future market behavior. Use proper risk management and independent judgment.
-Made with passion by jackofalltrades
Indikator

Orion Regression Field [JOAT]Orion Regression Field
Introduction
Orion Regression Field builds a weighted regression valuation field with standard error bands, curvature options, compression detection, and reprice signals.
This open-source indicator is designed as a context tool, not a standalone trading system. It focuses on explaining the current market state with restrained visuals and confirmed-bar logic where signals are used.
Core Concepts
1. Weighted Regression
Recent bars can receive more influence while still preserving a full model window.
2. Standard Error Bands
Inner and outer bands show statistical distance from the modeled path.
3. Curvature and Confidence
Optional curvature and R2-style confidence control when the field is considered reliable.
4. Pinch and Reprice
Compression and outer-band reactions create filtered reprice events.
mid = weightedRegression(close, len); band = standardError * multiplier
Features
Weighted regression midline
Inner and outer SEE bands
Optional curvature
Pinch shading and projection field
Filtered reprice labels
Input Parameters
Regression window and projection bars
Curvature toggle and weight floor
Minimum R2 confidence
Inner and outer band multipliers
Pinch ratio and cooldown
How to Use This Script
Use the field as statistical fair-value context. Outer band interaction means stretch, not automatic reversal.
Limitations
The script uses historical OHLCV data and cannot know future prices.
Signals and states can be late during fast reversals because confirmed-bar logic is used to reduce repainting.
Model outputs should be interpreted with market context, risk controls, and independent analysis.
No visual state should be treated as a certain trade outcome.
Originality Statement
Orion is original in combining weighted regression, curvature, standard error fields, compression context, and filtered reprice logic.
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice, investment advice, or a recommendation to buy or sell any financial instrument. All calculations are derived from historical market data and may produce inaccurate readings in some market conditions. No indicator can predict future market behavior. Use proper risk management and independent judgment.
-Made with passion by jackofalltrades
Indikator

Helios Pullback Framework [JOAT]Helios Pullback Framework
Introduction
Helios Pullback Framework evaluates pullback quality using ALMA trend stack, regression trajectory, pullback depth, wick recovery, liquidity capture, compression, and HTF bias.
This open-source indicator is designed as a context tool, not a standalone trading system. It focuses on explaining the current market state with restrained visuals and confirmed-bar logic where signals are used.
Core Concepts
1. ALMA Trend Stack
Fast and slow ALMA lines define execution and institutional spines.
2. Regression Trajectory
A regression envelope provides dynamic path context rather than static zones.
3. Pullback Quality
Pullback depth, wick recovery, phase impulse, and stretch are scored.
4. Liquidity Capture
Confirmed sweeps of recent highs or lows contribute only when aligned with bias.
score = bias + pullDepth + wickRecovery + sweep + compression + htf
Features
ALMA trend stack
Regression trajectory envelope
Pullback depth and wick recovery scoring
Liquidity capture markers
Sparse P+ and P- labels
Input Parameters
ALMA lengths
Volatility and trajectory length
HTF and optional session gate
Signal score, cooldown, and max stretch
Display toggles
How to Use This Script
Use P+ and P- labels as pullback-quality events inside an existing bias. Gold circles mark liquidity capture without full confirmation.
Limitations
The script uses historical OHLCV data and cannot know future prices.
Signals and states can be late during fast reversals because confirmed-bar logic is used to reduce repainting.
Model outputs should be interpreted with market context, risk controls, and independent analysis.
No visual state should be treated as a certain trade outcome.
Originality Statement
Helios is original in replacing supply/demand boxes with a cleaner model that scores pullback elasticity, trajectory, and liquidity capture.
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice, investment advice, or a recommendation to buy or sell any financial instrument. All calculations are derived from historical market data and may produce inaccurate readings in some market conditions. No indicator can predict future market behavior. Use proper risk management and independent judgment.
-Made with passion by jackofalltrades
Indikator

Predictive Breakout Channels | GainzAlgoAbout the Indicator
The Predictive Breakout Channels indicator is a predictive machine-learning engine designed to map institutional market structure and calculate the statistical probability of impending breakouts. Instead of relying on traditional lagging indicators, the system dynamically anchors itself to major market pivots using a rolling Linear Regression Channel framework.
By evaluating a combination of localized trend correlation, relative strength, institutional volume distribution, and variance metrics, the engine projects real-time target zones while simultaneously calculating a directional probability score directly on the chart the moment a breakout occurs.
Dynamically anchors to institutional pivot structures
Uses a rolling Linear Regression Channel
Evaluates trend correlation, RSI, and variance metrics
Projects real-time ATR-based target zones
Calculates breakout probability scores directly on-chart
Designed to distinguish genuine breakouts from fakeouts
The Core Theory of Breakouts
Markets spend the majority of their time consolidating rather than trending. During these equilibrium phases, liquidity pools accumulate on both sides of the range while volatility compresses beneath the surface.
A breakout represents the structural transition from equilibrium into expansion.
When institutional order flow aggressively consumes localized liquidity, price breaches structural boundaries and volatility rapidly expands outward. The challenge for traders has never been identifying that a breakout occurred — the real challenge is determining whether the move has enough structural backing to sustain itself or whether it is simply a liquidity trap designed to reverse shortly afterward.
The Predictive Breakout Channels engine was specifically designed to address that exact problem.
The Logic Engine — ANOVA & The Power of Variance
To help solve the fakeout problem, this engine incorporates ANOVA, short for Analysis of Variance.
Originally developed by legendary statistician Ronald Fisher, ANOVA has historically served as one of the foundational statistical tools used throughout medical research, behavioral science, and high-level quantitative analysis. Its purpose is to determine whether differences between groups of data are statistically meaningful or simply random noise.
In this indicator, that same statistical framework is adapted directly to price action.
The engine continuously evaluates the structural differences between groups of candle data — including highs, lows, and closes — in real time in order to measure the quality and significance of underlying market expansion.
The Niche Secret — F-Statistic & Volatility Compression
Quantitative modeling revealed a particularly powerful characteristic regarding variance measurements inside the ANOVA engine.
When the raw ANOVA F-Statistic becomes drastically elevated, or when the standardized Z-Score breaches extreme thresholds such as 2 standard deviations, it often signals a state of hyper-compressed market consolidation.
Think of it like winding a mechanical spring tighter and tighter.
As variance compresses to rare statistical extremes, market energy begins building beneath the surface. Eventually that stored pressure releases through aggressive volatility expansion.
This variance surge acts as a leading indicator for impending volatility before the actual breakout even occurs.
However, variance alone cannot determine directional bias. Because of this, the engine layers in additional confirmation modules such as RSI and Trend Correlation Length to help determine whether institutional momentum is favoring bullish or bearish continuation.
Indicator Settings & Customization
The system is fully modular, allowing traders to fine-tune the engine based on their preferred asset class, timeframe, or trading style.
Anchored LinReg Channel Settings: Customize left and right pivot lookbacks alongside standard deviation multipliers to control how the channel dynamically anchors itself to price structure.
ANOVA Confirmation: Fine-tune the lookback period and baseline Z-Score thresholds required for breakout validation.
Feature Filters: Adjust RSI and Trend Correlation baseline lengths to make directional probability scoring more aggressive or more selective.
High Variance Alert Label: Disabled by default. When enabled, the engine plots visual warning labels whenever variance compression reaches statistically elevated levels.
Include HTF Trend Filter: Controls whether breakout signals are filtered using higher timeframe trend conditions.
The Strategic Dilemma — Higher Timeframe Trend Filtering
The indicator includes a dedicated HTF Trend Filter toggle that leverages higher timeframe EMA spreads to determine whether lower timeframe breakout signals align with broader institutional trend conditions.
Choosing whether to enable this filter depends entirely on the type of market environment you prefer trading.
1. HTF Filter ON — Trend Following Regime
Filters out a significant amount of lower timeframe noise
Produces fewer but statistically stronger breakout signals
Aligns entries with broader institutional money flow
Increases overall follow-through probability
However, because the engine becomes heavily biased toward the macro trend, it may intentionally suppress counter-trend reversals or early-stage trend shifts.
2. HTF Filter OFF — Agile / Mean-Reversion Regime
Allows the engine to react dynamically in both directions
Captures sharp intraday reversals more aggressively
Performs well in swinging or range-bound environments
Increases breakout frequency substantially
The tradeoff is naturally higher exposure to lower timeframe noise and shorter average continuation during counter-trend conditions.
How to Trade with the Indicator
When price closes outside the Linear Regression Channel while simultaneously satisfying the statistical validation criteria, the engine prints a breakout entry signal alongside a projected probability score.
At the same time, the system projects 4 distinct ATR-based Target Zones labeled T1 through T4.
Aggressive Traders: May choose to execute immediately on the breakout close while targeting T2 or T3 with structural stops positioned back within the channel.
Conservative Traders: May choose to use the Probability Score as a filter or wait for a localized retest of the broken channel boundary before entering.
The High Variance Play
When the High Variance Alert label appears, traders should avoid impulsively chasing the immediate candle.
Instead, the label should be treated as an early warning that volatility expansion is rapidly approaching.
The preferred approach is to wait for the subsequent confirmed breakout signal, then trade the resulting momentum expansion into the projected target zones.
High variance does not predict direction
It predicts volatility expansion
Directional confirmation comes afterward through breakout validation
Wrapping It Up
The Predictive Breakout Channels indicator bridges quantitative data science with classic market microstructure principles.
By treating volatility as a measurable statistical property rather than a visual guessing game, the engine helps traders identify where the market is coiling, estimate the probability of expansion, and navigate breakout environments using structured statistical confirmation instead of emotion.
Whether used for momentum continuation, volatility expansion, or intraday breakout trading, the system was designed to provide traders with a clearer framework for distinguishing meaningful expansion from market noise. Indikator

Helix Regime Corridor [JOAT]Helix Regime Corridor
Introduction
Helix Regime Corridor is an open-source regime and entry-state indicator built around adaptive ATR bands, structural CHoCH events, regression context, transition memory, and risk rails. It is designed to show when price is moving under bullish control, bearish control, or a less decisive transition state.
The script solves the problem of treating every trend flip the same. It requires directional control, structure, volatility, and confluence scoring before marking a confirmed shift.
Core Concepts
1. Adaptive Regime Corridor
The central trend average and surrounding ATR bands adapt to current market volatility. The corridor shows whether price is operating above, below, or inside the active control area.
2. Confirmed Holds
The script can require price to hold beyond the corridor for a configurable number of bars. This helps reduce single-candle fakeouts.
3. CHoCH-Assisted Structure
Pivot highs and lows identify structural change. Bullish or bearish CHoCH events can support a new regime shift when price breaks prior structure.
4. Regression Context
An optional regression field provides broader directional context and helps identify whether the active shift is aligned with the recent linear price path.
5. Transition Memory
The script tracks transition behavior over a configurable memory window. This adds a probability-style context layer without claiming certainty.
Features
Adaptive ATR corridor: Volatility-adjusted bands frame bullish and bearish control.
Regime shift detection: Identifies confirmed changes into bullish or bearish control.
CHoCH structure: Optional structure-assisted entries using pivot confirmation.
Confluence scoring: Signals require score alignment rather than a single moving-average cross.
Risk rails: Entry, stop, TP1, TP2, and TP3 references can be drawn for confirmed shifts.
Candle tinting: Bars can be colored by current state.
Optional regression channel: Adds broader context when desired.
HUD: Shows regime, score, transition, ADX/ATR, regression, structure, and bias.
Alerts: Long shift, short shift, bull regime, bear regime, bullish CHoCH, and bearish CHoCH.
Input Parameters
Core: Operating Preset, Adaptive Average Length, ATR Length, ATR Band Multiplier, Confirmed Hold Bars.
Structure and Signals: Pivot Left, Pivot Right, Regression Context Length, Transition Memory, Directional Strength Length, Minimum Shift Score, Allow CHoCH-Assisted Entries, Signal Cooldown Bars.
Risk and Visuals: Structure Stop Lookback, Stop ATR Buffer, TP1 R, TP2 R, TP3 R, Rail Projection Bars, Adaptive Bands, Trend Cloud, Regression Channel, Candle Tint, Pivot Marks, HUD.
How to Use This Indicator
Step 1: Read the regime
Use the corridor and dashboard to identify whether price is under bullish control, bearish control, or a weaker transitional state.
Step 2: Wait for score confirmation
Long and short shifts are only marked when the configured confluence score is reached.
Step 3: Compare structure
CHoCH events help explain whether a shift is supported by structural change or only by band behavior.
Indicator Limitations
Pivot structure confirms after the required right-side bars complete.
Adaptive bands can lag sharp reversals because they are volatility-based.
Transition memory summarizes recent behavior; it does not forecast future price.
Risk rails do not account for spread, slippage, or order execution.
Originality Statement
Helix Regime Corridor is original in its combination of adaptive ATR control bands, hold confirmation, CHoCH structure, regression context, transition memory, confluence scoring, and risk rails. The components are combined to classify regime and produce cleaner shift states rather than simply plotting a trend band.
Disclaimer
This script is for educational and informational use only. It is not financial advice and does not recommend any trade. Trend and regime models can fail in ranges, news events, and abnormal volatility. Always manage risk independently.
Made with passion by jackofalltrades
Indikator

SwingRegress Volatility Analytics [MarkitTick]💡 A comprehensive, multi-dimensional charting tool designed to fuse structural market analysis, statistically derived linear regression pathways, and volatility compression mechanics into a single, cohesive interface. By dynamically adapting its calculations to the latest shifts in market structure—specifically Change of Character (CHoCH) events—this script offers an adaptive mapping of price action, trend trajectory, and potential breakout zones directly on the primary chart.
● ✨ Originality and Utility
Traditional linear regression tools often require manual anchoring or rely on fixed lookback periods that fail to adapt to rapidly unfolding price dynamics. The distinct utility of this script lies in its self-adjusting structural anchoring mechanism. By automatically locking the regression baseline to the most recent significant pivot high or pivot low immediately following a structural break, the channel remains mathematically and contextually relevant to the current market regime.
Furthermore, this tool eliminates the need for separate sub-chart oscillators by integrating a sophisticated Smart Volatility Squeeze engine. This engine compares price variance against true range to identify periods of extreme price compression, overlaying these signals directly within the active regression pathway. The result is a unified, chart-centric view of both directional trend geometry and kinetic energy build-up, allowing for a more focused and uncluttered analytical process.
● 🔬 Methodology and Concepts
The underlying logic of this script is driven by three core mathematical engines operating in tandem:
• Pivot Discovery and Market Structure
The script continuously scans incoming price data to identify localized extremes, defined as Pivot Highs and Pivot Lows. A candidate bar is confirmed as a pivot only if it remains unbroken for a user-defined number of bars both prior to and following its occurrence. Once confirmed, these pivots establish the market structure. If the closing price breaks beyond the most recent opposing pivot, a Change of Character (CHoCH) is triggered, officially shifting the trend state.
• Anchored Linear Regression
Upon the confirmation of a new CHoCH, the script calculates a fresh Linear Regression Channel (LRC). The anchoring point is the origin pivot of the newly established trend. The script uses the Ordinary Least Squares (OLS) method to compute the slope and intercept of the best-fit line through the closing prices of the current regime. It then calculates the standard error of the estimate (standard deviation of the residuals) to project upper and lower variance bands parallel to the mid-line.
• Volatility Squeeze Mechanics
To identify volatility compression, the script employs a comparative analysis between standard deviation and Average True Range (ATR). It calculates a Bollinger Band (representing standard deviation) and a Keltner Channel (representing ATR) around a moving average baseline. A "squeeze" is structurally confirmed when the outer limits of the Bollinger Bands contract entirely within the boundaries of the Keltner Channels. This signifies that historical variance has dropped substantially below the average true range, often preceding a dynamic expansion in price movement.
● 🎨 Visual Guide
The visual interface is highly detailed and structurally color-coded to provide immediate contextual awareness without cluttering the chart.
• Current Anchored LRC
Mid Line: A solid Neon Cyan line representing the true mean of the current trend regime.
Band 1: A dashed Soft Cyan line mapping the first standard deviation threshold.
Band 2: A dotted Deep Azure line mapping the secondary, outer standard deviation extreme.
• Previous Anchored LRC
Mid Line: A solid Magenta line representing the historical mean of the preceding trend.
Band 1: A dashed Soft Magenta line for the historical inner variance.
Band 2: A dotted Blue-Violet line for the historical outer variance.
• Swing Point Zones
Swing High Boxes: Translucent red zones originating from a confirmed pivot high, drawing forward to act as dynamic resistance until broken by price action.
Swing Low Boxes: Translucent green zones originating from a confirmed pivot low, acting as dynamic support until structurally invalidated.
• Volatility Squeeze Candles
Cyber Gold Candles: When the market enters a state of extreme volatility compression (Bollinger Bands inside Keltner Channels) and is actively trading within the current or previous LRC pathway, the candles are painted a vibrant gold to highlight imminent kinetic release.
• Heads-Up Dashboard Display
Located in the top right corner, this self-updating data matrix provides critical real-time telemetry:
Structure Regime: Displays the active directional bias (Bullish, Bearish, or Neutral).
Last CHoCH: Indicates the direction and age (in bars) of the most recent structural shift.
Squeeze Intensity: A visual block-bar measuring the depth of the volatility compression.
ATR (14): The current absolute value of the Average True Range.
Dist to Swings: The percentage distance between the current price and the nearest Swing High/Low.
Risk/Reward Quality: A dynamic measurement of potential risk versus structural reward.
LRC Window Age: The duration of the current regression channel in bars.
LRC Position: Indicates whether price is currently trading inside the active regression channel, the previous channel, or is entirely unanchored.
● 📖 How to Use
The primary application of this tool is identifying high-probability continuation or mean-reversion setups following structural confirmation.
When a CHoCH event occurs, wait for the new Linear Regression Channel to populate. This channel defines your trading parameters. A high-probability setup manifests when price pulls back to the inner or mid-line of the active LRC, accompanied by the appearance of Cyber Gold squeeze candles. This visual confluence suggests that price is compressing directly at the statistical mean of the new trend, building energy for a move in the direction of the underlying structural regime.
Conversely, if price approaches the outer standard deviation bands (Deep Azure) without structural confirmation of a breakout, it suggests the market is statistically overextended, offering a potential mean-reversion opportunity back toward the Neon Cyan mid-line.
Note on Mechanics: Because the pivot discovery process requires a defined number of bars to confirm a swing high or low, there is an inherent lookback period. The swing zones will only appear after the pivot has been structurally verified. Furthermore, the linear regression channel recalculates its slope dynamically as new price data is added to the active regime, meaning the exact angle of the channel adapts in real-time until a new CHoCH locks it into history as the "Previous LRC."
● ⚙️ Inputs and Settings
The configuration panel is logically divided into primary analytical modules to allow for precise user calibration.
• Current Anchored CHoCH LRC
Adjust the sensitivity of the pivot discovery engine by modifying the Left and Right Pivot Bars. You can also customize the multipliers for the primary and secondary standard deviation bands, as well as toggle their visibility and modify line weights.
• Previous Anchored CHoCH LRC
Allows for the toggling of the historical channel, providing context on how the previous trend failed. Color and visibility settings are fully adjustable here.
• Swing Points & Zones Settings
Toggle the structural resistance and support boxes on or off, and customize their respective color opacities for a cleaner chart overlay.
• Smart Volatility Squeeze (BB vs KC)
Tune the underlying volatility engine. You can adjust the lookback length for the variance baseline, as well as the specific deviation multipliers for both the Bollinger Band boundaries and the Keltner Channel limits.
• Webhook Execution Configuration
Input exact JSON payload action names for algorithmic execution routing (Long, Short, Close Long, Close Short).
• Dashboard Settings
Customize the background and text colors of the heads-up data matrix to match your specific chart theme.
● 🔍 Deconstruction of the Underlying Scientific and Academic Framework
The mathematical foundation of this script is anchored heavily in econometrics and statistical probability theory.
At its core, the linear regression calculation utilizes the Ordinary Least Squares (OLS) estimator. This formula determines the line of best fit through a sequence of time-series data points by minimizing the sum of the squared differences (residuals) between the observed closing prices and the values predicted by the linear model. The slope of this line represents the average rate of change per unit of time, mathematically quantifying the drift of the active regime.
The parallel bands wrapping the regression line are derived by calculating the standard error of the estimate. Assuming the residuals are normally distributed (Gaussian distribution), one standard deviation captures approximately 68 percent of the price variance, while two standard deviations capture roughly 95 percent. When price moves beyond these outer bands, it represents a statistically significant deviation from the mean, inherently increasing the probabilistic likelihood of mean reversion.
The volatility squeeze mechanic operates on the principle of variance compression. Bollinger Bands are a derivative of standard deviation, making them highly reactive to short-term variance. Keltner Channels utilize the Average True Range (ATR), which measures absolute periodic volatility independent of a central mean. When the standard deviation of price contracts to such a degree that the Bollinger Bands fall entirely within the ATR-based Keltner Channels, it statistically confirms a state of anomalous energy compression. In financial academia, periods of artificially suppressed variance are overwhelmingly followed by periods of geometric expansion, providing the theoretical basis for breakout execution.
⚠️ Disclaimer
All provided scripts and indicators are strictly for educational exploration and must not be interpreted as financial advice or a recommendation to execute trades. I expressly disclaim all liability for any financial losses or damages that may result, directly or indirectly, from the reliance on or application of these tools. Market participation carries inherent risk where past performance never guarantees future returns, leaving all investment decisions and due diligence solely at your own discretion. Indikator

SuperTrend Logistic Regression | Flux ChartsGENERAL OVERVIEW
The SuperTrend Logistic Regression indicator combines the classic SuperTrend trend-following tool with a self-training logistic regression model that assigns a probability percentage to every SuperTrend flip. Each time the SuperTrend changes direction, the indicator evaluates the market conditions at the flip across 14 features spanning candle structure, trend context, and technical indicators, then outputs a probability score between 0% and 100% representing how similar the current setup is to past flips that resolved profitably on the same chart.
The model trains itself in real time using past SuperTrend signals as labeled examples. Each historical flip becomes a training example: the features captured at the flip are paired with the outcome at the next opposite flip, producing a continuously growing dataset that the model uses to refine its weights. The probability displayed on each new flip reflects what the model has learned about this specific instrument and timeframe, not a universal assumption about what makes a good signal.
screenshot: Full chart showing SuperTrend line with multiple flips and probability labels
🔹What is the purpose of the indicator?
The indicator addresses a common problem with SuperTrend: not every flip leads to a sustained trend. Many flips occur during choppy or transitional conditions and reverse quickly, producing losing signals. By scoring each flip with a probability, traders get a quantitative sense of how much confidence the model has in that specific signal based on similar past setups. The indicator does not change the SuperTrend calculation itself, so every flip is still detected and visualized. The probability score adds a filtering layer that helps traders separate high-confidence flips from low-confidence ones.
🔹What is the theory behind the indicator?
The indicator is built on the idea that market behavior around trend reversals is not random. Certain combinations of candle structure, volatility conditions, volume patterns, and prior trend context tend to precede trends that follow through, while different combinations tend to precede trends that reverse quickly. Logistic regression is a statistical method well-suited to learning these relationships. Given a set of input features and historical outcomes, it produces a set of weights that map feature combinations to probability estimates.
In this indicator, each SuperTrend flip becomes a data point. The features at the flip are recorded, and the outcome is determined at the next opposite flip. If price moved in the signal's direction (higher for bull, lower for bear), the signal is labeled as a win. Otherwise, it is labeled as a loss. The model continuously retrains on this growing dataset, adjusting weights so that feature patterns historically associated with wins produce higher probabilities, and feature patterns associated with losses produce lower probabilities.
SUPERTREND LOGISTIC REGRESSION FEATURES
SuperTrend Core
Logistic Regression Model
Candle Features
Trend Context Features
Technical Features
Separate Bull and Bear Models
Exponential Decay Weighting
Minimum Sample Gating
Probability Labels and Filtering
Gradient-Colored SuperTrend Visualization
Optional Momentum Dots
Alerts
SUPERTREND CORE
The SuperTrend is the foundation of every signal. All detection, training, and prediction is tied to SuperTrend flips. The core SuperTrend calculation in this indicator is standard: ATR multiplied by a user-defined factor produces the trailing line, and a flip occurs when price crosses through the line, changing the direction state.
🔹How SuperTrend is calculated
The SuperTrend is derived from Average True Range (ATR) with a user-configurable period and factor. When the calculated line is below price, the indicator is in an uptrend state and the line acts as dynamic support. When the line is above price, the indicator is in a downtrend state and the line acts as dynamic resistance. A flip occurs at the exact bar where price crosses through the line, changing the direction from bullish to bearish or vice versa.
🔹Why SuperTrend was chosen
SuperTrend is one of the most widely used trend-following tools on TradingView. It produces clean, deterministic signals with well-understood behavior. Rather than reinventing or modifying the underlying calculation, this indicator treats SuperTrend as a signal source and adds a separate statistical layer on top. This keeps the core behavior familiar to traders already using SuperTrend and ensures that every flip is still detected, regardless of the probability score.
🔹SuperTrend Inputs
Two inputs control the SuperTrend calculation: Factor (the ATR multiplier, default 3.0) and ATR Period (the number of bars in the ATR calculation, default 10). These correspond to the standard SuperTrend parameters. Changing these values affects where flips occur, which in turn affects what signals the model trains on.
LOGISTIC REGRESSION MODEL
Logistic regression is a statistical model that predicts binary outcomes from a set of input features. It takes each feature, multiplies it by a learned weight, sums the results, adds a bias term, and passes the total through a sigmoid function that maps the output to a probability between 0 and 1. The model learns the weights by comparing its predictions against actual outcomes and adjusting through gradient descent.
🔹What is Logistic Regression?
Logistic regression works by finding the set of weights that best separates winning signals from losing signals in feature space. A large positive weight on a feature means that higher values of that feature are associated with winning outcomes. A large negative weight means higher values are associated with losing outcomes. A weight near zero means the feature does not discriminate between winners and losers on this chart.
The sigmoid function is what turns the weighted sum into a probability. It outputs values near 0 when the weighted sum is very negative, values near 1 when the weighted sum is very positive, and values near 0.5 when the weighted sum is near zero. This gives the output a natural probability interpretation.
🔹How the model is trained
Training happens every time a new SuperTrend flip occurs. The indicator looks at all past resolved signals (signals that have already seen their next opposite flip and therefore have a known outcome) and runs gradient descent over them. Gradient descent calculates how much each weight should change to reduce the model's prediction error, then applies those changes iteratively. The indicator runs multiple training epochs on each update to ensure the weights converge reasonably well to the current data.
L2 regularization is applied to prevent any single weight from becoming extreme. Weight clipping further constrains weights to a reasonable range, avoiding instability when training data is thin or features are noisy. Together, these make the model more robust on small sample sizes.
🔹Outcome evaluation
For training to work, every historical signal needs a win/loss label. The indicator uses flip-to-flip evaluation: a bull signal is considered a win if the close at the next bear flip is higher than the close at the bull flip. A bear signal is considered a win if the close at the next bull flip is lower than the close at the bear flip. This matches the natural lifecycle of a SuperTrend trade, where entry and exit are both on flips.
🔹A Winning Signal Example
A winning bull signal forms when a bull flip occurs and, by the time the next bear flip occurs, the close at the bear flip is higher than the close at the bull flip. The probability label on the bull flip reflects the model's confidence at entry, while the outcome is confirmed at the next flip.
🔹A Losing Signal Example
A losing signal forms when price fails to move in the signal's direction by the next opposite flip. For example, a bull flip where price immediately reverses and ends lower than entry when the next bear flip occurs.
CANDLE FEATURES
Candle features describe the shape and volume of the flip candle itself, compared against recent averages. These are the most direct, local features the model uses. All candle features are toggleable in the "Candle Features" input group and are normalized to a range centered at zero, where zero means the feature value matches the recent average.
🔹Body
Body measures the size of the flip candle's body (the absolute distance from open to close) relative to the average body size over the recent lookback window. A value above zero means the flip candle had a larger body than recent candles, suggesting stronger conviction. A value below zero means the body was smaller than usual, suggesting indecision. The model learns whether strong-bodied flips tend to produce winning trends on this chart.
🔹Upper Wick
Upper Wick measures the length of the upper wick (the distance from the body top to the high) relative to recent average upper wicks. Long upper wicks can indicate rejection at highs, while short upper wicks suggest price accepted the top of the candle cleanly. The model learns how upper wick behavior at flips correlates with outcomes.
🔹Lower Wick
Lower Wick measures the length of the lower wick (the distance from the body bottom to the low) relative to recent average lower wicks. Long lower wicks can indicate rejection at lows, while short lower wicks suggest clean acceptance. This feature is disabled by default because it historically showed the weakest predictive signal across tested instruments.
🔹Range
Range measures the total high-to-low range of the flip candle relative to the recent average range. A wide-range flip candle indicates volatility expansion, while a tight-range candle suggests contraction. The model learns whether flips during volatility expansion tend to perform differently from flips during contraction.
🔹Volume
Volume compares the flip candle's volume to the average volume over the recent lookback window. Higher than average volume at a flip generally indicates stronger participation, while lower than average volume suggests weak conviction. The model learns how volume conviction at flips relates to trend outcomes.
🔹Delta Volume
Delta Volume estimates the net buying versus selling pressure within the flip candle by sampling 1-minute lower timeframe bars. The indicator distributes each 1-minute bar's volume to either the bullish or bearish side based on whether that bar closed up or down, then outputs the net direction as a feature value from fully bearish to fully bullish. This gives the model a finer-grained view of what happened inside the flip candle beyond the aggregate close.
TREND CONTEXT FEATURES
Trend context features describe the market conditions leading into the flip, not just the flip candle itself. These are calculated from the lookback window before the flip. All trend context features are toggleable in the "Trend Features" input group.
🔹Momentum
Momentum counts consecutive candle direction leading into the flip. Each bullish candle increments the streak in the positive direction, and each bearish candle increments it in the negative direction. The value is capped so very long streaks do not dominate. A strongly positive momentum value before a bull flip indicates buying was already building; a strongly negative value before a bull flip indicates a sharp reversal from recent selling. The model learns which regime tends to produce better bull outcomes.
🔹Pre-Flip Trend
Pre-Flip Trend averages the signed candle bodies (close minus open) over the recent lookback window, normalized by the average range. This gives a broader picture of whether the market was drifting up, drifting down, or chopping sideways before the flip. Unlike momentum, which only counts direction, pre-flip trend captures the magnitude of the directional bias.
🔹ATR Slope
ATR Slope compares the current ATR value to the ATR value from the lookback period ago. A positive slope means volatility is expanding into the flip, often associated with stronger follow-through. A negative slope means volatility is contracting, often associated with weaker signals. The model learns whether volatility expansion at the flip is a positive or negative factor for the specific instrument.
🔹Volume Trend
Volume Trend compares the average volume of recent bars to the average volume of bars further back. A positive value means participation is increasing; a negative value means it is fading. This feature is disabled by default because it historically showed weak signal across tested instruments.
🔹ST Distance
ST Distance measures how far price was from the SuperTrend line before the flip, normalized by ATR. A value near zero means the flip was a tight cross; a larger absolute value means price was well above or below the line and had to travel significantly to trigger the flip. The model learns whether tight crosses or aggressive breaks produce better outcomes.
🔹Trend Duration
Trend Duration measures how many bars the previous trend lasted before flipping. Short previous trends might indicate choppy conditions where flips come and go quickly. Longer previous trends might signal genuine exhaustion at reversal. The model learns how previous trend length relates to the success of the current flip.
TECHNICAL FEATURES
Technical features bring in classic technical indicator readings at the flip point. These are toggleable in the "Technical Features" input group.
🔹RSI
RSI (Relative Strength Index) is calculated with the same lookback as the other features and then centered around the 50 level. Values near the oversold end push the feature toward -1, values near the overbought end push it toward +1, and values near 50 are near zero. The model learns whether overbought or oversold RSI readings at flips correlate with different outcomes on the specific chart. On some instruments, flips at extreme RSI readings perform well; on others, they perform poorly. The model discovers this from the data.
🔹BB Position
BB Position measures where price sits within Bollinger Bands at the flip. Price at the lower band gives a value of -1, price at the basis gives 0, and price at the upper band gives +1. The Bollinger Bands are calculated with the same lookback as the other features. This feature captures mean-reversion versus breakout context: a flip near the lower band is different from a flip near the upper band, and the model learns which band positions tend to precede successful trends.
SEPARATE BULL AND BEAR MODELS
The indicator maintains completely independent models for bull signals and bear signals. Each has its own set of weights, its own training dataset, and its own prediction logic.
🔹Why separate models?
A single model that assumes features mean opposite things for opposite directions would be an oversimplification. For example, a long lower wick on a bull flip might indicate strong buyer defense, while a long lower wick on a bear flip might indicate weak sellers. These are different setups with different implications, and forcing them into one model with flipped signs would blur the signal.
By training separate bull and bear models, the indicator gives each direction room to learn its own relationships. A feature that strongly predicts bull wins might be irrelevant or even negatively correlated for bear wins, and the separate models can capture this without interference.
🔹Implementation
Each direction has its own array of signals and its own weights array. When a bull flip occurs, the bull signals array is updated and the bull model is retrained. When a bear flip occurs, the bear signals array and bear model are updated separately. The two models never share state, and their predictions are based only on their own training data.
EXPONENTIAL DECAY WEIGHTING
Not all training examples are equally relevant. Recent signals reflect current market conditions, while older signals may reflect regimes that no longer apply. The indicator addresses this with exponential decay weighting during training.
🔹How decay works
Each resolved signal is assigned a weight based on its age. The newest resolved signal gets the highest weight (1.0 after normalization), and older signals get progressively smaller weights based on a decay factor. A decay factor close to 1 means old and new signals are weighted roughly equally. A decay factor close to 0 means recent signals dominate and old signals are effectively ignored.
🔹Why decay is important
Markets change. A feature that strongly predicted wins six months ago might have weak or reversed predictive power now. Without decay weighting, the model would be slow to adapt to new conditions because old data would dilute the influence of recent outcomes. With decay weighting, the model naturally updates its weights to reflect the most recent dynamics while still using historical data to maintain stability.
PROBABILITY LABELS AND FILTERING
When a new flip passes the minimum sample gate, the indicator calculates the probability from the current feature values and the trained weights. This is displayed as a colored triangle label at the flip bar.
🔹Label Appearance
Bull flip labels appear below the bar as upward-pointing green triangles with the probability percentage inside. Bear flip labels appear above the bar as downward-pointing red triangles with the probability percentage inside. The colors are partially transparent so the labels do not obscure price action.
🔹High Probability Example
A high probability label means the model found the current flip's features similar to past flips that resolved as wins. For example, a bull flip with strong pre-flip momentum, expanding volatility, positive delta volume, and price well above the SuperTrend line might receive a probability above 65% if those conditions have historically preceded successful bull trends.
🔹Low Probability Example
A low probability label means the model found the current flip's features similar to past flips that resolved as losses. Low probability signals might share characteristics with flips that occurred during choppy conditions or weak momentum regimes.
🔹Min Probability Filter
A Min Probability input lets users hide labels below a confidence threshold. Setting it to 0 shows every signal. Setting it to 60 only shows labels where the model estimates at least 60% probability of a profitable outcome. This filter only affects visual display and alerts. The SuperTrend line and color change still appear on every flip, and the model still trains on every signal regardless of the filter.
🔹Interpreting the probability
The probability represents the model's estimate that the current flip will resolve profitably by the next opposite flip, based on how similar past flips performed. A 70% label does not guarantee a win; it means the model finds this flip's conditions more similar to past winners than past losers. Probabilities should be interpreted relative to the base rate (the overall percentage of past flips that won) rather than as absolute guarantees.
VISUAL CUSTOMIZATION
The indicator includes several visual elements that help traders see the SuperTrend state and the probability labels clearly.
🔹Gradient-Colored SuperTrend
The SuperTrend line is plotted with a color gradient based on how far current price has moved from the line since the most recent flip. The color intensifies as price extends further in the trend direction, giving a visual indication of how developed the trend is at any point. Fills between the body midpoint and the SuperTrend line reinforce this gradient effect.
🔹Momentum Dots
An optional momentum dots display overlays circles on the SuperTrend line with colors that shift between yellow and the trend color (green or red) based on price position. This provides a secondary visual cue for trend strength. The Enable Momentum Dots input toggles this display on or off.
INPUTS
🔹SuperTrend
Factor: ATR multiplier used in the SuperTrend calculation. Default is 3.0. Increasing this value makes the SuperTrend less sensitive and produces fewer, wider flips. Decreasing it makes the SuperTrend more sensitive and produces more frequent flips.
ATR Period: Number of bars used in the ATR calculation. Default is 10. Larger periods smooth the ATR, while smaller periods make it more reactive.
🔹Display
Enable Momentum Dots: Toggles the momentum dots overlay on the SuperTrend line. Default is on.
🔹Filters
Min Probability %: Minimum probability required for a signal label to appear on the chart. Default is 0 (show all signals). Setting this to a higher value hides lower-confidence signals.
🔹Candle Features
Body: Enable body size feature. Default is on.
Upper Wick: Enable upper wick feature. Default is on.
Lower Wick: Enable lower wick feature. Default is off.
Range: Enable candle range feature. Default is on.
Volume: Enable volume feature. Default is on.
Delta Vol: Enable delta volume feature using 1-minute LTF data. Default is on.
🔹Trend Features
Momentum: Enable consecutive candle direction feature. Default is on.
Pre-Flip Trend: Enable average directional body feature. Default is on.
ATR Slope: Enable volatility expansion feature. Default is on.
Volume Trend: Enable volume building feature. Default is off.
ST Distance: Enable distance from SuperTrend line feature. Default is on.
Trend Duration: Enable previous trend length feature. Default is on.
🔹Technical Features
RSI: Enable RSI feature. Default is on.
BB Position: Enable Bollinger Band position feature. Default is on.
ALERTS
The indicator includes alert conditions for the following events:
Bull Flip: Fires on a confirmed bullish SuperTrend flip that passes the Min Probability filter.
Bear Flip: Fires on a confirmed bearish SuperTrend flip that passes the Min Probability filter.
Users can configure alerts from the TradingView alerts menu and choose which condition to subscribe to.
IMPORTANT NOTES
🔹Non-Repainting Behavior
Signals are detected and probability labels are calculated on the bar where the SuperTrend flip confirms. The probability value is based only on feature values at the time of the flip and the model weights as of that bar. The outcome label used for training is only recorded after the next opposite flip has occurred, so the current bar's prediction never uses future data.
🔹Probability Interpretation
The probability represents the model's learned estimate from past data on the current chart. It is not a guaranteed win rate. Markets can shift in ways the model has not yet seen, and sample size is always a limitation. Probabilities should be used as one input among many in a trading decision, not as a standalone signal.
UNIQUENESS
The SuperTrend Logistic Regression indicator takes a distinct approach to SuperTrend enhancement. Rather than altering the SuperTrend calculation itself, it preserves the classic SuperTrend behavior and adds a statistical layer on top that scores each flip independently. Every flip is still detected, so users never miss signals; the probability only determines what gets visually emphasized. The logistic regression implementation uses proper gradient descent with L2 regularization, weight clipping, and exponential decay weighting, making the training process stable and adaptive. Weights persist across bars and are refined with each new resolved signal rather than being recalculated from scratch. Separate bull and bear models learn direction-specific feature relationships independently, avoiding the oversimplification of assuming features have opposite meanings for opposite directions. All 14 features are toggleable, spanning candle structure, trend context, and technical indicators, so users can customize which market characteristics feed into the model. The probability is backed by a concrete, testable definition: the likelihood that the current flip will resolve profitably by the time the next opposite flip occurs, based on how similar past flips performed. This matches how SuperTrend is naturally traded on flip-to-flip cycles. Minimum sample gating ensures that probability labels only appear once the model has enough training data to make meaningful predictions, preventing misleading early signals. Together, these choices make the indicator a disciplined, data-driven extension of SuperTrend that adapts to each instrument and timeframe it runs on, rather than applying a one-size-fits-all scoring system. Indikator

Iterative Epanechnikov ChannelThe Iterative Epanechnikov Channel is a kernel-based smoothing and state estimation framework that applies an Epanechnikov kernel regression to price data, combined with a rolling standard deviation envelope to construct adaptive dynamic channel boundaries.
Unlike kernels with infinite support that allow distant historical observations to influence the estimate, the Epanechnikov kernel uses a compact weighting structure that strictly limits influence to a finite window. This ensures that only relevant, recent price information contributes to the regression, resulting in a more localized and structurally responsive estimate of price behavior.
The resulting channel is structurally responsive while remaining statistically efficient, making it particularly effective for tracking short-to-intermediate trend development, identifying localized overextension, and adapting quickly to evolving conditions.
Its primary utility is as a state estimation and structural tracking tool for price behavior, rather than a persistence-weighted regime model.
TRADING USES
The Epanechnikov Channel is best interpreted as a localized structural filter; within a multi-model framework, it captures the immediate structural state of price, helping distinguish early transitions, active trends, and short-term disequilibrium relative to slower, memory-weighted estimators.
Trend Detection
The channel basis line (Epanechnikov smoothed price) provides a responsive representation of underlying market direction. Sustained movement above or below the basis reflects directional continuation, while rapid shifts in the basis can indicate emerging changes in trend.
Structural Responsiveness
Due to the compact support of the Epanechnikov kernel, only recent price data contributes to the estimate. This produces sharper turning points and faster adaptation to new information, allowing the channel to respond efficiently to changes in market structure.
Mean Reversion Context
Because the estimator is more localized, price interacts with the channel boundaries more frequently. These interactions represent short-term deviations from the estimated state:
- Upper band: localized overextension
- Lower band: localized underextension
This makes the channel well-suited for mean reversion frameworks and volatility-based entry timing.
State Estimation
The channel functions as a continuous estimator of market state:
- The basis represents the inferred local price state
- The envelope represents dynamic volatility dispersion around that state
Compared to heavy-tailed kernels, the Epanechnikov-based state estimate is more sensitive to current conditions and less influenced by distant history, providing a clearer view of present market structure.
Volatility & Risk Context
The rolling standard deviation envelope expands and contracts based on realized volatility, providing a contextual risk framework. Wider channels indicate increased uncertainty and dispersion, while tighter channels indicate compression and lower variance conditions.
THEORY
The Epanechnikov kernel is a quadratic, compact-support kernel used in Nadaraya–Watson nonparametric regression, introduced by V. A. Epanechnikov (1969, Non-Parametric Estimation of a Multivariate Probability Density, Theory of Probability & Its Applications) as the mean squared error–optimal bounded kernel; in this implementation it is applied causally (non-repainting) and centered at the current bar using only historical data, with the original startAtBar offset removed to maintain proper kernel alignment with the estimation point.
It is defined as:
K(u) = 3/4 (1 − u²), for |u| ≤ 1
Where:
---> u represents normalized distance from the current observation
---> ℓ (lookback) defines the window over which the kernel operates
Unlike Gaussian kernels, which apply exponentially decaying weights over an infinite range, the Epanechnikov kernel assigns zero weight to all observations outside its finite support. This produces a strictly localized estimator that is both computationally efficient and statistically optimal in a mean squared error sense among bounded kernels.
Because the kernel is centered on the current observation and evaluated using only past data, the implementation remains causal and non-repainting while preserving the essential structure of kernel regression.
The rolling standard deviation complements this by measuring dispersion around the estimated state, forming a volatility-adaptive envelope. Rather than acting as a strict statistical confidence interval, it provides a dynamic representation of market expansion and contraction. The Epanechnikov kernel is a localized smoothing estimator rather than a structural similarity model, thus dispersion is defined using price-based volatility rather than kernel-weighted variance, providing a stable and interpretable envelope consistent with its role as a reactive state estimator.
The iterative implementation processes data sequentially (bar-by-bar), ensuring computational efficiency and making the indicator suitable for real-time use without repainting.
CALIBRATION
Calibration determines the balance between responsiveness, noise, and structural clarity.
Length (Lookback)
- Lower (8–16): More responsive, increased sensitivity to short-term structure
- Medium (20–40): Balanced for swing trading and intermediate regimes
- Higher (50–64+): Smoother output, reduced noise, slower response to turning points
Smoothing Mode (Single vs Double Pass)
Controls the tradeoff between responsiveness and stability:
Single Pass:
- Pure Epanechnikov regression
- Maximum responsiveness
- Faster detection of structural changes
- Increased sensitivity to noise
Double Pass:
- Applies the kernel regression twice
- Reduces variance and smooths fluctuations
- Produces cleaner structural output
- Introduces additional lag
This parameter allows users to tune the indicator based on whether early signal detection or stability is preferred.
MARKET USAGE
Stock, Forex, Crypto, Commodities, and Indices. Indikator
