VWAP Supply & Demand Zones PRO**Overview:**
This script represents a major evolution of the original "VWAP Supply and Demand Zones" indicator. Initially created to explore price interaction with VWAP, it has now matured into a robust and feature-rich tool for identifying high-probability zones of institutional buying and selling pressure. The update introduces volume and momentum validation, dynamic zone management, alert logic, and a visual dashboard (HUD) — all designed for improved precision and clarity. The structural improvements, anti-repainting logic, and significant added utility warranted releasing this as a new script rather than a minor update.
---
### What It Does:
This indicator dynamically detects **supply and demand zones** using VWAP-based logic combined with **volume** and **momentum confirmation**. When price crosses VWAP with strength, it identifies the potential zone of excess demand (below VWAP) or supply (above VWAP), marking it visually with colored regions on the chart.
Each zone is extended for a user-defined duration, monitored for touch interactions (tests), and tracked for possible breaks. The script helps traders interpret price behavior around these institutional zones as either **reversal** opportunities or **continuation** confirmation depending on context and strategy preference.
---
### How It Works:
* **VWAP Basis**: Zones are anchored at VWAP at the time of a significant cross.
* **Volume & Momentum Filters**: Crosses are only considered valid if backed by above-average volume and notable price momentum.
* **Zone Drawing**: Validated supply and demand zones are drawn as boxes on the chart. Each is extended forward for a customizable number of bars.
* **Touch Counting**: Zones track the number of price touches. Alerts are issued after a user-defined number of tests.
* **Break Detection**: If price closes significantly beyond a zone boundary, the zone is marked as broken and visually dimmed.
* **Visual Dashboard (HUD)**: A compact real-time HUD displays VWAP value, active zone counts, and current market bias.
---
### How to Use It:
**Reversal Trading:**
* Look for price **rejecting** a zone after touching it.
* Use rejection candles or secondary indicators (e.g., RSI divergence) to confirm.
* These setups may offer low-risk entries when price respects the zone.
**Continuation Trading:**
* A **break of a zone** suggests strong directional bias.
* Use confirmed zone breaks to enter in the direction of momentum.
* Ideal in trending environments, especially with high volume and ATR movement.
---
### Key Inputs:
* **VWAP Length**: Moving VWAP period (default: 20)
* **Zone Width %**: Percentage size of zone buffer (default: 0.5%)
* **Min Touches**: How many times price must test a zone before alerts trigger
* **Zone Extension**: How far into the future zones are projected
* **Volume & ATR Filters**: Ensure only strong, valid crossovers create zones
---
### Alerts:
You can enable alerts for:
* **New zone creation**
* **Zone tests (after minimum touch count)**
* **Zone breaks**
* **VWAP crosses**
* **Active presence inside a zone (entry conditions)**
These alerts help automate market monitoring, making it suitable for discretionary or systematic workflows.
---
### Why It's a New Script:
This is not a cosmetic update. The internal logic, signal generation, filtering methodology, visual engine, and UX framework have been entirely rebuilt from the ground up. The result is a highly adaptive, precision-oriented tool — appropriate for intraday scalpers and swing traders alike. It goes far beyond the original in terms of functionality and reliability, justifying a fresh release.
---
### Suitable Markets and Timeframes:
* Works across all liquid markets (crypto, equities, futures, forex)
* Best used on timeframes where volume data is stable (5m and above recommended)
* Recalibrate inputs for optimal detection across instruments
Regressions
Wavelet Filter with Adaptive Upsampling [BackQuant]Wavelet Filter with Adaptive Upsampling
The Wavelet Filter with Adaptive Upsampling is an advanced filtering and signal reconstruction tool designed to enhance the analysis of financial time series data. It combines wavelet transforms with adaptive upsampling techniques to filter and reconstruct price data, making it ideal for capturing subtle market movements and enhancing trend detection. This system uses high-pass and low-pass filters to decompose the price series into different frequency components, applying adaptive thresholding to eliminate noise and preserve relevant signal information.
Shout out to Loxx for the Least Squares fitting of trigonometric series and Quinn and Fernandes algorithm for finding frequency
www.tradingview.com
Key Features
1. Frequency Decomposition with High-Pass and Low-Pass Filters:
The indicator decomposes the input time series using high-pass and low-pass filters to separate the high-frequency (detail) and low-frequency (trend) components of the data. This decomposition allows for a more accurate analysis of underlying trends, while mitigating the impact of noise.
2. Soft Thresholding for Noise Reduction:
A soft thresholding function is applied to the high-frequency component, allowing for the reduction of noise while retaining significant market signals. This function adjusts the coefficients of the high-frequency data, removing small fluctuations and leaving only the essential price movements.
3. Adaptive Upsampling Process:
The upsampling process in this script can be customized using different methods: sinusoidal upsampling, advanced upsampling, and simple upsampling. Each method serves a unique purpose:
Sinusoidal Upsample uses a sine wave to interpolate between data points, providing a smooth transition.
Advanced Upsample utilizes a Quinn-Fernandes algorithm to estimate frequency and apply more sophisticated interpolation techniques, adapting to the market’s cyclical behavior.
Simple Upsample linearly interpolates between data points, providing a basic upsampling technique for less complex analysis.
4. Reconstruction of Filtered Signal:
The indicator reconstructs the filtered signal by summing the high and low-frequency components after upsampling. This allows for a detailed yet smooth representation of the original time series, which can be used for analyzing underlying trends in the market.
5. Visualization of Reconstructed Data:
The reconstructed series is plotted, showing how the upsampling and filtering process enhances the clarity of the price movements. Additionally, the script provides the option to visualize the log returns of the reconstructed series as a histogram, with positive returns shown in green and negative returns in red.
6. Cumulative Series and Trend Detection:
A cumulative series is plotted to visualize the compounded effect of the filtered and reconstructed data. This feature helps traders track the overall performance of the asset over time, identifying whether the asset is following a sustained upward or downward trend.
7. Adaptive Thresholding and Noise Estimation:
The system estimates the noise level in the high-frequency component and applies an adaptive thresholding process based on the standard deviation of the downsampled data. This ensures that only significant price movements are retained, further refining the trend analysis.
8. Customizable Parameters for Flexibility:
Users can customize the following parameters to adjust the behavior of the indicator:
Frequency and Phase Shift: Control the periodicity of the wavelet transformation and the phase of the upsampling function.
Upsample Factor: Adjust the level of interpolation applied during the upsampling process.
Smoothing Period: Determine the length of time used to smooth the signal, helping to filter out short-term fluctuations.
References
Enhancing Cross-Sectional Currency Strategies with Context-Aware Learning to Rank
arxiv.org
Daubechies Wavelet - Wikipedia
en.wikipedia.org
Quinn Fernandes Fourier Transform of Filtered Price by Loxx
Note on Usage for Mean-Reversion Strategy
This indicator is primarily designed for trend-following strategies. However, by taking the inverse of the signals, it can be adapted for mean-reversion strategies. This involves buying underperforming assets and selling outperforming ones. Caution: This method may not work effectively with highly correlated assets, as the price movements between correlated assets tend to mirror each other, limiting the effectiveness of mean-reversion strategies.
Final Thoughts
The Wavelet Filter with Adaptive Upsampling is a powerful tool for traders seeking to improve their understanding of market trends and noise. By using advanced wavelet decomposition and adaptive upsampling, this system offers a clearer, more refined picture of price movements, enhancing trend-following strategies. It’s particularly useful for detecting subtle shifts in market momentum and reconstructing price data in a way that removes noise, providing more accurate insights into market conditions.
📉 VWAP 회귀 기반 반대매매 전략 (개선 v2)An indicator for generating a counter-trade signal based on VWAP regression.
Patrick BTC Exponential ModelA test of an exp reversion model, WIP
BTC(t) = a × e^(r × t)
Where:
- BTC(t) = Bitcoin price at time t
- a = Anchor coefficient (fitted parameter)
- r = Growth rate per year (fitted parameter)
- t = Years since anchor date
- e = Euler's number (2.71828...)
Credit to @GallantCryptoYT (but based on, no implication of endorsement either way)
IVO Trend IndicatorIVO Trend Indicator
-----------------------------------------
OBJECTIVE
As we all know, there are a multitude of indicators that aim to improve our trading operations, but many of them are confusing, and using several simultaneously can lead to trading errors. The indicator we have developed is based exclusively on the use of moving averages, so that together they are able to more accurately detect three important trading factors: TREND, STRENGTH, and MOMENTUM.
------------------------------------------
HOW DOES IT CALCULATE THE 3 BASE VARIABLES?
The indicator uses four moving averages to identify these three variables.
1) TREND
Using two moving averages, we detect the chart's trend depending on how they cross and separate, so that the result will be (BULL, BEAR, NEUTRAL).
2) STRENGTH
Using two more moving averages, we detect the strength at that moment, that is, where the price is headed, regardless of its trend. The result will be (BULL, BEAR, NEUTRAL).
3) MOMENTUM
Using the intersection of two moving averages, we detect momentum, so that we know if the strength is still active in the same direction or is losing strength. The result will be (BULL, BEAR, NEUTRAL).
------------------------------------------
CONTROL TABLE
The main advantage of the indicator is that it calculates the three variables (trend, strength, momentum) in the main timeframes and displays them in a control table so we can see the current price status at a glance.
It will also display a message for each timeframe as the sum of the three variables, so we know what's happening at any given moment without having to analyze anything.
Three types of messages for each timeframe (e.g., Weekly):
1) Weekly: BULLISH (losing strength) --> It's bullish, but it's losing strength because the momentum is bearish.
2) Weekly: BULLISH --> It's bullish.
3) Weekly: BULLISH (retracement) --> It's bullish in a retracement phase because its strength is bearish.
------------------------------------------
GRAPH DISPLAY
1) The control table: (This is optional to display).
2) The 4 Moving Averages: (This is optional to display and the colors can be changed).
3) Bull or Bear signals based on strength: Bull or Bear messages will appear on the chart each time the strength changes value. (This is also optional to display and the colors can be changed).
4) Triangles at the bottom of the chart indicating price momentum: (This is also optional to display).
This is what the indicator provides to improve our daily trading.
For more information, please contact us in the following ways:
My TradingView profile: jmesado
Email: jmesado@gmail.com
Website: forexfibonacci.es
Thank you very much, and we will continue to update the indicator with improvements we already have in mind.
Greetings, TradingView community.
Fair Value Trend Model [SiDec]ABSTRACT
This pine script introduces the Fair Value Trend Model, an on-chart indicator for TradingView that constructs a continuously updating "fair-value" estimate of an asset's price via a logarithmic regression on historical data. Specifically, this model has been applied to Bitcoin (BTC) to fully grasp its fair value in the cryptocurrency market. Symmetric channel bands, defined by fixed percentage offsets around this central fair-value curve, provide a visual band within which normal price fluctuations may occur. Additionally, a short-term projection extends both the fair-value trend and its channel bands forward by a user-specified number of bars.
INTRODUCTION
Technical analysts frequently seek to identify an underlying equilibrium or "fair value" about which prices oscillate. Traditional approaches-moving averages, linear regressions in price-time space, or midlines-capture linear trends but often misrepresent the exponential or power-law growth patterns observable in many financial markets. The Fair Value Trend Model addresses this by performing an ordinary least squares (OLS) regression in log-space, fitting ln(Price) against ln(Days since inception). In practice, the primary application has been to Bitcoin, aiming to fully capture Bitcoin's underlying value dynamics.
The result is a curved trend line in regular (price-time) coordinates, reflecting Bitcoin's long-term compounding characteristics. Surrounding this fair-value curve, symmetric bands at user-specified percentage deviations serve as dynamic support and resistance levels. A simple linear projection extends both the central fair-value and its bands into the immediate future, providing traders with a heuristic for short-term trend continuation.
This exposition details:
Data transformation: converting bar timestamps into days since first bar, then applying natural logarithms to both time and price.
Regression mechanics: incremental (or rolling-window) accumulation of sums to compute the log-space fit parameters.
Fair-value reconstruction: exponentiation of the regression output to yield a price-space estimate.
Channel-band definition: establishing ±X% offsets around the fair-value curve and rendering them visually.
Forecasting methodology: projecting both the fair-value trend and channel bands by extrapolating the most recent incremental change in price-space.
Interpretation: how traders can leverage this model for trend identification, mean-reversion setups, and breakout analysis, particularly in Bitcoin trading.
Analysing the macro cycle on Bitcoin's monthly timeframe illustrates how the fair-value curve aligns with multi-year structural turning points.
DATA TRANSFORMATION AND NOTATION
1. Timestamp Baseline (t0)
Let t0 = timestamp of the very first bar on the chart (in milliseconds). Each subsequent bar has a timestamp ti, where ti ≥ t0.
2. Days Since Inception (d(t))
Define the “days since first bar” as
d(t) = max(1, (t − t0) / 86400000.0)
Here, 86400000.0 represents the number of milliseconds in one day (1,000 ms × 60 seconds × 60 minutes × 24 hours). The lower bound of 1 ensures that we never compute ln(0).
3. Logarithmic Coordinates:
Given the bar’s closing price P(t), define:
xi = ln( d(ti) )
yi = ln( P(ti) )
Thus, each data point is transformed to (xi, yi) in log‐space.
REGRESSION FORMULATION
We assume a log‐linear relationship:
yi = a + b·xi + εi
where εi is the residual error at bar i. Ordinary least squares (OLS) fitting minimizes the sum of squared residuals over N data points. Define the following accumulated sums:
Sx = Σ for i = 1 to N
Sy = Σ for i = 1 to N
Sxy = Σ for i = 1 to N
Sx2 = Σ for i = 1 to N
N = number of data points
The OLS estimates for b (slope) and a (intercept) are:
b = ( N·Sxy − Sx·Sy ) / ( N·Sx2 − (Sx)^2 )
a = ( Sy − b·Sx ) / N
All‐Time Versus Rolling‐Window Mode:
All-Time Mode:
Each new bar increments N by 1.
Update Sx ← Sx + xN, Sy ← Sy + yN, Sxy ← Sxy + xN·yN, Sx2 ← Sx2 + xN^2.
Recompute a and b using the formulas above on the entire dataset.
Rolling-Window Mode:
Fix a window length W. Maintain two arrays holding the most recent W values of {xi} and {yi}.
On each new bar N:
Append (xN, yN) to the arrays; add xN, yN, xN·yN, xN^2 to the sums Sx, Sy, Sxy, Sx2.
If the arrays’ length exceeds W, remove the oldest point (xN−W, yN−W) and subtract its contributions from the sums.
Update N_roll = min(N, W).
Compute b and a using N_roll, Sx, Sy, Sxy, Sx2 as above.
This incremental approach requires only O(1) operations per bar instead of recomputing sums from scratch, making it computationally efficient for long time series.
FAIR‐VALUE RECONSTRUCTION
Once coefficients (a, b) are obtained, the regressed log‐price at time t is:
ŷ(t) = a + b·ln( d(t) )
Mapping back to price space yields the “fair‐value”:
F(t) = exp( ŷ(t) )
= exp( a + b·ln( d(t) ) )
= exp(a) · ^b
In other words, F(t) is a power‐law function of “days since inception,” with exponent b and scale factor C = exp(a). Special cases:
If b = 1, F(t) = C · d(t), which is an exponential function in original time.
If b > 1, the fair‐value grows super‐linearly (accelerating compounding).
If 0 < b < 1, it grows sub‐linearly.
If b < 0, the fair‐value declines over time.
CHANNEL‐BAND DEFINITION
To visualise a “normal” range around the fair‐value curve F(t), we define two channel bands at fixed percentage offsets:
1. Upper Channel Band
U(t) = F(t) · (1 + α_upper)
where α_upper = (Channel Band Upper %) / 100.
2. Lower Channel Band
L(t) = F(t) · (1 − α_lower)
where α_lower = (Channel Band Lower %) / 100.
For example, default values of 50% imply α_upper = α_lower = 0.50, so:
U(t) = 1.50 · F(t)
L(t) = 0.50 · F(t)
When “Show FV Channel Bands” is enabled, both U(t) and L(t) are plotted in a neutral grey, and a semi‐transparent fill is drawn between them to emphasise the channel region.
SHORT‐TERM FORECAST PROJECTION
To extend both the fair‐value and its channel bands M bars into the future, the model uses a simple constant‐increment extrapolation in price space. The procedure is:
1. Compute Recent Increments
Let
F_prev = F( t_{N−1} )
F_curr = F( t_N )
Then define the per‐bar change in fair‐value:
ΔF = F_curr − F_prev
Similarly, for channel bands:
U_prev = U( t_{N−1} ), U_curr = U( t_N ), ΔU = U_curr − U_prev
L_prev = L( t_{N−1} ), L_curr = L( t_N ), ΔL = L_curr − L_prev
2. Forecasted Values After M Bars
Assuming the same per‐bar increments continue:
F_future = F_curr + M · ΔF
U_future = U_curr + M · ΔU
L_future = L_curr + M · ΔL
These forecasted values produce dashed lines on the chart:
A dashed segment from (bar_N, F_curr) to (bar_{N+M}, F_future).
Dashed segments from (bar_N, U_curr) to (bar_{N+M}, U_future), and from (bar_N, L_curr) to (bar_{N+M}, L_future).
Forecasted channel bands are rendered in a subdued grey to distinguish them from the current solid bands. Because this method does not re‐estimate regression coefficients for future t > t_N, it serves as a quick visual heuristic of trend continuation rather than a precise statistical forecast.
MATHEMATICAL SUMMARY
Summarising all key formulas:
1. Days Since Inception
d(t_i) = max( 1, ( t_i − t0 ) / 86400000.0 )
x_i = ln( d(t_i) )
y_i = ln( P(t_i) )
2. Regression Summations (for i = 1..N)
Sx = Σ
Sy = Σ
Sxy = Σ
Sx2 = Σ
N = number of data points (or N_roll if using rolling‐window)
3. OLS Estimator
b = ( N · Sxy − Sx · Sy ) / ( N · Sx2 − (Sx)^2 )
a = ( Sy − b · Sx ) / N
4. Fair‐Value Computation
ŷ(t) = a + b · ln( d(t) )
F(t) = exp( ŷ(t) ) = exp(a) · ^b
5. Channel Bands
U(t) = F(t) · (1 + α_upper)
L(t) = F(t) · (1 − α_lower)
with α_upper = (Channel Band Upper %) / 100, α_lower = (Channel Band Lower %) / 100.
6. Forecast Projection
ΔF = F_curr − F_prev
F_future = F_curr + M · ΔF
ΔU = U_curr − U_prev
U_future = U_curr + M · ΔU
ΔL = L_curr − L_prev
L_future = L_curr + M · ΔL
IMPLEMENTATION CONSIDERATIONS
1. Time Precision
Timestamps are recorded in milliseconds. Dividing by 86400000.0 yields days with fractional precision.
For the very first bar, d(t) = 1 ensures x = ln(1) = 0, avoiding an undefined logarithm.
2. Incremental Versus Sliding Summation
All‐Time Mode: Uses persistent scalar variables (Sx, Sy, Sxy, Sx2, N). On each new bar, add the latest x and y contributions to the sums.
Rolling‐Window Mode: Employs fixed‐length arrays for {x_i} and {y_i}. On each bar, append (x_N, y_N) and update sums; if array length exceeds W, remove the oldest element and subtract its contribution from the sums. This maintains exact sums over the most recent W data points without recomputing from scratch.
3. Numerical Robustness
If the denominator N·Sx2 − (Sx)^2 equals zero (e.g., all x_i identical, as when only one day has passed), then set b = 0 and a = Sy / N. This produces a constant fair‐value F(t) = exp(a).
Enforcing d(t) ≥ 1 avoids attempts to compute ln(0).
4. Plotting Strategy
The fair‐value line F(t) is plotted on each new bar. Its color depends on whether the current price P(t) is above or below F(t): a “bullish” color (e.g., green) when P(t) ≥ F(t), and a “bearish” color (e.g., red) when P(t) < F(t).
The channel bands U(t) and L(t) are plotted in a neutral grey when enabled; otherwise they are set to “not available” (no plot).
A semi‐transparent fill is drawn between U(t) and L(t). Because the fill function is executed at global scope, it is automatically suppressed if either U(t) or L(t) is not plotted (na).
5. Forecast Line Management
Each projection line (for F, U, and L) is created via a persistent line object. On successive bars, the code updates the endpoints of the same line rather than creating a new one each time, preserving chart clarity.
If forecasting is disabled, any existing projection lines are deleted to avoid cluttering the chart.
INTERPRETATION AND APPLICATIONS
1. Trend Identification
The fair‐value curve F(t) represents the best‐fit long‐term trend under the assumption that ln(Price) scales linearly with ln(Days since inception). By capturing power‐law or exponential patterns, it can more accurately reflect underlying compounding behavior than simple linear regressions.
When actual price P(t) lies above U(t), it may be considered “overextended” relative to its long‐term trend; when price falls below L(t), it may be deemed “oversold.” These conditions can signal potential mean‐reversion or breakout opportunities.
2. Mean‐Reversion and Breakout Signals
If price re‐enters the channel after touching or slightly breaching L(t), some traders interpret this as a mean‐reversion bounce and consider initiating a long position.
Conversely, a sustained move above U(t) can indicate strong upward momentum and a possible bullish breakout. Traders often seek confirmation (e.g., price remaining above U(t) for multiple bars, rising volume, or corroborating momentum indicators) before acting.
3. Rolling Versus All‐Time Usage
All‐Time Mode: Captures the entire dataset since inception, focusing on structural, long‐term trends. It is less sensitive to short‐term noise or volatility spikes.
Rolling‐Window Mode: Restricts the regression to the most recent W bars, making the fair‐value curve more responsive to changing market regimes, sudden volatility expansions, or fundamental shifts. Traders who wish to align the model with local behaviour often choose W so that it approximates a market cycle length (e.g., 100–200 bars on a daily chart).
4. Channel Percentage Selection
A wider band (e.g., ±50 %) accommodates larger price swings, reducing the frequency of breaches but potentially delaying actionable signals.
A narrower band (e.g., ±10 %) yields more frequent “overbought/oversold” alerts but may produce more false signals during normal volatility. It is advisable to calibrate the channel width to the asset’s historical volatility regime.
5. Forecast Cautions
The short‐term projection assumes that the last single‐bar increment ΔF remains constant for M bars. In reality, trend acceleration or deceleration can occur, rendering the linear forecast inaccurate.
As such, the forecast serves as a visual guide rather than a statistically rigorous prediction. It is best used in conjunction with other momentum, volume, or volatility indicators to confirm trend continuation or reversal.
LIMITATIONS AND CONSIDERATIONS
1. Power‐Law Assumption
By fitting ln(P) against ln(d), the model posits that P(t) ≈ C · ^b. Real markets may deviate from a pure power‐law, especially around significant news events or structural regime changes. Temporary misalignment can occur.
2. Fixed Channel Width
Markets exhibit heteroskedasticity: volatility can expand or contract unpredictably. A static ±X % band does not adapt to changing volatility. During high‐volatility periods, a fixed ±50 % may prove too narrow and be breached frequently; in unusually calm periods, it may be excessively broad, masking meaningful variations.
3. Endpoint Sensitivity
Regression‐based indicators often display greater curvature near the most recent data, especially under rolling‐window mode. This can create sudden “jumps” in F(t) when new bars arrive, potentially confusing users who expect smoother behaviour.
4. Forecast Simplification
The projection does not re‐estimate regression slope b for future times. It only extends the most recent single‐bar change. Consequently, it should be regarded as an indicative extension rather than a precise forecast.
PRACTICAL IMPLEMENTATION ON TRADINGVIEW
1 Adding the Indicator
In TradingView’s “Indicators” dialog, search for Fair Value Trend Model or visit my profile, under "scripts" add it to your chart.
Add it to any chart (e.g., BTCUSD, AAPL, EURUSD) to see real‐time computation.
2. Configuring Inputs
Show Forecast Line: Toggle on or off the dashed projection of the fair‐value.
Forecast Bars: Choose M, the number of bars to extend into the future (default is often 30).
Forecast Line Colour: Select a high‐contrast colour (e.g., yellow).
Bullish FV Colour / Bearish FV Colour: Define the colour of the fair‐value line when price is above (e.g., green) or below it (e.g., red).
Show FV Channel Bands: Enable to display the grey channel bands around the fair‐value.
Channel Band Upper % / Channel Band Lower %: Set α_upper and α_lower as desired (defaults of 50 % create a ±50 % envelope).
Use Rolling Window?: Choose whether to restrict the regression to recent data.
Window Bars: If rolling mode is enabled, designate W, the number of bars to include.
3. Visual Output
The central curve F(t) appears on the price chart, coloured green when P(t) ≥ F(t) and red when P(t) < F(t).
If channel bands are enabled, the chart shows two grey lines U(t) and L(t) and a subtle shading between them.
If forecasting is active, dashed extensions of F(t), U(t), and L(t) appear, projecting forward by M bars in neutral hues.
CONCLUSION
The Fair Value Trend Model furnishes traders with a mathematically principled estimate of an asset’s equilibrium price curve by fitting a log‐linear regression to historical data. Its channel bands delineate a normal corridor of fluctuation based on fixed percentage offsets, while an optional short‐term projection offers a visual approximation of trend continuation.
By operating in log‐space, the model effectively captures exponential or power‐law growth patterns that linear methods overlook. Rolling‐window capability enables responsiveness to regime shifts, whereas all‐time mode highlights broader structural trends. Nonetheless, users should remain mindful of the model’s assumptions—particularly the power‐law form and fixed band percentages—and employ the forecast projection as a supplemental guide rather than a standalone predictor.
When combined with complementary indicators (e.g., volatility measures, momentum oscillators, volume analysis) and robust risk management, the Fair Value Trend Model can enhance market timing, mean‐reversion identification, and breakout detection across diverse trading environments.
REFERENCES
Draper, N. R., & Smith, H. (1998). Applied Regression Analysis (3rd ed.). Wiley.
Tsay, R. S. (2014). Introductory Time Series with R (2nd ed.). Springer.
Hull, J. C. (2017). Options, Futures, and Other Derivatives (10th ed.). Pearson.
These references provide background on regression, time-series analysis, and financial modeling.
Curved Trend Channels (Zeiierman)█ Overview
Curved Trend Channels (Zeiierman) is a next-generation trend visualization tool engineered to adapt dynamically to both linear and non-linear market behavior. It introduces a novel curvature-based channeling system that grows over time during trending conditions, mirroring the natural acceleration of price trends, while simultaneously leveraging adaptive range filtering and dual-layer candle trend logic.
This tool is ideal for traders seeking smooth yet reactive dynamic channels that evolve with market structure. Whether used in curved mode or traditional slope mode, it provides exceptional clarity on trend transitions, volatility compression, and breakout development.
█ How It Works
⚪ Adaptive Range Filter Foundation
The core of the system is a volatility-based range filter that determines the underlying structure of the bands:
Pre-Smoothing of High/Low Data – Highs and lows are smoothed using a selectable moving average (SMA, EMA, HMA, KAMA, etc.) before calculating the volatility range.
Volatility Envelope – The range is scaled using a fixed factor (2.618) and further adjusted by a Band Multiplier to form the primary envelope around price.
Smoothed Volatility Curve – Final bands are stabilized using a long lookback, ensuring clean visual structure and trend clarity.
⚪ Curved Channel Logic
In Curved Mode, the trend channel grows over time when the trend direction remains unchanged:
Base Step Size (× ATR) – Sets the minimum unit of slope change.
Growth per Bar (× ATR) – Defines the acceleration rate of the channel slope with time.
Trend Persistence Recognition – The longer a trend persists, the more pronounced the slope becomes, mimicking real market accelerations.
This dynamic, time-dependent logic enables the channel to "curve" upward or downward, tracking long-standing trends with increasing confidence.
⚪ Trend Slope
As an alternative to curved logic, traders can activate a regular Trend slope using:
Slope Length – Determines how quickly the trend line adapts to price shifts.
Multiplicative Factor – Amplifies the sensitivity of the slope, useful in fast-moving markets or lower timeframes.
⚪ Candle Trend Confirmation
A robust second-layer trend detection method, the Candle Trend System evaluates directional pressure by analyzing smoothed price action:
Multi-tier Smoothing – Trend lines are derived from short-, medium-, and long-term candle movement.
█ How to Use
⚪ Trend Identification
When the Trend Line direction and Candle Colors are in agreement, this indicates strong, persistent directional conviction. Use these moments to enter with trend confirmation and manage risk more confidently.
⚪ Retest
During ongoing trends, the price will often pull back into the dynamic channel. Look for:
Support/resistance interactions at the upper or lower bands.
█ Settings
Scaled Volatility Length – Controls the historical depth used to stabilize the volatility bands.
Smoothing Type – Choose from HMA, KAMA, VIDYA, FRAMA, Super Smoother, etc. to match your asset and trading style.
Volatility MA Length – Smoothing length for the calculated range; shorter = more reactive.
High/Low Smoother Length – Additional smoothing to reduce noise from spikes or false pivots.
Band Multiplier – Widens or tightens the band range based on personal preference.
Enable Curved Channel – Toggle between curved or regular trend slope behavior.
Base Step (× ATR) – The starting point for curved slope progression.
Growth per Bar (× ATR) – How much the slope accelerates per bar during a sustained trend.
Slope – Reactivity of the standard trend line to price movements.
Multiplicative Factor – Sensitivity adjustment for HyperTrend slope.
Candle Trend Length – Lookback period for trend determination from candle structure.
-----------------
Disclaimer
The content provided in my scripts, indicators, ideas, algorithms, and systems is for educational and informational purposes only. It does not constitute financial advice, investment recommendations, or a solicitation to buy or sell any financial instruments. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.
All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, backtest, or individual's trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.
Regression Channel (Interactive)Weighted Interactive Regression Channel (WIRC)
Overview
The Weighted Interactive Regression Channel improves on traditional regression channels by emphasizing key price points through intelligent weighting. Instead of treating all candles equally, WIRC adapts to market dynamics for better trend detection and channel accuracy.
Key Differences from Standard Channels
Weighted vs. Equal: Prioritizes significant events over uniform weighting
Dynamic vs. Static: Adapts in real time to market changes
Accurate vs. Basic: Reduces noise, enhances signal clarity
Customizable vs. Fixed: Full control over weights and visuals
Weighting Methods
Direction Change – Highlights reversal points via local peaks/troughs
Volume-Based – Emphasizes high-volume candles, ideal for breakouts
Price Range – Weights wide-range candles to capture volatility
Time Decay – Prioritizes recent data for current market relevance
Interactive Features
Data Range: Set channel start/end over 1–500 bars
Visuals: Line styles, color coding, fill options, reference lines
Stats: Slope, R², standard deviation, point count, weight method
Technical Implementation
Weighted Regression Formula: Uses weights for slope, intercept, and deviation
Channel Lines: Center = weighted regression; bounds = ± deviation × multiplier
Usage Scenarios
Trend Analysis: Use Direction Change + longer range
Breakouts: Use Volume weighting + fill + boundary watching
Volatility: Apply Price Range weighting + monitor standard deviation
Current Market: Use Time Decay + shorter ranges + stat display
Parameter Tips
Channel Width:
Narrow (1.0–1.5): Responsive
Standard (1.5–2.0): Balanced
Wide (2.0–3.0+): Conservative
Weighting Intensity:
Conservative (1.5–2.0)
Moderate (2.0–3.0)
Aggressive (3.0+)
Advanced Use
Multi-Timeframe: Use different weightings per timeframe
Market Structure: Detect swings, institutional zones
Risk Management: Dynamic S/R levels, volatility-driven sizing
Best Practices
Start with Direction Change
Test different ranges
Monitor stats
Combine with other indicators
Adjust to market context
Recalibrate regularly
Conclusion
WIRC delivers a smarter, more adaptive view of price action than standard regression tools. With real-time customization and multiple weighting options, it’s ideal for traders seeking precision across strategies—trend tracking, breakout confirmation, or volatility insight.
WLSMA: fast approximation🙏🏻 Sup TV & @alexgrover
O(N) algocomplexity, just one loop inside. No, you can't do O(1) @ updates in moving window mode, only expanding window will allow that.
Now I have time series & stats models of my own creation, nowhere else available, just TV and my github for now, ain’t no legacy academic industry I always have fun about, but back in 2k20 when I consciously ain’t known much about quant, I remember seeing post by @alexgrover recreating Moving Regression Endpoint dropped on price chart (called LSMA here) as a linear filter combination of filters (yea yeah DSP terms) as 3WMA - 2SMA. Now it’s my time to do smth alike aye?
...
This script is remake of my 1st degree WLSMA via linear filter combo. It’s much faster, we aint calculate moving regression per se, we just match its freq response. You can see it on the screen (WLSMAfa) almost perfectly matching the original one (WLSMA).
...
While humans like to overfit, I fw generalizations. So your lovely WMA is actually just one case of a more general weight pattern: pow(len - i, e), where pow is the power function and e is the exponent itself. So:
- If e = 0, then we have SMA (every number in 0th power is one)
- If e = 1, we get WMA
- If e = 2, we get quadratic weights.
We can recreate WLSMA freq response then by combining 2 filters with e = 1 and e = 2.
This is still an approximation, even tho enormously precise for the tasks you’ve shared with me. Due to the non-linear nature of the thing it’s all we can do, and as window size grows, even this small discrepancy converges with true WLSMA value, so we’re all good. Pls don’t try to model this 0.00xxxx discrepancy, it’s not natural.
...
DSP approach is unnatural for prices, but you can put this thing on volume delta and be happy, or on other metrics of yours, if for some reason u dont wanna estimate thresholds by fitting a distro.
All good TV
∞
P.S.: strangely, the first script made & dropped in the location in Saint P where my actual quant way has started ~5 years ago xD, very thankful
Volume/Z-Score Filtered Triple RegressionsVolume/Z-Score Filtered Triple Regressions
This indicator blends three regression techniques—Linear Regression, Ridge Regression, and Lasso Regression—to deliver a robust, multi-dimensional view of market trends.
Key Features
Triple Regression Analysis:
Linear Regression: Uses TradingView’s built-in linear regression over a configurable lookback period.
Ridge Regression: Applies a penalty term with centering to stabilize slope estimates.
Lasso Regression: Incorporates soft-thresholding to refine the regression by reducing noise.
Voting Mechanism:
Each regression “votes” bullish or bearish by comparing its value to the current close. A majority vote (at least two out of three) determines the preliminary market bias.
Z-Score Filtering:
The indicator calculates the average of the three regression values and derives a residual Z-score (based on standard deviation). Only when the absolute Z-score exceeds a user-defined threshold does it permit a trend change, helping filter out minor price fluctuations.
Volume Confirmation:
A moving average of volume (with multiple MA options available) is compared against current volume using a multiplier. This ensures that trend changes are supported by sufficient market activity.
Enhanced Visuals:
Dynamic color schemes for regression lines, the average trend line, and even candle colors help visually distinguish bullish and bearish signals. A gradient background further reinforces the current trend, adapting its transparency based on the strength of the Z-score.
Disclaimer
Disclaimer: This indicator is provided for educational and informational purposes only and does not constitute investment advice. Trading involves risk and may result in financial loss. Always perform your own research and consult with a qualified financial advisor before making any trading decisions.
Market Extension QuantifierThis indicator can help you identify extended moves, so whenever the "EXT" turns on, pay attention because a mean reversion might be near.
Support and Resistance Logistic Regression | Flux Charts💎 GENERAL OVERVIEW
Introducing our new Logistic Regression Support / Resistance indicator! This tool leverages advanced statistical modeling "Logistic Regressions" to identify and project key price levels where the market is likely to find support or resistance. For more information about the process, please check the "HOW DOES IT WORK ?" section.
Logistic Regression Support / Resistance Features :
Intelligent S/R Identification : The indicator uses a logistic regression model to intelligently identify and plot significant support and resistance levels.
Predictive Probability : Each identified level comes with a calculated probability, indicating how likely it is to act as a true support or resistance based on historical data.
Retest & Break Labels : The indicator clearly marks on your chart when a detected support or resistance level is retested (price touches and respects the level) or broken (price decisively crosses through the level).
Alerts : Real-time alerts for support retests, resistance retests, support breaks, and resistance breaks.
Customizable : You can change support & resistance line style, width and colors.
🚩 UNIQUENESS
What makes this indicator truly unique is its application of logistic regression to the concept of support and resistance. Instead of merely identifying historical highs and lows, our indicator uses a statistical model to predict the future efficacy of these levels. It analyzes underlying market conditions (like RSI and body size at pivot formation) to assign a probability to each potential S/R zone. This predictive insight, combined with dynamic, real-time labeling of retests and breaks, provides a more robust and adaptive understanding of market structure than traditional, purely historical methods.
📌HOW DOES IT WORK ?
The Logistic Regression Support / Resistance indicator operates in several key steps:
First, it identifies significant pivot highs and lows on the chart based on a user-defined "Pivot Length." These pivots are potential areas of support or resistance.
For each detected pivot, the indicator extracts relevant market data at that specific point, including the RSI (Relative Strength Index) and the Body Size (the absolute difference between the open and close price of the candle). These serve as input features for the model.
The core of the indicator lies in its logistic regression model. This model is continuously trained on past pivot data and their subsequent behavior (i.e., whether they were "respected" as support/resistance multiple times). It learns the relationship between the extracted features (RSI, Body Size) and the likelihood of a pivot becoming a significant S/R level.
When a new pivot is identified, the model uses its learned insights to calculate a prediction value—a probability (from 0 to 1) that this specific pivot will act as a strong support or resistance.
If the calculated probability exceeds a user-defined "Probability Threshold," the pivot is designated a "Regression Pivot" and drawn on the chart as a support or resistance line. The indicator then actively tracks how price interacts with these levels, displaying "R" labels for retests when the price bounces off the level and "B" labels for breaks when the price closes beyond it.
⚙️ SETTINGS
1. General Configuration
Pivot Length: This setting defines the number of bars used to determine a significant high or low for pivot detection.
Target Respects: This input specifies how many times a level must be "respected" by price action for it to be considered a strong support or resistance level by the underlying model.
Probability Threshold: This is the minimum probability output from the logistic regression model for a detected pivot to be considered a valid support or resistance level and be plotted on the chart.
2. Style
Show Prediction Labels: Enable or disable labels that display the calculated probability of a newly identified regression S/R level.
Show Retests: Toggle the visibility of "R" labels on the chart, which mark instances where price has retested a support or resistance level.
Show Breaks: Toggle the visibility of "B" labels on the chart, which mark instances where price has broken through a support or resistance level.
TrueTrend MaxRThe TrueTrend MaxR indicator is designed to identify the most consistent exponential price trend over extended periods. It uses statistical analysis on log-transformed prices to find the trendline that best fits historical price action, and highlights the most frequently tested or traded level within that trend channel.
For optimal results, especially on high timeframes such as weekly or monthly, it is recommended to use this indicator on charts set to logarithmic scale. This ensures proper visual alignment with the exponential nature of long-term price movements.
How it works
The indicator tests 50 different lookback periods, ranging from 300 to 1280 bars. For each period, it:
- Applies a linear regression on the natural logarithm of the price
- Computes the slope and intercept of the trendline
- Calculates the unbiased standard deviation from the regression line
- Measures the correlation strength using Pearson's R coefficient
The period with the highest Pearson R value is selected, meaning the trendline drawn corresponds to the log-scale trend with the best statistical fit.
Trendline and deviation bands
Once the optimal period is identified, the indicator plots:
- A main log-scale trendline
- Upper and lower bands, based on a user-defined multiple of the standard deviation
These bands help visualize how far price deviates from its core trend, and define the range of typical fluctuations.
Point of Control (POC)
Inside the trend channel, the space between upper and lower bands is divided into 15 logarithmic levels. The script evaluates how often price has interacted with each level, using one of two selectable methods:
- Touches: Counts the number of candles crossing each level
- Volume: Weighs each touch by the traded volume at that candle
The level with the highest cumulative interaction is considered the dynamic Point of Control (POC), and is plotted as a line.
Annualized performance and confidence display
When used on daily or weekly timeframes, the script also calculates the annualized return (CAGR) based on the detected trend, and displays:
- A performance estimate in percentage terms
- A textual label describing the confidence level based on the Pearson R value
Why this indicator is useful
- Automatically detects the most statistically consistent exponential trendline
- Designed for log-scale analysis, suited to long-term investment charts
- Highlights key price levels frequently visited or traded within the trend
- Provides objective, data-based trend and volatility insights
- Displays annualized growth rate and correlation strength for quick evaluation
Notes
- All calculations are performed only on the last bar
- No future data is used, and the script does not repaint
- Works on any instrument or timeframe, with optimal use on higher timeframes and logarithmic scaling
Custom Paul MACD-likePaul MACD is an indicator created by David Paul. It is implemented to effectively represent trend periods and non-trend (sideways/consolidation) periods, and its calculation method is particularly designed to reduce whipsaw.
Unlike the existing MACD which uses the difference between short-term (12) and long-term (26) exponential moving averages (EMA), Paul MACD has a different calculation method. This indicator uses a "center value" or "intermediate value". Calculation occurs when this intermediate value is higher than the High value (specifically, the difference between the center and High is calculated) or lower than the Low value (specifically, the difference between the center and Low is calculated). Otherwise, the value becomes 0. Here, the High and Low values are intended to be smoothly reflected using Smoothed Moving Average (SMMA). The indicator's method itself (using SMMA and ZLMA) is aimed at diluting whipsaws.
Thanks to this calculation method, in sections where whipsaw occurs, meaning when the intermediate value is between High and Low, the indicator value is expressed as 0 and appears as a horizontal line (zero line). This serves to visually clearly show sideways/consolidation periods.
Linear Regression ForecastDescription:
This indicator computes a series of simple linear regressions anchored at the current bar, using look-back windows from 2 bars up to the user-defined maximum. Each regression line is projected forward by the same number of bars as its look-back, producing a family of forecast endpoints. These endpoints are then connected into a continuous polyline: ascending segments are drawn in green, and descending segments in red.
Inputs:
maxLength – Maximum number of bars to include in the longest regression (minimum 2)
priceSource – Price series used for regression (for example, close, open, high, low)
lineWidth – Width of each line segment
Calculation:
For each window size N (from 2 to maxLength):
• Compute least-squares slope and intercept over the N most recent bars (with bar 0 = current bar, bar 1 = one bar ago, etc.).
• Project the regression line to bar_index + N to obtain the forecast price.
Collected forecast points are sorted by projection horizon and then joined:
• First segment: current bar’s price → first forecast point
• Subsequent segments: each forecast point → next forecast point
Segment colors reflect slope direction: green for non-negative, red for negative.
Usage:
Apply this overlay to any price chart. Adjust maxLength to control the depth and reach of the forecast fan. Observe how shorter windows produce nearer-term, more reactive projections, while longer windows yield smoother, more conservative forecasts. Use the colored segments to gauge the overall bias of the fan at each step.
Limitations:
This tool is for informational and educational purposes only. It relies on linear regression assumptions and past price behavior; it does not guarantee future performance. Users should combine it with other technical or fundamental analyses and risk management practices.
[Stoxello] Linear Regression Chop Zone Indicator📊 Linear Regression Chop Zone Indicator – Description
The Stoxello Linear Regression Chop Zone Indicator is a custom-built, multi-functional visual tool for identifying market trend direction, strength, and potential entry/exit signals using a combination of linear regression, EMA slope angles, and volatility-adjusted smoothing.
🧠 Core Features:
🔶 1. Chop Zone Color Coding (Trend Strength via EMA Angle)
The script calculates the angle of a 34-period EMA, representing momentum and trend steepness.
This angle is then translated into color-coded bars on the chart to help traders visually identify chop zones and trend strength.
Turquoise / Dark Green / Pale Green = Increasing bullish trend.
Lime / Yellow = Neutral or low momentum (choppy zones).
Orange / Red / Dark Red = Increasing bearish trend.
🔶 2. Linear Regression Deviation Channels (Trend Path)
A custom linear regression line is drawn with +/- deviation bands above and below it.
These lines track the expected price path and visually define upper/lower zones, similar to regression channels.
The correlation (R) and determination (R²) values are displayed as labels on the chart, measuring the strength and reliability of the linear fit.
🔶 3. Linear Regression-Adjusted EMA (Smoothing with Volatility)
A novel volatility-adaptive EMA is computed by combining a traditional EMA with distance from a linear regression line.
The result is a dynamic EMA that becomes more reactive in volatile conditions and smoother in stable ones.
Two lines are plotted:
Primary EMA (Yellow)
Trigger Line (Lagged by 2 bars, Fuchsia)
The fill color between these two helps visualize short-term bullish or bearish pressure.
🔶 4. Buy/Sell Signal Logic with De-Duplication
Buy signals are triggered when:
The adjusted EMA crosses above its previous value (bullish inflection).
Or when the EMA angle exceeds +5° (strong trend detected).
Sell signals occur when:
The adjusted EMA crosses below its previous value.
Each signal is deduplicated by tracking the last signal using var string lastSignal:
No repeat buys after a buy, or sells after a sell.
Signals are marked on the chart using clean text labels:
Buy: "•Entry• = Price"
Sell: "•Exit• = Price"
🔶 5. Alerts
Two alertconditions are included for:
BUY signals (long_signal)
SELL signals (short_signal)
Can be used with webhooks, email, or app notifications to automate or monitor trades.
🔍 Ideal Use Cases:
Traders who want a clear visual aid for market chop vs. trend.
Swing or intraday traders looking for adaptive entry/exit points.
Anyone combining regression analysis and momentum tracking into one indicator.
LANZ Strategy 3.0 [Backtest]🔷 LANZ Strategy 3.0 — Asian Range Fibonacci Scalping Strategy
LANZ Strategy 3.0 is a precision-engineered backtesting tool tailored for intraday traders who rely on the Asian session range to determine directional bias. This strategy implements dynamic Fibonacci projections and strict time-window validation to simulate a clean and disciplined trading environment.
🧠 Core Components:
Asian Range Bias Definition: Direction is established between 01:15–02:15 a.m. NY time based on the candle’s close in relation to the midpoint of the Asian session range (18:00–01:15 NY).
Limit Order Execution: Only one trade is placed daily, using a limit order at the Asian range high (for sells) or low (for buys), between 01:15–08:00 a.m. NY.
Fibonacci-Based TP/SL:
Original Mode: TP = 2.25x range, SL = 0.75x range.
Optimized Mode: TP = 1.95x range, SL = 0.65x range.
No Trade After 08:00 NY: If the limit order is not executed before 08:00 a.m. NY, it is canceled.
Fallback Logic at 02:15 NY: If the market direction misaligns with the setup at 02:15 a.m., the system re-evaluates and can re-issue the order.
End-of-Day Closure: All positions are closed at 15:45 NY if still open.
📊 Backtest-Ready Design:
Entries and exits are executed using strategy.entry() and strategy.exit() functions.
Position size is fixed via capital risk allocation ($100 per trade by default).
Only one position can be active at a time, ensuring controlled risk.
📝 Notes:
This strategy is ideal for assets sensitive to the Asian/London session overlap, such as Forex pairs and indices.
Easily switch between Fibonacci versions using a single dropdown input.
Fully deterministic: all entries are based on pre-defined conditions and time constraints.
👤 Credits:
Strategy developed by rau_u_lanz using Pine Script v6. Built for traders who favor clean sessions, directional clarity, and consistent execution using time-based logic and Fibonacci projections.
Tangent Extrapolation ForecastTangent Extrapolation Forecast
This indicator visually projects price direction by drawing a smoothed sequence of tangent lines based on recent price movements. For each bar in a user-defined lookback window, it calculates the slope over a smoothing period and extends the projected price forward. The resulting polyline forecast connect the endpoints of the extrapolations, and is color-coded to reflect directional changes: green for upward moves, red for downward, and gray for flat segments. This tool can assist traders in visualizing short-term momentum and potential trend continuity without introducing artificial future gaps.
Inputs:
Bars to Use: Number of historical bars used in the forecast.
Slope Smoothing Window: The number of bars used to calculate slope for projection.
Source: Price input for calculations (default is close).
This indicator does not generate buy/sell signals. It is intended as a visual aid to support discretionary analysis.
Linear Volume MACD | Lyro RS📊 Linear Volume MACD | Lyro RS is an advanced momentum and trend detection tool that fuses price action with volume-weighted MACD logic and linear regression analysis . Designed for traders seeking deeper insights into market strength and directional conviction, this indicator highlights trend shifts, volume anomalies, and potential reversal zones with precision.
✨ Key Features :
🔁 Multi-Mode Analysis: Switch between Linear Regression , Strong/Weak Trend , or Volume MACD logic.
📐 Volume-Adjusted MACD: Incorporates volume for a more realistic momentum view.
📊 Linear Regression Signal: Smoother and more reactive trend analysis.
🎯 Dynamic Stdev Bands: Visualize ±1 and ±2 standard deviation thresholds for anomaly detection.
🌈 Custom Color Themes: Choose from built-in palettes or define your own bullish/bearish signal colors.
⚠️ Alert Conditions: Built-in alerts notify you of potential trend shifts across all signal modes.
📈 How It Works :
🧮 MACD Core: Uses volume-weighted price to generate fast and slow EMAs, forming the MACD and signal lines.
📉 Histogram Logic: Histogram is either the traditional MACD histogram or its linear regression version.
📊 Signal Modes:
• Linear Regression: Detect trend based on smoothed MACD behavior.
• Strong/Weak Trend: Identifies accelerating/decelerating trend strength.
• Volume MACD: Classic volume MACD behavior for divergence spotting.
📏 Stdev Bands: Calculated over a long period (default 200) to highlight statistically significant moves.
🎨 Color-coded Feedback: Bar and background colors adjust dynamically with market condition.
⚙️ Customization Options :
🔄 Choose your Signal Type from three unique analysis modes.
📏 Modify Fast/Slow/Signal lengths and Regression parameters to suit your strategy.
📈 Enable or disable Stdev Bands and adjust multiplier.
🎨 Select from Classic, Mystic, Accented, or Royal color palettes — or create your own.
📌 Use Cases :
🟢 Identify trend continuation or reversal zones with volume-adjusted signals.
🔴 Detect volatility breakouts using standard deviation bands.
🧭 Use in confluence with price structure, RSI, or market sentiment.
⚠️ Disclaimer :
This indicator is for educational purposes only. It is not financial advice. Always use in conjunction with your own research and risk management strategy.
Weighted Regression Bands (Zeiierman)█ Overview
Weighted Regression Bands is a precision-engineered trend and volatility tool designed to adapt to the real market structure instead of reacting to price noise.
This indicator analyzes Weighted High/Low medians and applies user-selectable smoothing methods — including Kalman Filtering, ALMA, and custom Linear Regression — to generate a Fair Value line. Around this, it constructs dynamic standard deviation bands that adapt in real-time to market volatility.
The result is a visually clean and structurally intelligent trend framework suitable for breakout traders, mean reversion strategies, and trend-driven analysis.
█ How It Works
⚪ Structural High/Low Analysis
At the heart of this indicator is a custom high/low weighting system. Instead of using just the raw high or low values, it calculates a midline = (high + low) / 2, then applies one of three weighting methods to determine which price zones matter most.
Users can select the method using the “Weighted HL Method” setting:
Simple
Selects the single most dominant median (highest or lowest) in the lookback window. Ideal for fast, reactive signals.
Advanced
Ranks each bar based on a composite score: median × range × recency. This method highlights structurally meaningful bars that had both volatility and recency. A built-in Kalman filter is applied for extra stability.
Smooth
Blends multiple bars into a single weighted average using smoothed decay and range. This provides the softest and most stable structural response.
⚪ Smoothing Methods (ALMA / Linear Regression)
ALMA provides responsive, low-lag smoothing for fast trend reading.
Linear Regression projects the Fair Value forward, ideal for trend modeling.
⚪ Kalman Smoothing Filter
Before trend calculations, the indicator applies an optional Kalman-style smoothing filter. This helps:
Reduce choppy false shifts in trend,
Retain signal clarity during volatile periods,
Provide stability for long-term setups.
⚪ Deviation Bands (Dynamic Volatility Envelopes)
The indicator builds ±1, ±2, and ±3 standard deviation bands around the fair value line:
Calculated from the standard deviation of price,
Bands expand and contract based on recent volatility,
Visualizes potential overbought/oversold or trending conditions.
█ How to Use
⚪ Trend Trading & Filtering
Use the Fair Value line to identify the dominant direction.
Only trade in the direction of the slope for higher probability setups.
⚪ Volatility-Based Entries
Watch for price reaching outer bands (+2σ, +3σ) for possible exhaustion.
Mean reversion entries become higher quality when far from Fair Value.
█ Settings
Length – Lookback for Weighted HL and trend smoothing
Deviation Multiplier – Controls how wide the bands are from the fair value line
Method – Choose between ALMA or Linear Regression smoothing
Smoothing – Strength of Kalman Filter (1 = none, <1 = stronger smoothing)
-----------------
Disclaimer
The content provided in my scripts, indicators, ideas, algorithms, and systems is for educational and informational purposes only. It does not constitute financial advice, investment recommendations, or a solicitation to buy or sell any financial instruments. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.
All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, backtest, or individual's trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.
Grid Trade Helper📌 Grid Trade Helper – Range-Based Grid Planning Tool
This tool is designed for range-based traders and manual grid strategy operators, providing a framework to balance execution efficiency and risk exposure.
By referencing historical weekly volatility, it helps estimate a reasonable grid width, visualizes key levels, and supports position management with quantitative guidance.
🧭 Design Philosophy:
In multi-entry systems like grid trading, there's always a tradeoff:
"Tighter grids improve opportunity density but increase risk; wider grids reduce risk but lower efficiency."
This tool seeks to provide a dynamic equilibrium between the two, using past volatility to determine practical grid intervals and suggest safe leverage thresholds.
✨ Core Features:
Weekly open level tracking (custom time + time zone support)
Volatility-based suggestions for grid width and safe grid count
Visual range plotting with optional stop-line overlay
Compact live table showing key metrics: average range, grid width, grid count, leverage cap
🔧 Customizable Parameters:
Time zone and custom weekly open hour
Max number of visual elements (lines, boxes)
Color and line style options
📈 Suggested Use Cases:
Planning manual grid structures with volatility-adjusted intervals
Visual support for range-bound or sideways market strategies
Estimating leverage exposure and grid density for better position control
⚠️ This indicator is intended as a strategic support tool and does not constitute financial advice. Use according to your own risk framework and market understanding.
Regression Slope ShiftNormalized Regression Slope Shift + Dynamic Histogram
This indicator detects subtle shifts in price momentum using a rolling linear regression approach. It calculates the slope of a linear regression line for each bar over a specified lookback period, then measures how that slope changes from bar to bar.
Both the slope and its change (delta) are normalized to a -1 to 1 scale for consistent visual interpretation across assets and timeframes. A signal line (EMA) is applied to the slope delta to help identify turning points and crossovers.
Key features:
- Normalized slope and slope change lines
- Dynamic histogram of slope delta with transparency based on magnitude
- Customizable colors for all visual elements
- Signal line for crossover-based momentum shifts
This tool helps traders anticipate trend acceleration or weakening before traditional momentum indicators react, making it useful for early trend detection, divergence spotting, and confirmation signals.
Cointegration Heatmap & Spread Table [EdgeTerminal]The Cointegration Heatmap is a powerful visual and quantitative tool designed to uncover deep, statistically meaningful relationships between assets.
Unlike traditional indicators that react to price movement, this tool analyzes the underlying statistical relationship between two time series and tracks when they diverge from their long-term equilibrium — offering actionable signals for mean-reversion trades .
What Is Cointegration?
Most traders are familiar with correlation, which measures how two assets move together in the short term. But correlation is shallow — it doesn’t imply a stable or predictable relationship over time.
Cointegration, however, is a deeper statistical concept: Two assets are cointegrated if a linear combination of their prices or returns is stationary , even if the individual series themselves are non-stationary.
Cointegration is a foundational concept in time series analysis, widely used by hedge funds, proprietary trading firms, and quantitative researchers. This indicator brings that institutional-grade concept into an easy-to-use and fully visual TradingView indicator.
This tool helps answer key questions like:
“Which stocks tend to move in sync over the long term?”
“When are two assets diverging beyond statistical norms?”
“Is now the right time to short one and long the other?”
Using a combination of regression analysis, residual modeling, and Z-score evaluation, this indicator surfaces opportunities where price relationships are stretched and likely to snap back — making it ideal for building low-risk, high-probability trade setups.
In simple terms:
Cointegrated assets drift apart temporarily, but always come back together over time. This behavior is the foundation of successful pairs trading.
How the Indicator Works
Cointegration Heatmap indicator works across any market supported on TradingView — from stocks and ETFs to cryptocurrencies and forex pairs.
You enter your list of symbols, choose a timeframe, and the indicator updates every bar with live cointegration scores, spread signals, and trade-ready insights.
Indicator Settings:
Symbol list: a customizable list of symbols separated by commas
Returns timeframe: time frame selection for return sampling (Weekly or Monthly)
Max periods: max periods to limit the data to a certain time and to control indicator performance
This indicator accomplishes three major goals in one streamlined package:
Identifies stable long-term relationships (cointegration) between assets, using a heatmap visualization.
Tracks the spread — the difference between actual prices and the predicted linear relationship — between each pair.
Generates trade signals based on Z-score deviations from the mean spread, helping traders know when a pair is statistically overextended and likely to mean revert.
The math:
Returns are calculated using spread tickers to ensure alignment in time and adjust for dividends, splits, and other inconsistencies.
For each unique pair of symbols, we perform a linear regression
Yt=α+βXt+ε
Then we compute the residuals (errors from the regression):
Spreadt=Yt−(α+βXt)
Calculate the standard deviation of the spread over a moving window (default: 100 samples) and finally, define the Cointegration Score:
S=1/Standard Deviation of Residuals
This means, the lower the deviation, the tighter the relationship, so higher scores indicate stronger cointegration.
Always remember that cointegration can break down so monitor the asset over time and over multiple different timeframes before making a decision.
How to use the indicator
The heatmap table:
The indicator displays 2 very important tables, one in the middle and one on the right side. After entering your symbols, the first table to pay attention to is the middle heatmap table.
Any assets with a cointegration value of 25% is something to pay attention to and have a strong and stable relationship. Anything below is weak and not tradable.
Additionally, the 40% level is another important line to cross. Assets that have a cointegration score of over 40% will most likely have an extremely strong relationship.
Think about it this way, the higher the percentage, the tighter and more statistically reliable the relationship is.
The spread table:
After finding a good asset pair using heatmap, locate the same pair in the spread table (right side).
Here’s what you’ll see on the table:
Spread: Current difference between the two symbols based on the regression fit
Mean: Historical average of that spread
Z-score: How far current spread is from the mean in standard deviations
Signal: Trade suggestion: Short, Long, or Neutral
Since you’re expecting mean reversion, the idea is that the spread will return to the average. You want to take a trade when the z-score is either over +2 or below -2 and exit when z-score returns to near 0.
You will usually see the trade suggestion on the spread chart but you can make your own decision based on your risk level.
Keep in mind that the Z-score for each pair refers to how off the first asset is from the mean compared to the second one, so for example if you see STOCKA vs STOCKB with a Z-score of -1.55, we are regressing STOCKB (Y) on STOCKA (X).
In this case, STOCKB is the quoted asset and STOCKA is the base asset.
In this case, this means that STOCKB is much lower than expected relative to STOCKA, so the trade would be a long position on stock B and short position on stock A.