Adaptive Trend Rails [NICK789]Adaptive Trend Rails
OVERVIEW
Adaptive Trend Rails is a market-structure and break-and-retest framework built around one shared price channel. It is designed to answer four practical questions:
1. Which direction currently controls the chart?
2. What exact price level would confirm continuation or a trend change?
3. Is pressure building against the active trend before that change is confirmed?
4. Has price completed a valid breakout, retest and rejection sequence that can be turned into a structured trade plan?
This is not a collection of unrelated indicators placed on the same chart. The rail engine is the foundation of the script, and every additional component—equilibrium, reversal pressure, trend-change quality, multi-timeframe context and the break-and-retest plan—uses information derived from that same structure.
CORE RAIL ENGINE
The script builds an upper and lower rail from the highest high and lowest low of an adaptive lookback. The lookback changes according to the chart timeframe, while the user-selected Narrow, Medium or Wide setting adjusts how quickly the rails react.
A bullish break occurs when price crosses above the previous upper rail. A bearish break occurs when price crosses below the previous lower rail.
The script then classifies each break according to the existing trend state:
• A break in the current direction is treated as continuation.
• A break against the current direction is treated as a trend change.
Because the decision level is taken from the previous rail value rather than the rail currently expanding with price, users can see the actual level that must be crossed. The live “Continue?” and “Trend Change?” guides therefore act as decision levels, not predicted targets.
ADAPTIVE EQUILIBRIUM
The centre line is not a simple midpoint or fixed moving average.
First, the script measures where price is positioned between the active upper and lower rails. That normalized position is then smoothed using EMA and volume-weighted information, with a WMA fallback when volume-weighted data is unavailable. The accepted position is shifted toward the centre and constrained so the equilibrium cannot sit directly on the outer rails.
The resulting line represents an adaptive accepted-value area inside the current structure.
Equilibrium is used throughout the script:
• Its slope helps determine whether internal momentum is rising or falling.
• Its curl helps identify a possible change in pressure.
• Retest plans require price to remain on the correct side of equilibrium.
• Optional entry filtering can require equilibrium to slope in the proposed trade direction.
• A pending retest is cancelled when price loses the required equilibrium relationship.
For this reason, equilibrium is part of the calculation engine and not merely a decorative average.
REVERSAL-PRESSURE WARNINGS
The yellow reversal dots are early warnings, not reversal signals.
While a trend is active, the script measures opposing pressure using a weighted combination of:
• Candle closing location
• Upper or lower wick rejection
• Directional candle-body strength
• Relative volume participation
• Relative candle-range expansion
• Equilibrium slope or curl
• Price location within the rail structure
A bearish warning is only considered while the rail trend is bullish and price is positioned in the upper portion of the structure. A bullish warning is only considered while the rail trend is bearish and price is positioned in the lower portion.
The warning means pressure is building against the current trend. It does not change the trend by itself. Price must still close through the displayed Trend Change level before the rail state is considered reversed.
A cooldown is applied to prevent repeated warning dots from being printed on every nearby candle.
TREND-CHANGE QUALITY
When a confirmed trend change occurs, the script assigns a compact quality reading based on the breakout candle.
The score combines:
• Relative volume
• Relative candle range
• Directional body strength
• Closing location in the breakout direction
The resulting label is shown as Weak, Moderate, Good or Strong.
The tooltip also describes the character of the breakout, such as Clean Break, Expansion, Absorption, Weak Close or Low Participation. This is intended to provide context, not to guarantee that a strong-rated break will continue.
MULTI-TIMEFRAME CONTEXT
The horizontal trend strip rebuilds the same rail-state method across nine timeframes:
1 minute, 5 minutes, 15 minutes, 30 minutes, 1 hour, 2 hours, 4 hours, 1 day and 1 week.
This is important because the table is not mixing unrelated moving-average or oscillator definitions. Every timeframe is evaluated with the same upper-rail/lower-rail breakout method used on the chart.
The script also assigns a practical paired timeframe to the active chart—for example, a 1-minute chart is paired with 5 minutes, a 5-minute chart with 15 minutes, and a 15-minute chart with 1 hour.
Paired-timeframe information is warning-only. It does not silently block, delay or change an entry. When a plan triggers against the paired rail trend, the table and dedicated alert identify that conflict so the trader can make the final decision.
BREAK-AND-RETEST PLAN
The optional trade-plan engine does not enter immediately when a rail breaks.
Its sequence is:
1. Price closes through a continuation or trend-change level.
2. The exact broken rail level is stored.
3. Price must return on a later candle and touch or sweep that level.
4. The candle must reject the level and close back through it in the breakout direction.
5. Price must remain on the correct side of equilibrium.
6. Optional filters check equilibrium slope and whether the rail structure is wide enough relative to the configured stop distance.
All confirmed setups are labelled simply as “RETEST” to avoid implying that one setup carries a guaranteed grade or outcome. The tooltip still identifies whether the retest followed a Trend Change or a Continuation break.
The user may enable both setup types or restrict the engine to trend changes, continuations, longs or shorts.
Pending setups expire after the selected number of bars. They are also cancelled when the rail trend changes or price invalidates the required equilibrium relationship. This prevents an old breakout level from remaining armed after its original context has disappeared.
RISK AND PLAN DISPLAY
When a retest entry is confirmed, the script can display:
• Entry level
• ATR-adaptive or fixed-tick stop
• Reward/risk or fixed-tick target
• Active-plan direction
• Target-hit or stop-hit result
The default ATR Adaptive method scales the stop to current volatility and calculates the target from the selected reward/risk ratio. This makes the plan transferable across forex, metals, crypto, stocks and futures even when their price increments differ. A Fixed Ticks mode remains available for traders who intentionally use exchange tick distances on instruments such as futures. All values remain examples and must be adjusted for the instrument, timeframe and personal risk limits.
The tool is an indicator, not an automated strategy. It does not calculate position size, brokerage fees, commissions, spread or slippage, and it does not place orders.
HISTORICAL REVIEW
Historical plans and review statistics are optional and disabled by default.
The review panel counts completed target and stop outcomes visible in the loaded chart data and reports the net result in R-multiples. Replaced plans are excluded. If both the target and stop are touched within the same ordinary chart candle, the script records the stop first because the true intrabar sequence cannot be known from standard OHLC data.
Win rate is hidden until a minimum sample is available. These statistics are intended for chart review and configuration comparison only. They are not a full strategy backtest and should not be presented as expected future performance.
HOW TO USE
A simple workflow is:
1. Select Narrow, Medium or Wide rails according to the desired reaction speed.
2. Read the active rail colour to identify the current structural direction.
3. Use the Continue and Trend Change levels as the prices that would confirm the next structural event.
4. Treat reversal dots as preparation warnings only.
5. Use the quality label to inspect the participation and candle character of a confirmed trend change.
6. Check the multi-timeframe strip for broader alignment or conflict.
7. Enable the Break & Retest Plan when structured retest signals, ATR-adaptive or fixed-tick levels and review tools are required.
8. Adjust stop and target ticks for the traded symbol rather than assuming the defaults fit every market.
DEFAULT DISPLAY
The default view focuses on the rails, adaptive equilibrium, live decision levels, trend-change quality and multi-timeframe context.
Candle colouring, the trade-plan engine, historical plans and review statistics are optional so users can keep the chart clean and enable only the tools relevant to their workflow.
ALERTS
Alerts are provided for:
• Bullish and bearish continuation
• Bullish and bearish trend change
• Bullish and bearish reversal pressure
• Long and short break-and-retest entries
• Entries against the paired timeframe
• Replacement of an unresolved plan by an opposite valid setup
• Target hit
• Stop hit
Confirmed continuation, trend-change and retest-entry alerts are intended for candle-close use. Reversal-pressure warnings are intentionally earlier and should always be treated as unconfirmed until the relevant Trend Change level is closed through.
LIMITATIONS
Adaptive Trend Rails is a structure and planning tool, not a prediction engine.
Rail breaks can fail, strong breakout candles can reverse, and multi-timeframe alignment does not guarantee continuation. ATR-based distances expand and contract with recent volatility, while fixed-tick distances behave differently across instruments and feeds. Historical review results are displayed in R-multiples and depend on the loaded chart, selected settings and available OHLC data.
Users should combine the tool with their own risk management, market-session awareness and execution rules.
ORIGINAL CONTRIBUTION
The original purpose of this script is to turn one adaptive rail structure into a complete decision sequence:
current trend → live confirmation level → opposing-pressure warning → confirmed structural break → quality context → multi-timeframe comparison → delayed retest validation → risk-plan display → optional historical review.
Each component exists to explain or validate another part of that sequence. The script is therefore designed as one integrated framework rather than a mashup of independent indicators. Indicador

Trendline Architect [Quantum Algo]Trendline Architect
====================================================
🔶 OVERVIEW
Trendline Architect is an automatic trendline indicator that does what most trendline tools skip: it validates every line before drawing it, makes each line earn its status through real touches, grades every breakout by quality, and then automates the break-and-retest sequence that trendline traders normally track by hand. Lines are born as dotted candidates, promoted to solid confirmed trendlines only after the market validates them with a third touch, graded on breakout, kept on a retest watch after they break, and paired into parallel channels automatically — all with a deliberately quiet chart: one-letter signals whose full context lives in hover tooltips.
The problem this script solves is trendline spaghetti and trendline noise. Automatic trendline tools typically draw every pivot-to-pivot connection and alert on every violation. This engine rejects invalid lines at birth, refuses duplicates, caps how many lines can exist per side, silences the breaks of unproven lines by default, and filters weak breakouts by grade — so what remains on the chart is only what the market has actually respected.
🔶 WHAT IS A TRENDLINE BREAK AND RETEST?
A trendline connects successive swing points and acts as dynamic support or resistance while price respects it. A breakout occurs when price closes decisively through the line. The retest is what disciplined traders wait for next: price returning to the broken line from the other side and rejecting — old support acting as new resistance, or old resistance reclaimed as support. That return-and-reject is one of the most traded patterns in classical charting, and this engine detects the entire sequence automatically: validated line, graded break, watch window, confirmed retest.
🔶 WHY THIS SCRIPT IS ORIGINAL
1. Geometric validity at birth. A candidate line is rejected before it is ever drawn if any candle close violated the segment between its two anchor pivots. Lines that were never respected never reach the chart.
2. Touch-earned lifecycle. Every line starts as a dotted, untagged candidate. Each validated touch — a wick into tolerance with a close that respects the line — is counted, and only at the configured touch count is the line promoted: solid, thicker, fully colored, with a live ×N touch tag. The chart itself shows which lines the market obeys.
3. Anti-spaghetti engineering. Duplicate candidates with similar slope and position are refused, each side is capped at a configurable number of active lines with the weakest evicted first, and stale lines expire by age. The chart stays readable on every timeframe.
4. Breakout quality grading. Every breakout is scored from three observable components — volume z-score, penetration depth in Average True Range units, and breakout candle body ratio — into grades A, B, and C. Grade A signals highlight in the accent color.
5. A retest engine. Broken lines are not deleted; they turn into gray watch lines for a configurable window. A return to the broken line with a rejecting close prints the Retest signal — the classic polarity flip, automated.
6. Silence by default, depth on demand. Signals print as single letters — B for breakout, R for retest — with the full context (direction, grade, volume, penetration) in the hover tooltip. Two noise filters ship enabled: breaks of unconfirmed lines retire silently, and breakouts below a minimum grade stay off the chart and out of the alerts.
7. Automatic channel detection. When an active support line and resistance line run parallel within a slope tolerance, the engine fills the channel between them and reports it on the dashboard.
8. A live architecture dashboard. Active support and resistance counts, the nearest line with its distance in Average True Range units, a trend read derived from confirmed line slopes, the last break grade, the retest watch count, and channel status — in a compact, fully themeable panel.
🔶 HOW IT WORKS
Line construction: Confirmed swing pivots anchor every candidate line. Each new pivot is paired with the previous same-side pivot, the segment is checked for historical violations, duplicates are rejected, and side capacity is enforced before the line is created.
Touch validation: A touch counts only when the wick enters the tolerance band around the line and the close still respects it. Touches accumulate on the line's tag; the confirming touch promotes the line and, from that point, validated touches are marked with dots.
Breakouts: A close through the line beyond the buffer triggers the break. Confirmed lines produce graded signals; forming lines retire silently when the default filter is on. The broken line converts to a gray dashed watch line.
Retests: Within the watch window, a return to the broken line with a rejecting close prints R — upward reclaim of broken resistance, or downward rejection at broken support. Watch lines that see no retest expire quietly.
Channels: Active opposite-side lines are compared by slope; the closest parallel pair within tolerance is filled as a channel.
Non-repainting: Pivots require confirmation, and all touches, promotions, breaks, and retests are evaluated on closed bars only. Once printed, nothing moves.
Chart hygiene: Completed lines, touch dots, and signals are all capped by input, keeping the chart clean and the auto-scale anchored to current price.
🔶 HOW TO USE IT
1. Works on any market — cryptocurrency, forex, gold, indices, stocks, futures — and any timeframe. Raise the pivot length for larger structures.
2. Trust the visual hierarchy: dotted lines are candidates, solid lines with ×N tags are market-validated, gray dashed lines are broken and on retest watch.
3. Treat B signals as regime information: grade A breakouts with volume and penetration carry far more weight than the minimum-grade ones, and the grade is one hover away.
4. The R signal is the classic entry location: the broken line has flipped roles and price has confirmed the flip. Stops belong on the far side of the retested line.
5. Use the dashboard's Nearest row to know how far price is from the closest active line in Average True Range units before it gets there.
6. If you want the raw, unfiltered feed, disable the two noise filters in Signals — the engine detects everything either way.
🔶 SETTINGS
- Detection: pivot length, maximum anchor span, active lines per side, line expiry, completed lines to keep.
- Touches, breaks and retests: touch tolerance, touches to confirm, breakout buffer, retest watch window.
- Signals: breakout and retest toggles, confirmed-lines-only filter, minimum breakout grade.
- Channel detection with slope similarity tolerance.
- Full color customization, extension length, touch dots toggle.
- Themeable dashboard: position, four text sizes, title band, background, frame, grid, and three text colors.
🔶 ALERTS
- Trendline Confirmed — a line collected its confirming touch.
- Bullish / Bearish Trendline Breakout — a qualified close through a line, honoring the grade filter.
- Bullish / Bearish Retest Confirmed — a broken line was retested and rejected.
- Parallel Channel Detected — an active support and resistance pair is running as a channel.
🔶 FREQUENTLY ASKED QUESTIONS
Does the indicator repaint? No. Anchors are confirmed pivots and every touch, break, and retest is evaluated at bar close. Pivot confirmation introduces intentional lag equal to the pivot length.
Why do I see so few lines? By design. Between geometric validation, duplicate rejection, side caps, and expiry, only lines with genuine market respect survive. Raise the per-side cap or lower the confirmation count for a busier chart.
What do B and R mean? B is a graded breakout and R is a confirmed retest of the broken line. Hover either label for direction, grade, volume, and penetration details.
Why did a breakout print no signal? Either the line was still unconfirmed while the confirmed-only filter is on, or the break graded below your minimum. The line still changed state; only the signal was filtered.
What makes a grade A breakout? Elevated volume, deep penetration beyond the line in Average True Range terms, and a strong-bodied breakout candle — all three together.
🔶 CREDITS
Trendline analysis, breakout trading, and the break-and-retest pattern are classical charting techniques in the public domain, refined by generations of technicians. This script gratefully acknowledges that shared lineage. The geometric validity engine, touch-earned lifecycle, breakout grading model, retest watch engine, channel detection, noise-filtering architecture, and all code in this script are original work — no third-party or open-source script code was reused.
🔶 LIMITATIONS
Trendlines are geometry, not guarantees: valid lines break and graded breakouts fail. Pivot confirmation delays anchor recognition by design. Volume grading is less meaningful on symbols with unreliable volume reporting. Channel detection reports the closest parallel pair, not every possible channel. No indicator replaces independent analysis.
🔶 DISCLAIMER
This script is provided strictly for educational and informational purposes. It is not financial advice, an investment recommendation, or a solicitation to buy or sell any financial instrument. Past behavior of any trendline, breakout, or retest does not guarantee future results. Trading involves substantial risk. Always do your own research and manage risk independently.
Indicador

AlgoZ Pro Price ActionAlgoZ Pro Price Action is a clean price action based forex indicator built to help traders identify potential Buy, Sell, and Exit areas using a combination of market structure, trend filtering, volatility logic, and dynamic trade management.
This indicator is designed around the idea that not every trade needs to have a high win rate to be useful. Instead of only looking for quick scalp targets, AlgoZ Pro Price Action is built to manage trades with a runner-style approach. The goal is to cut weak trades faster, protect trades that start moving in the right direction, and allow stronger moves to continue when momentum is present.
The default settings are best suited for 1-minute EUR/USD forex trading. Other forex pairs and timeframes may work differently and should be tested before use.
The indicator uses market structure breaks to identify possible directional shifts. When price breaks key internal support or resistance levels, the script checks multiple filters before plotting a signal. These filters are designed to reduce low-quality signals during chop, weak momentum, or overextended conditions.
AlgoZ Pro Price Action includes Buy, Sell, and Exit labels directly on the chart. Buy signals are shown in teal, Sell signals are shown in pink, and Exit signals are shown in a neutral color. The bars can also be colored based on the active signal direction so it is easier to visually track the current market bias.
One of the main parts of this indicator is the trend lock system. The trend lock helps prevent the indicator from flipping back and forth too quickly during noisy market conditions. It uses EMA trend structure, slope behavior, and confirmation bars to decide whether the market is currently favoring Buy-side or Sell-side continuation. Countertrend signals must be stronger before they are allowed through, which helps reduce random reversal signals during an active move.
The indicator also includes automatic forex pair adjustment. It detects whether the chart is a JPY pair or a non-JPY forex pair and automatically adjusts pip size calculations. This helps prevent issues where a stop or exit calculation is too tight or too wide because of the symbol’s price format. The script also includes auto volatility tuning, which uses ATR-based logic to scale stop size, runner triggers, trailing stop distance, dead-trade protection, and cooldown behavior based on the current pair’s movement.
Trade management is handled through a dynamic exit engine. Instead of using only fixed take profit levels, the indicator uses runner logic. Once a trade moves far enough in profit, the trade can enter runner mode. From there, the script can move the stop, protect profit, and trail the trade if the move continues. This allows stronger trades to breathe while still giving the indicator a way to exit when momentum fades.
AlgoZ Pro Price Action also includes dead-trade protection. If a trade has been open for a certain number of bars and has failed to make meaningful progress, the script can plot an Exit signal. This is designed to help remove weak trades that are not moving enough to justify staying in them.
The indicator includes several optional filters and controls, including EMA trend filtering, ADX strength filtering, chop filtering, candle body quality filtering, minimum EMA separation, price distance from the slow EMA, overextension protection, post-exit cooldown, and emergency protection logic.
Main features include:
• Buy, Sell, and Exit labels
• Teal and pink AlgoZ Pro visual theme
• Price action and market structure based signals
• Internal support and resistance break logic
• Optional BOS / CHoCH structure markings
• EMA trend filtering
• ADX trend strength filter
• Chop and range filter
• Candle quality filter
• Trend lock system
• Countertrend signal protection
• Auto pip size detection
• Auto adjustment for JPY and non-JPY forex pairs
• ATR-based auto pair tuning
• Dynamic stop logic
• Runner-style trade management
• Breakeven / profit lock logic
• Trailing stop logic for stronger moves
• Dead-trade exit protection
• Optional bar coloring
• Optional entry and stop lines
• Optional status table
Recommended default use:
1-minute EUR/USD forex chart.
Other forex pairs and timeframes may require adjustment depending on spread, volatility, session, and market conditions. Indicador

SmartTraders Research Labs -Geometric Trend Lines - GTLGEOMETRIC TREND LINES (GTL)
GTL is a research indicator that studies the geometry of price structures. It freezes structural anchors in the past, stretches two right-triangles between those anchors and the live candle, and reads their angles inside a dimensionless coordinate space — then learns from every completed structure to estimate, with calibrated statistics, which way the current one is leaning. It is a structural analysis and research tool, not a trading system.
█ STEP OUT OF THE CHART PLANE
Every trader has drawn a trendline and called it steep. Steep compared to what? Stretch the chart window and the angle flattens. Jump from Bitcoin to a quiet blue-chip stock and a "45-degree rally" becomes a completely different animal. The chart plane mixes two quantities that were never meant to share axes — price and time — so any angle drawn on it is a property of your zoom level, not of the market.
My standard, before any geometry begins, is to take the shape out of the chart plane entirely. GTL maps every point into an Isotropic Coordinate System (ICS) where both axes are pure numbers:
y = log(price) / σ
x = bars / lookback
Price is expressed in units of the instrument's own volatility (σ, estimated with the Yang-Zhang method over 500 bars), and time in units of the analysis window. Nothing on either axis carries dollars, lira, satoshis or minutes anymore.
In this space, a degree finally means something. The angle
θ = atan(Δy / Δx) × 180 / π
is intrinsic: a 60° ceiling angle on gold's 30-minute chart describes the same geometric event as a 60° ceiling angle on a 3-minute meme-coin chart. The instrument's personality — its price level, its tick size, its temperament — has been normalized away, and what remains is pure trajectory. Everything else in this indicator stands on that ground.
The same rally, two zoom levels, two different angles — and on the right, the dimensionless ICS home where θ finally becomes a property of the market, not of your screen.
█ THE TRIANGLE — A SHAPE THAT CARRIES DATA
Of all the shapes humanity has leaned on, the triangle is the one that never let us down. It raised the pyramids, it holds every bridge truss and roof frame you have ever walked under, and it is the only polygon that cannot be deformed without changing the length of a side. Engineers call that property rigidity. I read it as trustworthiness — a triangle does not lie about its geometry.
That is why I chose it as the measuring instrument. On every structure, GTL constructs two right-triangles inside ICS:
The ceiling triangle — from the frozen HH anchor to the live candle's high.
The floor triangle — from the frozen LL anchor to the live candle's low.
Each triangle is not a drawing; it is a container. Four measurements live inside it at every bar:
θ — the signed angle of the hypotenuse, the indicator's core reading
Δy — the signed magnitude of the move in volatility units
area — the geometric surface the structure has swept
centroid — the shape's center of mass in ICS
While price grinds below a frozen ceiling, the ceiling angle sinks degree by degree into negative territory. When price presses up from a frozen floor, the floor angle climbs. Two triangles breathe with the market — one watching from above, one from below — and their angles are the raw language everything downstream of this indicator speaks.
One triangle watches from above, one from below — and θ, Δy, area and centroid live inside each of them.
█ AN ANCHOR IN THE PAST — MEASURING FROM CALM WATER
Picture a storm at sea, and two people trying to measure the waves. One stands on the shore. One sits in a boat, right among them. The observer on the shore, feet on solid ground, reads the height of every wave with precision — however wild the water gets, the ground beneath him does not move. The observer in the boat rises and falls with the very thing he is trying to measure; every number he writes down is contaminated by his own motion.
Most swing-based tools are the observer in the boat. Their reference points — the latest swing high, the latest swing low — are redefined by the market again and again, so any angle or distance measured from them mixes two movements at once: the price's, and the reference's own.
GTL plants its observer on the shore. At the birth of every structure, the highest high and the lowest low of the lookback window are frozen — locked to a fixed bar in the past — and from that moment they do not move. Every angle is measured from calm, settled water toward the storm of the live candle. The reading stays pure: when θ changes, it is because price moved, and for no other reason.
The anchors hold until price closes beyond one of them. That close is the break — the moment the structure completes, is archived with its full geometry, and a fresh pair of anchors freezes for the next chapter.
One naming note, so the chart reads correctly: what GTL labels HH and LL are these frozen anchor levels, not the traditional trailing swing highs and lows.
Solid ground measures the storm precisely; a boat measures mostly itself — GTL is the observer on the shore, and the frozen box below is exactly that shore.
█ WHY 23 — A PRIME WINDOW
The lookback window — the number of bars GTL scans before freezing a new pair of anchors — defaults to 23. The choice is arithmetic, not aesthetic.
23 is prime: its only divisors are 1 and itself. Stated as a condition,
gcd(23, k) = 1 for every k < 23
For a rolling window, that matters mechanically. If a periodic component of length k shorter than the window is present in the data, the window boundary does not keep meeting that component at the same phase. Because 23 and k are coprime, the alignment steps through all k possible phase offsets before it repeats. A composite window gives that protection away: 24 divides cleanly by 2, 3, 4, 6, 8 and 12, so components at those lengths can meet repeated window boundaries at the same phase, allowing anchor placement to inherit regularity from the measuring frame itself.
Engineering solved the same problem with hunting-tooth gear design: tooth counts are chosen coprime so each tooth eventually meshes with every counterpart, instead of the same pairs meeting forever and wearing a repeated pattern into the metal. Periodical cicadas offer a biological analogy — 13- and 17-year emergence cycles, both prime, reduce overlap with shorter recurring cycles.
This is a design principle stated in number theory, not a performance claim. A prime window does not make GTL better by itself, and it does not prove anything about future price. It simply reduces one avoidable source of arithmetic resonance, so repetition in the readings is less likely to be created by the measuring window. The lookback remains a user input; 23 is the default I stand behind.
Every window from 20 to 25 shares a divisor with at least one shorter cycle length — 23 is the only empty row, which is exactly why it is the default.
█ HOW THIS SERIES IS BUILT — CSV OUT, ANALYSIS IN
This episode follows a working method I now treat as the standard for the whole series: nothing ships on intuition alone. The indicator exports its own internal life — every angle, every structure, every break — as plain columns in the Data Window, ready for CSV export. Before publication, those exports were analyzed with AI assistance across a deliberately diverse panel:
7 instruments × 2 timeframes = 14 datasets
gold, Bitcoin, Tesla, Brent crude, Turkish Airlines, Dogecoin, Saudi Aramco
30-minute and 3-minute bars — roughly 550,000 bars, ~30,000 completed structures
What came back from that study entered the code as design decisions, not as promises. Exactly five constants in the learning layer are hard-coded. They are not presented as universal truths or performance guarantees; they are documented design constants selected from the development study and kept fixed so the live model remains transparent and reproducible:
CAL_LAMBDA = 0.999 — fading-factor decay for the calibration counters
CAL_JUMPTH = 2.0 — empirical jumpiness threshold between steady and choppy estimates
CAL_MINW = 30 — minimum effective sample weight before a calibration cell is trusted
CAL_ROLL = 20 — length of the live recent-record window
JUMP_WIN = 5 — bars used for the short-term stability measurement
The methods behind the layer are standard enough to be named — fading-factor prequential counting for online calibration, adaptive Gaussian KDE for local probability estimation, and Kish-style effective sample size for weighted evidence — and the next section walks through each of them with its reference. The fixed values above are GTL's calibrated defaults from that study, not claims that these numbers are optimal for every market, symbol, or timeframe. Everything else the statistics need — bandwidth, confidence, significance — is computed live from the chart's own history.
Two honest disclosures. First, this analysis is development documentation, not an independent audit, and this description makes no accuracy claims from it. Second, the same door is open to you: every column used in that study is exported by the script itself, so you can pull the CSV from your own chart and put the same questions to any tool you trust.
The build loop of this series: the script exports its own life as CSV, analysis turns it into five documented design constants, and the same door stays open to every user.
█ FROM GEOMETRY TO STATISTICS — THE MATH, WITH ITS REFERENCES
An angle is a measurement; an estimate is a statement. Moving from one to the other honestly requires statistics. GTL does not present this layer as a private invention. It combines established statistical components, named here with their sources, and applies them to one specific object: the geometry of frozen price structures.
Volatility normalization. The σ in the ICS y-axis comes from the Yang-Zhang volatility estimator (Yang & Zhang, Journal of Business, 2000). It uses open, high, low and close data, including overnight, open-to-close and Rogers-Satchell-style range components. In GTL, this is what lets angles be measured in volatility-normalized space instead of raw price units.
Local probability. While a structure is alive, its current angle pair (θC, θF) is compared with archived breaks. Each historical break receives a Gaussian weight that decays with distance in angle space. This is a Gaussian KDE-style local weighting scheme. Its bandwidth follows Silverman's rule-of-thumb logic for two dimensions, h = σ̂ · n^(−1/6), recomputed from the chart's own history. Nothing is manually tuned.
Honest sample size. Weighted evidence can look larger than it really is: many tiny weights are not the same as many strong neighbors. GTL therefore uses the Kish effective sample size (Kish, Survey Sampling, 1965),
n_eff = (Σw)² / Σw²
to estimate how much effective evidence the weighted neighborhood actually contains.
Probability with humility. The weighted up/down vote is passed through a Beta(1,1) posterior, using n_eff as the effective evidence scale. The label only speaks when the posterior mean clears a one-sided 95% normal-approximation check against the 50/50 baseline. When that threshold is not met, the label does not force a call; it simply says the structure is too close to call.
Verification. The principle that probability forecasts must be scored against what actually happened goes back to Brier's 1950 paper in Monthly Weather Review, "Verification of Forecasts Expressed in Terms of Probability." In GTL, every estimate is graded when the break reveals the outcome.
Online calibration. Graded outcomes update fading-factor prequential counters, following the stream-learning evaluation framework of Gama, Sebastião and Rodrigues (Machine Learning, 2013). Fresh evidence receives more weight, while older evidence decays with λ = 0.999. The display can therefore show both the raw estimate and how estimates of the same kind have behaved on the current chart.
Stability. GTL also tracks estimate "jumpiness": the population standard deviation of the last five probability readings. The term and the general idea come from ensemble-forecast consistency research, especially Zsóter, Buizza and Richardson (Monthly Weather Review, 2009). GTL uses a chart-specific adaptation of that idea: a steady estimate and a choppy estimate are labeled differently, because a choppy estimate may still flip.
Nothing in this chain is exotic, and none of it is a performance guarantee. The original part is where the chain is pointed: at frozen structural geometry, measured inside a dimensionless coordinate space.
█ WHAT YOU SEE ON THE CHART
Frozen anchors. Two dashed horizontal lines mark the frozen HH and LL of the current structure, each with its exact level, and a dotted vertical line marks the anchor bar in the past where the freeze happened. These lines do not trail price — that is the whole point.
Geometric trend lines. Two solid lines run from the anchors to the live candle: ceiling from HH to the current high, floor from LL to the current low. They are the triangle hypotenuses. When the two lines converge, they stop at their intersection instead of crossing. The live θC and θF values sit as labels at the anchor.
Structure boxes. Every completed structure is archived as a box: one border color for structures that broke up, another for structures that broke down, and a dashed box for the structure still being built. How many past boxes you see is your choice.
Angle map. A table sorts the recent breaks by their break angles — ceiling side and floor side, each with direction and duration. An arrow row shows where the current live reading ranks among them, so you can literally see where "now" sits in the break history. The footer row carries the up/down estimate; once the calibration cell has enough samples, it shows two numbers, raw → calibrated.
Estimate label. A label floats ahead of the last candle and speaks in sentences: which direction the odds favor, what signals of this kind have actually done on this chart (or the estimated odds while calibration is still warming up), whether the signal is steady or choppy, and a living record — how many of the last 20 estimates were right. It only takes a side when the significance check passes; otherwise it says, honestly, that the structure is too close to call.
The pending phase. Between a break and the next freeze, preview anchors appear as dotted gray lines, the table shows an hourglass, and the estimate quietly switches to a second model trained on pending-phase angles to estimate the direction of the NEXT structure's break.
One disclosure that matters: on the live bar, angles and estimates can change until the candle closes. Everything the indicator learns from — and every alert it fires — reads confirmed bars only.
█ UNDER THE CHART — 29 EXPORTED COLUMNS
Everything drawn above is only a rendering. The numbers underneath are all exported to the Data Window, which means TradingView's "Export chart data" hands you a complete CSV audit trail:
Live geometry & estimate, every bar:
Ceiling θ / Floor θ — the two live angles in ICS
Probability UP / Probability DOWN — the per-bar estimate (these two are also plots, so you can build threshold alerts on them directly)
Log Jump Bar — the stability (jumpiness) of the estimate
Log Cell Bar — which calibration cell this bar fell into
Structure snapshot, printed on every break bar:
Str Duration — how many bars the structure lived
Str Frozen HH / Str Frozen LL — the anchor levels
Str Max High / Str Min Low — the extremes reached inside
Str θ Ceil @Max / Str θ Floor @Min — the angles at those extremes
Str Break Dir — +1 up, −1 down
Estimate audit trail, on birth and break events:
Log Event — 1 = birth, 2 = break, 3 = both on one bar
Log θC Birth / Log θF Birth / Log P Birth / Log Sig Birth / Log nEff Birth — the forecast made the moment the structure was born
Log θC Pend / Log θF Pend / Log P Pend / Log Sig Pend / Log nEff Pend — the pending-phase forecast carried into this break
Log Hit Birth / Log Hit Pend — each forecast graded 1 or 0 against the actual break
Log Acc Birth / Log Acc Pend — the running accuracy of each estimate type
This is the same door the development study walked through. Export the CSV from your own chart, open it in a spreadsheet, in Python, or hand it to an AI assistant — and audit every sentence the label has ever told you.
█ SETTINGS THAT STAY OUT OF YOUR WAY
The settings menu is deliberately small: the lookback window, a few visual choices — colors, transparency, border style, table position, label size and offset, how many past boxes to show — and simple on/off toggles. That is the whole surface, because everything statistical is computed live from the chart itself: the KDE bandwidth from Silverman's rule, the effective sample size from Kish's formula, significance from the posterior, the calibrated rate from the fading counters, the pending-phase model switching in and out on its own. There is nothing to tune, and that is by design. The five documented constants from the development study are the only fixed numbers in the machine.
█ ALERTS
Three alerts cover the estimate's life cycle: Signal turns up, Signal turns down, and Signal gets choppy. Each fires once, on entering its state, and reads only confirmed bars — so what fired is what you will still see on the closed candle. For custom thresholds, Probability UP and Probability DOWN are exposed as plots: build Crossing Up or Greater Than alerts on them directly in TradingView's alert dialog, at any level you like, as many as you like. Recommended frequency: Once Per Bar Close.
█ SEVENTEEN LANGUAGES
The angle map, the anchor labels and the estimate label speak 17 languages: English, Türkçe, Deutsch, Italiano, Français, Español, Bahasa Indonesia, Bahasa Melayu, Ελληνικά, Русский, 中文, 日本語, 한국어, हिन्दी, العربية, فارسی and עברית. Right-to-left scripts — Arabic, Persian, Hebrew — mirror the table layout automatically. One honest limitation: input settings and alert messages stay in English, because Pine requires compile-time constant strings there.
█ WHAT THIS IS — AND WHAT IT IS NOT
GTL is a research and structural analysis tool. It measures the geometry of frozen price structures, keeps honest statistics about its own estimates, and shows you both — the raw number and the track record, side by side. It is not a trading system, its estimates are not trade signals, and nothing in this script or this description is financial advice. The calibrated rates describe what has already happened on your chart's own history; they are not a promise about the next bar. On the live candle, readings can change until the close — confirmed statistics and learning update on closed bars only.
Read it the way it was built to be read: as an instrument standing on the shore, measuring the storm. Indicador

Universal Scalper SystemThe Universal Scalper System is a powerful technical indicator designed specifically for intraday scalping on lower timeframes like 1-minute and 5-minute charts. It provides a streamlined approach to trading by combining trend identification with essential market data.
Key Features:
9 EMA Crossover: Generates clear, actionable Buy and Sell signals the moment the price crosses and closes beyond the 9-period Exponential Moving Average (EMA).
Live Market Dashboard: Includes a fully customizable dashboard that displays:
Current Chart Timer: Countdown until the current candle closes.
15-Minute Timeframe Timer: Tracks the closure of the 15-minute candle for higher-timeframe context.
Real-time Candle Info: Shows if the current candle is Bullish or Bearish along with live volume data.
Highly Customizable: Traders can easily adjust EMA settings, dashboard colors, text sizes, and dashboard positioning directly through the settings panel to fit their unique workspace.
Built-in Alerts: Features integrated alert conditions for both Buy and Sell signals, ensuring you never miss a trading opportunity.
This system is perfect for traders who prioritize speed, clean visuals, and real-time data at their fingertips.
Tags: Scalping, EMA, CrossOver, Dashboard, TradingSystem, PriceAction, TechnicalAnalysis, Indicator, Scalper, LiveTimer Indicador

Bias Zone (ES & NQ)Bias Zone (ES & NQ)
A clean daily bias zone for index futures. Enter today's zone top and bottom in Settings and the script shades it, reads the regime, and labels it:
🟢 Price ABOVE the zone → BULLISH (green)
🔴 Price BELOW the zone → BEARISH (red)
🟡 Price INSIDE the zone → NEUTRAL (yellow)
One script, both markets. It auto-detects whether you're on ES/MES or NQ/MNQ from the chart symbol and shows the matching zone, so you keep one indicator on both charts.
How to use:
1. Add it to your ES (or MES) and NQ (or MNQ) chart.
2. Open Settings and type today's zone top and bottom for each market.
3. Read the regime, or stand aside when price is inside the zone.
Important — read this: this is a MORNING SNAPSHOT. It shows where price sits relative to the zone at the time it was generated, not a live or predictive signal. The zone can shift through the session, so it is NOT a cue to enter a trade, and bullish/bearish is a description of structure, not a buy/sell call. Always do your own analysis and manage your own risk.
Optional midline, regime label, and a "bias as of" timestamp are included. Indicador

AUTO TRENDLINE PROauto trendline pro
auto trendline pro is an automatic trendline indicator designed to display multiple degrees of market structure at the same time: live trendlines, confirmed trendlines, and higher timeframe trendlines.
the purpose of the tool is to help traders identify dynamic support and resistance lines, projected levels, confirmed breaks, and higher timeframe structure directly on the chart.
the indicator uses pivot points, wick or body anchors, atr-based validation, touch detection, duplicate filtering, forward projection, optional channels, and a dashboard for fast market reading.
it can be used for scalping, intraday trading, swing trading, and macro analysis depending on the selected settings.
---
inputs guide
degrees
live degree
enables live trendlines. this mode reacts faster to recent price action, but it can repaint because the pivots are still developing. it is useful for short-term market reading and early structure detection.
confirmed degree
enables confirmed trendlines. this mode is more stable because it uses confirmed pivots. it is recommended for cleaner analysis and more reliable structural levels.
htf degree
enables higher timeframe trendlines. this mode brings larger market structure into the current chart and helps identify major dynamic support and resistance levels.
anchor source
selects how the trendline anchors are calculated.
wick uses candle highs and lows.
body uses candle open and close extremes.
wick is more aggressive and reacts to full price extremes. body is cleaner and can reduce noise.
---
pivot strength
live pivot l/r
controls the strength of live pivots. a lower value creates more reactive trendlines. a higher value creates fewer but cleaner lines.
confirmed pivot l/r
controls the strength of confirmed pivots. a higher value makes the confirmed trendlines more selective and more structural.
htf pivot l/r
controls the pivot strength used on the higher timeframe. higher values create more macro-level lines.
---
htf source
htf timeframe
selects the higher timeframe used for htf trendlines. examples: 4h, 1d, 1w. higher timeframes provide stronger macro structure.
htf ath/atl window
defines the lookback window used to detect higher timeframe highs and lows. a larger value allows the indicator to anchor lines to more important historical extremes.
anchor htf line at ath / atl
allows htf lines to be anchored from the highest high or lowest low inside the selected htf window. this is useful for long-term trendlines and cycle analysis.
htf compute in log space
calculates htf trendlines using logarithmic logic. this is useful for assets with large percentage moves, such as crypto, because it gives a more balanced macro structure.
---
structure and validation
lines per side chart degrees
defines how many chart-degree lines are displayed per side. increasing this value shows more trendlines but can make the chart busier.
lines per side htf
defines how many higher timeframe lines are displayed per side. a lower value keeps the chart cleaner. a higher value gives more macro context.
new-anchor candidates
defines how many recent pivots are tested as possible new anchors. higher values test more combinations.
older-anchor window
defines how many older pivots can be used with a recent pivot to create a valid trendline.
min bars between anchors
defines the minimum distance between two trendline anchors. a low value creates shorter lines. a higher value creates more meaningful structural lines.
allowed pierces
defines how many times price is allowed to pierce a line during validation. zero means strict validation.
pierce tolerance atr
defines the atr-based tolerance used when checking if price has pierced a line. a lower value is stricter. a higher value allows more flexibility.
touch tolerance atr
defines the atr-based tolerance used to count touches on a trendline. a higher value detects more touches. a lower value keeps only precise touches.
dedupe distance atr
filters trendlines that are too close to each other. a higher value removes more duplicate lines.
max validation span
defines the maximum number of bars used when validating a trendline. this prevents the indicator from validating lines across an excessive historical distance.
---
channels, break and extension
show channels
enables channels around the dominant trendline. channels help visualize the reaction area around a trendline instead of focusing only on a single line.
break = n consecutive closes beyond
defines how many consecutive candle closes are required to confirm a break. a value of 1 is faster. a value of 2 or more is stricter.
forward projection bars
defines how far the trendlines are projected into the future.
infinite extension
extends the lines continuously to the right. this is useful when using trendlines as ongoing dynamic support and resistance.
---
display
price projection label
shows the projected price at the end of a trendline. this helps identify the current reaction level quickly.
show trendline labels
enables or disables labels on trendlines. keeping this off gives a cleaner chart.
strength rating
shows a visual strength rating based on the number of valid touches. more touches generally mean a more important line.
show dashboard
enables the dashboard. the dashboard summarizes confirmed support, confirmed resistance, htf support, htf resistance, htf extremes, and validation status.
dashboard position
selects the position of the dashboard on the chart.
---
aesthetics
support
sets the color of support trendlines.
resistance
sets the color of resistance trendlines.
htf glow / accent
sets the accent color used for higher timeframe emphasis.
broken
sets the color used when a trendline is broken.
atr length
defines the atr length used for tolerances, validation, touch detection, break detection, and duplicate filtering.
---
how to use the indicator
start by using confirmed degree and htf degree. these two modes give the cleanest structure.
live degree is useful for faster market reading, but beginners should understand that live pivots can repaint while they are forming.
support lines are usually below price and can act as dynamic reaction zones.
resistance lines are usually above price and can act as dynamic rejection zones.
when price approaches a confirmed or htf trendline, watch how it reacts. price can reject the line, break through it, or compress near it before a stronger move.
a break is cleaner when price closes beyond the line. this is why the break confirmation input is important.
---
beginner tutorial
1. choose your trading timeframe, such as 15m, 1h, 4h, or 1d.
2. enable confirmed degree to display stable trendlines.
3. enable htf degree to display higher timeframe structure.
4. keep live degree enabled only if you want more reactive lines.
5. wait for price to approach a support or resistance trendline.
6. observe the candle reaction near the line.
7. a rejection can indicate that the line is still respected.
8. a confirmed close beyond the line can indicate a structural break.
9. use the dashboard to monitor the main confirmed and htf levels.
10. never use a trendline alone as a full trade signal. combine it with market structure, volume, candles, liquidity, and risk management.
---
simple beginner setup
live degree: off
confirmed degree: on
htf degree: on
anchor source: wick
confirmed pivot l/r: 10
htf pivot l/r: 8
allowed pierces: 0
break = n consecutive closes beyond: 2
show channels: on
show trendline labels: off
show dashboard: on
this setup keeps the chart clean and focuses on confirmed structure.
---
scalping setup
live degree: on
confirmed degree: on
htf degree: on
live pivot l/r: 3 to 5
confirmed pivot l/r: 8 to 12
break = n consecutive closes beyond: 1 to 2
forward projection bars: 10 to 30
show trendline labels: off
this setup gives faster signals and more reactive structure, but it should be used with more caution.
---
swing trading setup
live degree: off
confirmed degree: on
htf degree: on
confirmed pivot l/r: 10 to 20
htf pivot l/r: 8 to 15
htf timeframe: 1d or 1w
htf compute in log space: on for crypto
break = n consecutive closes beyond: 2 or 3
infinite extension: on
this setup focuses on larger trendlines and reduces short-term noise.
---
dashboard guide
conf resist
shows the main confirmed resistance trendline level.
conf support
shows the main confirmed support trendline level.
htf resist
shows the main higher timeframe resistance trendline level.
htf support
shows the main higher timeframe support trendline level.
htf ath / atl
shows the higher timeframe extreme levels used for macro context.
validation
shows that the lines are built using structure and validation logic.
---
important notes
a trendline is not an automatic buy or sell signal.
a trendline is a decision zone.
the more clean touches a line has, the more important it becomes.
a close beyond a line is usually more important than a wick through the line.
higher timeframe lines should always be respected because they represent larger market structure.
this tool is designed to organize chart structure, but risk management remains essential.
Indicador

Hurst Regime Sentinel [JOAT]HURST REGIME SENTINEL
A proper R/S Hurst-exponent regime classifier — the single most respected statistical test for "is this market trending, mean-reverting, or random?". On top of the textbook R/S analysis, the Sentinel adds a five-class regime taxonomy (Strong MR, MR, Random, Trend, Strong Trend), a confirmation-bars filter to suppress flicker, a right-side floating Hurst badge, a regime-tinted background, and — uniquely — a Suggested JOAT Indicator dashboard row that names the best-fit companion script in the JOAT suite for the current regime.
The Hurst exponent, properly
The Hurst exponent H is a number between 0 and 1 that characterises the long-run persistence of a time series:
H < 0.5 — anti-persistent / mean-reverting. The series tends to reverse its recent direction.
H = 0.5 — random walk (Brownian motion). No memory.
H > 0.5 — persistent / trending. The series tends to continue its recent direction.
The classical estimator is R/S analysis (rescaled range): split the window into sub-segments, compute the range of cumulative deviations from each sub-mean, normalise by the sub-stdev, average, and fit a log-log slope. This script implements that estimator over a configurable lookback (default 100, the canonical value), with optional log-return source for theoretical correctness, and an EMA smoother on top of the raw H series to give a stable regime read.
Five-class regime taxonomy
The Sentinel does not just classify into trend/MR/random — it sub-classifies the trend and MR sides:
Strong MR — H below the strong-MR boundary (default 0.30). Severely anti-persistent. Aggressive reversion regime.
MR — H between strong-MR and the MR upper (default 0.40). Mean-reverting.
Random — H between MR upper and trend lower (default 0.55). No statistical edge from persistence assumptions.
Trend — H above trend lower. Trending.
Strong Trend — H above the strong-trend boundary (default 0.65). Strongly persistent. Aggressive momentum regime.
A Minimum-bars-to-confirm filter (default 3 bars) suppresses regime flicker; a change must persist this many bars before it is committed.
Suggested JOAT Indicator row (unique)
The dashboard exposes a Suggested Indicator row that names the best-fit companion script from the JOAT suite for the current regime. The user can pick which suggestions appear (defaults: Volatility Reversion Bands Pro for MR, Quantum Trend Matrix for Trend, Liquidity Magnet Pro for Random — but every other JOAT indicator is selectable). This converts the abstract regime read into a concrete next action: when the regime changes, the script tells you which other tool in the suite to put on the chart.
Visual system
Right-side floating label — anchored N bars to the right of the latest bar with current H value, regime, and sub-class.
Regime-change labels — drawn at the bar where a confirmed regime change occurs.
Background tint by regime — violet for MR, teal for Trend, untinted for Random. Strong sub-classes use a stronger (lower-transparency) alpha than mild sub-classes. Both alphas are configurable.
Optional Hurst line companion — when enabled, plots the H series scaled to a configurable fraction of the visible price range. Use to visually track H movement over time. Off by default for a clean chart.
Optional reference levels at 0.40 / 0.50 / 0.55 when the line is shown.
A locked Mystic palette (teal trend / violet MR / white random on a midnight-blue ground) gives the chart a distinctive structural identity.
Dashboard
Monospaced table positionable to any of nine corners. Surfaces:
Current H value (raw and smoothed).
Regime classification with glyph.
Sub-class (Strong MR / MR / Random / Trend / Strong Trend).
Bars in current regime.
Distance from H to nearest threshold.
Suggested JOAT Indicator row (toggleable).
Source series in use (Close / HL2 / HLC3 / OHLC4 / Log Returns).
Alerts
Multiple alert conditions, each independently controllable:
Regime changed to MR / Random / Trend
Sub-class changed to Strong MR / Strong Trend
H crosses 0.50 (random-walk centre)
How to read it
Three reads, in order of conviction:
Sub-class entry (Strong MR or Strong Trend) — the highest-conviction read. The market has decisively committed to a persistence regime; the suggested companion indicator becomes high-conviction.
Regime change confirmed (after the minimum-bars filter) — meaningful enough to switch toolkits. If you were trading momentum and the script now reads MR, your edge has just rotated.
H crossing 0.50 — the structural fault line. Above, persistence is positive; below, it is negative. Even without a sub-class entry, a clean cross of 0.50 is a regime warning.
Suggested settings
Defaults (lookback 100, EMA smoothing 14, MR upper 0.40, trend lower 0.55, strong boundaries 0.30 / 0.65) are tuned for daily and 4H charts on liquid markets — the timeframes where R/S analysis is statistically most meaningful. For 1H and below the indicator works but the H estimate becomes noisier; raise the EMA smoother to compensate. For very long horizons (1W+) increase lookback to 200.
Originality / what's reused
The R/S Hurst estimator is the textbook 1951 method — public-domain statistics, implemented from the original Hurst paper. The implementation here — the bounded-loop R/S computation with sub-segment averaging, the five-class regime taxonomy with strong sub-classes, the confirmation-bars regime-change filter, the regime-driven background tint with mild/strong alpha tiers, the optional scaled Hurst-line overlay, the right-side floating badge, and the suggested-JOAT-indicator dashboard row — is JOAT-original. No third-party code reused.
Open source
Published open-source under the default Mozilla Public License 2.0. The R/S loop, the regime classifier, the suggested-indicator router, and the dashboard are isolated modules. Forks welcome with credit.
Limitations
Hurst R/S is statistical — it describes the recent past, it does not predict the future. The estimator carries the natural noise of finite-sample R/S; the EMA smoother is there to suppress flicker but cannot eliminate underlying noise on short lookbacks. The "Suggested JOAT Indicator" row is a heuristic mapping from regime to tool, not a prediction that any specific signal from that tool will fire — it tells you which corner of the toolkit to look at; the tool itself tells you when to act.
—
-made with passion by jackofalltrades
Indicador

Indicador

Multi-TimeFrame Multi-Indicator Dashboard🚀 Multi-Timeframe Multi-Indicator Market Structure Dashboard
🟢 Overview
The **Multi-Timeframe Multi-Indicator Dashboard** is an all-in-one market scanner designed to give traders an immediate, high-level view of an asset's trend across multiple layers of time. Instead of constantly flipping between charts or cluttering your workspace with dozens of indicators, this script compiles key moving averages, momentum oscillators, and volatility indicators into a single, highly readable table directly on your primary workspace.
This tool is optimized for **Equities, Forex, Crypto, Indices, and Commodities traders** who rely on multi-timeframe confluence to confirm high-probability trade setups and eliminate analysis paralysis.
---
🛠️ Key Features
**Multi-Timeframe Confluence Matrix:** Instantly track market structure across 6 default timeframes: **5M, 15M, 1H, Daily, Weekly, and Monthly**.
**8 Integrated Technical Metrics:**
**Trend Identification:** SMA 9, SMA 20, SMA 50, SMA 100, and SMA 200.
**Momentum & Volatility:** Relative Strength Index (RSI 50-line crossover), MACD Histogram (bullish/bearish momentum shifts), and SuperTrend.
**Fully Customizable Layout:** Toggle specific timeframes or indicators on/off via the user inputs menu to perfectly match your trading style. You can also change the table position (e.g., top-right, bottom-left) and text size.
**Smart Alert Engine:** Configure the script to send real-time alerts the exact moment an indicator shifts states (Bullish $\leftrightarrow$ Bearish) on your primary timeframes.
---
🎛️ Settings & Customization
1. **Dashboard Display:** Control the visibility, positioning anchor (top-right, bottom-right, top-left, bottom-left, middle-right, middle-left), and text scaling of the canvas table.
2. **Timeframes to Display:** Toggle individual columns to focus strictly on scalping or macro swing horizons.
3. **Indicators to Display:** Strip out unnecessary lines to match your personal strategy components.
4. **SuperTrend Settings:** Manually adjust the ATR Length and Multiplier inputs for tighter or wider trend bands.
---
📝 Disclaimer
This indicator is built purely for analytical visualization and informational purposes. It does not constitute financial advice. Always practice strict risk management and combine dashboard confirmation with your own broader trading plan. Indicador

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.
Indicador

Volatility Regime Compass [JOAT]Volatility Regime Compass
Introduction
Volatility Regime Compass is an open-source volatility state classifier that continuously measures where current ATR stands relative to its own historical distribution and maps it to one of four named regimes: Compressed, Normal, Elevated, and Extreme. The classification is not binary (high or low) — it uses a rolling percentile ranking against configurable lookback windows so the regime reflects where current volatility stands within its recent history, not against a fixed absolute threshold that becomes stale as market conditions evolve.
The practical value is in strategy switching: mean-reversion techniques tend to work in compressed regimes, breakout and momentum techniques in elevated ones. Knowing which regime is active before selecting a technique reduces category errors that produce losses.
Core Concepts
1. ATR Percentile Ranking
Rather than comparing ATR to a static multiplier, the indicator ranks the current ATR value within a rolling distribution of historical ATR values. This produces a percentile score from 0 to 100 that is self-normalizing across different instruments and timeframes:
float atrHi = ta.highest(atrVal, i_rankLen)
float atrLo = ta.lowest (atrVal, i_rankLen)
float atrPct = (atrHi - atrLo) > 0 ?
(atrVal - atrLo) / (atrHi - atrLo) * 100.0 : 50.0
A reading of 80 means current ATR is in the 80th percentile of its recent range — clearly elevated. A reading of 15 means ATR is near multi-period lows — compressed.
2. Four-State Regime Classification
The percentile score maps to four regimes with configurable boundary thresholds. Defaults are: Compressed (below 25th percentile), Normal (25th to 60th), Elevated (60th to 85th), Extreme (above 85th). Crossing a regime boundary triggers a transition event labeled on the chart.
3. Multi-Band Visualization
Five ATR bands project above and below close at configurable multiples (0.5×, 1×, 1.5×, 2×, 2.5× ATR). Each band is color-coded by regime — tighter bands in compressed regimes shade cooler, wider bands in extreme regimes shade hotter using a 5-stop gradient. This gives instant visual calibration of price's relationship to current volatility structure.
4. Volatility Trend
The rate of change of ATR is computed and smoothed. Positive volatility trend (ATR rising) is labeled differently from negative trend (ATR contracting). This distinguishes a currently-elevated but contracting regime from one that is expanding — the former is more likely to produce consolidation, the latter continuation.
Features
ATR percentile ranking: Self-normalizing volatility score relative to recent history
Four volatility regimes: Compressed, Normal, Elevated, Extreme with configurable boundaries
Regime transition labels: On-chart labels at every regime change event
Five ATR expansion bands: Projected above and below close, gradient-colored by regime
Volatility trend direction: Rising vs contracting ATR tracked independently of level
Candle coloring: Candles reflect current volatility regime in real time
Regime background shading: Chart background tint corresponds to current regime
Dashboard: Current ATR, percentile, regime, trend direction, and band levels
Input Parameters
ATR Settings:
ATR Period: ATR calculation length (default: 14)
Percentile Lookback: Rolling window for ATR percentile ranking (default: 100)
Regime Thresholds:
Compressed Below: Percentile below which regime is Compressed (default: 25)
Elevated Above: Percentile above which regime is Elevated (default: 60)
Extreme Above: Percentile above which regime is Extreme (default: 85)
How to Use This Indicator
Step 1: Check the Current Regime
Read the REGIME row in the dashboard. This tells you whether to expect range-bound or trending behavior in the near term.
Step 2: Watch for Regime Transitions
A transition from Compressed to Elevated is the setup for breakout strategies. A transition from Extreme back toward Normal may signal trend exhaustion.
Step 3: Use Bands as Structural Reference
The ATR bands define statistically reasonable price excursion limits for the current volatility state. Closes beyond the 2× or 2.5× band while in a Compressed regime are structurally significant events.
Step 4: Combine with Directional Indicators
This indicator classifies volatility magnitude, not direction. Pair it with a trend or momentum tool to apply regime context to directional decisions.
Indicator Limitations
Percentile ranking depends on lookback length; very short lookbacks can produce unstable regime classifications during sudden volatility spikes
The four-state classification is a simplification; volatility is continuous and regime boundaries are heuristic
Volatility expansion does not indicate direction — it only measures magnitude of movement
Originality Statement
The combination of a self-normalizing ATR percentile ranking, a four-state regime classifier with configurable percentile boundaries, gradient-coded multi-band projection, and a simultaneous volatility trend tracker in a single Pine Script v6 publication constitutes the original contribution. Standard ATR indicators display the raw value or a fixed-multiple band without regime classification or percentile normalization.
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice. Volatility regime classifications are statistical summaries of historical data and do not predict future price movement. Trading involves substantial risk of loss.
-Made with passion by jackofalltrades
Indicador

Kalman Trend Filter [JOAT]Kalman Trend Filter
Introduction
Kalman Trend Filter is an open-source trend detection indicator that applies a two-state Kalman filter to price, tracking both the filtered price level and its velocity simultaneously. Unlike exponential moving averages — which apply a fixed exponential decay to past data — the Kalman filter dynamically adjusts its responsiveness based on the ratio of process noise to measurement noise. When price is moving consistently in one direction, the filter trusts new measurements more heavily. When price is noisy, it trusts its own model more heavily.
The practical result is a trend line that responds faster than an equivalent EMA during genuine trends while remaining smoother during chop. The velocity state is the direct indicator of trend direction and strength — it is what drives signal generation and candle coloring.
Core Concepts
1. Two-State Kalman Filter
The filter tracks two quantities: price (position state) and the rate at which price is changing (velocity state). The prediction step projects both states forward using simple kinematic equations. The correction step updates them based on how much the current close deviates from prediction:
// Prediction
float xPred = xEst + vEst
float pPred = pEst + qNoise
// Kalman gain
float kGain = pPred / (pPred + rNoise)
// Correction
float xEst = xPred + kGain * (close - xPred)
float vEst = vEst + kGain * (close - xPred)
The process noise (qNoise) and measurement noise (rNoise) parameters control how much the filter trusts its own momentum model versus new price data.
2. Velocity as Trend Proxy
The velocity state is the most analytically useful output. Positive velocity means the filtered price is accelerating upward; negative means downward. The magnitude of velocity indicates trend strength. Velocity crossing zero is a higher-quality trend reversal signal than a moving average crossover because it reflects the momentum of the filtered series, not the level.
3. Gradient Candle Coloring
Candles are painted using a two-sided gradient driven by the velocity state. Strongly positive velocity produces bright cyan candles; strongly negative produces bright magenta. Near-zero velocity transitions to neutral. The gradient intensity scales with velocity magnitude rather than applying a binary color switch.
4. Velocity Oscillator
The velocity state is plotted as a separate sub-indicator below the main chart, providing a visual oscillator that crosses zero at trend reversals. Unlike momentum oscillators derived from price differences, this oscillator represents the Kalman filter's internal estimate of trend rate — it is inherently smooth without additional EMA smoothing.
Features
Two-state Kalman filter: Tracks price level and velocity simultaneously
Configurable noise parameters: Process and measurement noise control filter responsiveness
Filtered price line overlay: Smooth trend line drawn on the price chart
Velocity oscillator: Kalman velocity state as a zero-line oscillator
Velocity zero-cross signals: Bull and bear signals when velocity crosses zero
Gradient candle coloring: Cyan for upward velocity, magenta for downward, scaled by magnitude
Dashboard: Current filtered price, velocity, trend state, and noise parameters
Alerts: Velocity zero-cross and extreme velocity alerts
Input Parameters
Kalman Engine:
Process Noise (Q): How much the filter trusts its own velocity model (default: 0.01)
Measurement Noise (R): How much the filter trusts new price measurements (default: 1.0)
Initial Velocity: Starting velocity state (default: 0.0)
Display:
Show Filter Line toggle
Show Velocity Oscillator toggle
Show Candle Color toggle
How to Use This Indicator
Step 1: Read Velocity Direction
Positive velocity (oscillator above zero, cyan candles) indicates the filter is trending upward. Negative velocity (below zero, magenta candles) indicates downward trend. The magnitude tells you how strong.
Step 2: Use Velocity Zero-Cross as Trend Change Signal
When velocity crosses from negative to positive, the filter's internal momentum model has flipped bullish. This is more reliable than a price crossover because it reflects the rate of change of the filtered series.
Step 3: Tune Noise Parameters to Timeframe
On faster timeframes, increase Q slightly (0.02–0.05) to make the filter more responsive. On weekly charts, reduce Q (0.001–0.005) for a smoother, slower-adjusting filter.
Step 4: Combine with Regime Context
The Kalman filter performs best in trending regimes. Combine with Fractal Dimension Oscillator: when FDO shows a trending regime, Kalman velocity direction provides the trend bias.
Indicator Limitations
The Kalman filter assumes a linear motion model; non-linear price dynamics (sudden gaps, news events) produce temporary distortion in the filter state
Optimal Q and R values are instrument and timeframe dependent; no universal setting works everywhere
Velocity zero-crosses during low-volatility consolidation can produce frequent false signals
Originality Statement
The two-state Kalman filter implementation combined with a velocity-driven gradient candle coloring system, a dedicated velocity oscillator, and dual-input noise parameter configuration in a single publication is the original contribution here. Most published Kalman filter scripts on TradingView implement a single-state position filter with no velocity tracking and no gradient visualization.
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice. Kalman filter outputs are mathematical estimates based on prior observations and do not predict future price. Trading involves substantial risk of loss.
-Made with passion by jackofalltrades
Indicador

Entropic Structure Bands [JOAT]Entropic Structure Bands
Introduction
Entropic Structure Bands is an open-source overlay indicator that dynamically selects the best-fitting Ordinary Least Squares regression window from recent structural pivots and surrounds that regression channel with entropy-adjusted deviation bands. The key innovation over standard regression channel indicators is twofold: the window length is selected optimally each bar by searching through available pivot anchors for the highest R² × log(N) quality score, and the band width is modulated by the current Shannon entropy of log returns — widening during chaotic periods and tightening during orderly ones.
Core Concepts
1. Optimal Regression Window Search
Rather than using a fixed lookback, the indicator records the bar index of every confirmed pivot high and low. Each bar, it tests several candidate windows anchored at recent pivots and selects the one that maximizes a performance score: R² multiplied by the natural log of the window length. This rewards both fit quality and window depth simultaneously:
float score = r2 * math.log(float(N))
// highest score wins; window updates every bar
if trial.perfScore > bestScore
bestScore := trial.perfScore
bestMdl := trial
The regression channel therefore adapts to where significant price structure has occurred, not to an arbitrary fixed period.
2. Shannon Entropy Modulation
Shannon entropy of the log return distribution is computed using a histogram-binning approach. Low entropy means returns are concentrated — price is moving in an organized, directional way. High entropy means returns are evenly distributed — chaotic, noisy conditions. Band width scales with entropy:
float entAdjDev = bestMdl.stdErr * (1.0 + entNorm * 0.8)
When entropy is low (below the configurable threshold), the market is classified as orderly and signals are enabled. This prevents signals from firing into chaotic conditions where regression bands have less predictive value.
3. Trend-Confluence Signal Logic
Signals require simultaneous alignment of six conditions: regression slope direction, price position relative to midline, recent pullback to the inner band, momentum confirmation, optional HTF slope alignment, optional ADX trending gate, and optional RSI gate. Each condition is individually toggleable. This multi-factor gate replaces simple band-crossover logic with a structured confluence requirement.
4. Forward Projection
The regression channel extends forward by a configurable number of bars beyond the right edge of the chart. A projection target label marks the estimated price at the end of the projection window based on the current slope and intercept. This gives visual context for where the regression model expects price to be if the current trend continues.
5. Z-Score Candle Coloring
Each candle's position within the channel is expressed as a Z-score (standard deviations from the regression midline). Candles far above the midline (overbought extension) are tinted bear-color; candles far below (oversold extension) are tinted bull-color. This provides immediate visual context for where price stands within its current regression structure.
Features
Dynamic regression window: Optimal window selected each bar from pivot anchor scan
R² quality gate: Configurable minimum R² prevents low-fit windows from being used
Entropy-adjusted bands: Band width scales with Shannon entropy of log returns
Multi-factor signal gate: Six independently configurable confluence conditions
Forward projection: Channel extended beyond right edge with target label
Z-score candle coloring: Candles painted by standard deviation position in channel
Inner and outer bands (±1σ, ±2σ): Gradient-filled channel layers
Glow-effect midline: Double-drawn center line with transparency for depth
10-row dashboard: R², entropy, Z-score, duration, HTF alignment, ADX, RSI, signal state
JSON webhook alerts: Alert messages formatted as JSON with EP, TP, SL, and R²
Input Parameters
Regression Engine:
Pivot Scan Horizon: Number of pivots to evaluate as regression anchors (default: 20)
Pivot Sensitivity: Left/right bars for pivot confirmation (default: 5)
Min R² Quality Gate: Minimum fit quality to use a window (default: 0.50)
Band Multiplier 1/2: Inner and outer band standard deviation multiples (default: 1.0, 2.0)
Entropy System:
Entropy Lookback: Bars for entropy calculation (default: 20)
Entropy Bins: Histogram bins for return distribution (default: 10)
Low Entropy Threshold: Threshold below which market is classified as orderly (default: 2.5)
How to Use This Indicator
Step 1: Read the Slope Bias
Check the dashboard's Slope Bias row. BULLISH or BEARISH indicates the current regression direction. This is the primary directional input.
Step 2: Check Entropy State
LOW (orderly) entropy is the condition under which signals are most reliable. HIGH entropy warns that the regression model is operating in a chaotic environment.
Step 3: Wait for Signal Labels
LONG and SHORT labels appear only when the full confluence gate is satisfied. Each label shows entry price, TP1, TP2, stop loss, and R² quality.
Indicator Limitations
Regression channels repaint historically when the optimal window shifts to a new anchor; use the confirmed-bar signals for non-repainting entry logic
In markets with very few pivots, the scan horizon may find suboptimal windows with low R²
Shannon entropy requires sufficient lookback to produce stable estimates
Originality Statement
The dynamic pivot-anchored regression window search using R² × log(N) scoring, combined with Shannon entropy-modulated band width and a six-condition confluence signal gate, is the original analytical architecture of this publication. No existing published Pine Script regression channel indicator implements adaptive window selection from pivot anchors with entropy modulation in this manner.
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice. Regression channels are mathematical models of past price behavior and do not predict future price. Trading involves substantial risk of loss.
-Made with passion by jackofalltrades
Indicador

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 Indicador

Indicador

Tectonic Regime Protocol [JOAT]Tectonic Regime Protocol
Introduction
Tectonic Regime Protocol is an open-source Pine Script v6 strategy that combines four analytical modules into a single rule-based trading system: a four-state regime classifier, a three-layer trend filter, a six-pillar confluence entry engine, and an adaptive exit module using ATR-based partial take-profit and a regime-adaptive trailing stop.
The strategy is designed for traders who want a fully automated systematic framework to study how regime-gating affects signal quality. Its primary hypothesis is that directional entries made when (1) the market is classified as a trending regime, (2) trend filters across multiple timeframes align, and (3) multiple structural, volume, and momentum inputs agree, produce statistically better outcomes than entries based on any single condition alone.
Strategy Default Properties
Initial capital: $100,000
Order size: 2% of equity per trade
Commission: 0.04% per side
Slippage: 2 ticks
Maximum open positions: 1
These settings represent realistic conditions for a funded discretionary trader using a liquid futures or equity instrument. The 2% equity sizing limits maximum theoretical drawdown from any single trade while providing meaningful position exposure. Commission and slippage values reflect typical institutional-grade execution costs for electronically traded instruments.
Core Concepts
1. Four-State Regime Classifier
The regime module classifies each bar into one of four states using ADX relative to a threshold and the ATR-to-SMA(ATR) ratio: Trend Bull, Trend Bear, Range High-Vol, Range Low-Vol. Only Trend states are eligible for entry. Range classifications suppress all entries regardless of how strong the confluence score is. This is the primary market context filter.
2. Three-Layer Trend Filter
Three independently computed trend conditions must all agree before a long or short entry is considered: close versus VWMA(200) determines whether price is above or below long-term value; the relationship between fast and slow HMA lines determines medium-term momentum direction; and the close versus a 50-period EMA on a higher timeframe provides multi-timeframe context.
3. Six-Pillar Confluence Score
The entry engine scores six market dimensions and requires the composite bull or bear score to exceed 50 of 100 (default, configurable) with a directional lead of at least 8 points above the opposing score. The six pillars are: market structure, OBV slope direction, KAMA position + RSI + WPR composite, swing-low liquidity sweep detection, ATR ratio in productive range, and Fractal Efficiency Ratio above 0.30.
bool longSetup = validRegime and regime == 1 and trendBull
and bull >= confThreshold and (bull - bear) >= confGap
and barstate.isconfirmed
4. Adaptive Exit Module
The exit logic uses partial exits at two take-profit levels. TP1 closes 50% of the position at 1.0× risk distance. TP2 closes the remaining position at 2.0× risk distance. After TP1 is reached, the stop is moved to the entry price (breakeven). The stop before TP1 uses a regime-adaptive ATR trail — the stop multiplier is lower in low-volatility regimes (tighter) and higher in high-volatility regimes (looser). A 30-bar time-based exit closes any remaining position if neither TP nor stop is reached.
5. Non-Repainting Architecture
All entry conditions are evaluated only when barstate.isconfirmed is true. The HTF EMA is requested with lookahead=barmerge.lookahead_off. Pivot-based conditions use confirmed pivot detection with symmetric lookback. No future bar references are used.
Default Settings and Performance Notes
The strategy is published with the default Properties values listed above. Results shown on the publication chart are generated using these exact settings. Commission of 0.04% per side is representative of typical electronic execution on liquid instruments.
Win rate alone does not characterize strategy performance. The strategy is designed around a two-tier partial exit structure targeting positive expectancy (wins × average win greater than losses × average loss) rather than high win rate. The profit factor and average R-multiple are the more relevant metrics for this type of system.
Input Parameters
Regime Module:
ADX Trend Threshold (default: 20)
ATR Ratio High-Vol Threshold (default: 1.2)
Trend Filter:
VWMA Length (default: 200)
Ribbon Fast HMA and Slow HMA lengths
HTF Timeframe for EMA(50) filter (default: 240)
Enable HTF Filter toggle
Confluence Engine:
Min Score (default: 50, range 50–95)
Min Direction Lead (default: 8)
Min FER (default: 0.30)
FER Lookback (default: 14)
Individual pillar weights (Structure, Volume, Momentum, Liquidity, Volatility, FER)
Exit Module:
TP1 RR Multiple (default: 1.0)
TP2 RR Multiple (default: 2.0)
Stop Multiplier for Low / Med / High Volatility Regimes
Max Bars Hold (default: 30)
How to Evaluate This Strategy
Apply it to a liquid instrument with sufficient historical data to generate more than 100 trades. Compare profit factor, Sharpe ratio, average R-multiple, and maximum drawdown — not win rate in isolation. Test it across at least two different instruments or timeframes to assess whether the results reflect genuine structural edge or data-fitting to one specific market.
The strategy is not optimized for any single market. Default parameters are deliberately conservative to avoid overfitting. Users who adjust parameters to improve backtested results should recognize that improvement on historical data does not guarantee improvement on future data.
Strategy Limitations
On lower-timeframe charts with short histories, fewer than 100 trades may result, reducing the statistical reliability of the backtest
The HTF filter uses request.security() with a higher timeframe EMA. In live trading, the HTF value updates when the higher timeframe bar closes, which may differ slightly from live server-side execution
ATR-based stops and targets mean position sizes and outcomes scale with volatility. In abnormally low-volatility environments, commission costs represent a larger proportion of expected gain
The time-based exit at 30 bars may close profitable positions before TP2 is reached in slow-moving markets
Backtested performance on any instrument does not predict future performance. Markets change, and parameters that produced edge historically may not do so in future regimes
Originality Statement
Combining a four-state regime classifier, a three-layer multi-timeframe trend filter, a six-pillar confluence score including Fractal Efficiency Ratio, and a partial-exit adaptive trailing stop system in a single non-repainting open-source strategy is an original integration of methods
The Fractal Efficiency Ratio as a pillar in a multi-factor entry score, and as a required gate condition for entry, is not present in existing open-source Pine Script v6 strategy publications as of this writing
The regime-adaptive stop multiplier — loosening in high-volatility regimes and tightening in low-volatility regimes — is an original stop calibration approach within this strategic framework
The dual entry mode (edge transition OR re-entry when flat with elevated score) increases signal frequency without compromising the fundamental regime and trend filter requirements
Disclaimer
This strategy is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Backtested results are simulated and do not represent real trading. Simulated results have inherent limitations and may not reflect actual trading outcomes due to market impact, execution differences, and changing market conditions. Past backtested performance does not guarantee future results. Trading involves substantial risk of loss. Always conduct independent due diligence and apply proper risk management before using any strategy with real capital. The author accepts no responsibility for trading losses resulting from use of this strategy.
Made with passion by jackofalltrades
Estrategia

Indicador

Indicador

No-Repaint Entry Score Multi-Factor Confluence [LunqFX]No-Repaint Entry Score — Multi-Factor Confluence
Most indicators tell you a signal exists. This one tells you how strong
it is, why it fired, and how long it has been holding — on every bar,
across every market.
One number: 0–100. Five factors. Zero repainting.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ HOW TO USE IT — 4 STEPS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
STEP 1 — CHECK HTF TREND
Look at the SIGNAL section of the panel.
HTF Trend shows ▲ BULL or ▼ BEAR based on a confirmed higher
timeframe EMA. Only take setups in this direction.
Counter-trend setups are automatically penalised by the score.
STEP 2 — WAIT FOR THE ENTRY WINDOW
When score reaches your Signal Threshold (default 75), the panel
shows "✓ ENTRY WINDOW" and a green Entry Zone box appears on the chart.
Do not enter below this threshold — conditions are not aligned.
STEP 3 — CHECK THE CAUTION ROW
The panel always shows your weakest component.
Caution: Momentum ↓ → wait for a strong candle close
Caution: Session ↓ → wait for market session to open
Caution: Structure ↓ → you may be entering against the trend
Fix the caution before entering.
STEP 4 — LOOK FOR PRIME AND PERSISTENCE
PRIME label (score ≥80) = all 5 factors aligned. Best entries.
◆ SUSTAINED (3+ bars) → candles turn cyan. High conviction.
◆◆ ELITE (6+ bars) → candles turn gold. Exceptional setup.
The longer the streak holds, the stronger the setup.
STOP LOSS — place below/above the Entry Zone outer band (±0.55 ATR).
TAKE PROFIT — next confirmed swing level or session high/low.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ SCORE TIERS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
◆◆ ELITE PRIME ≥80, held 6+ bars — exceptional, rare
◆ SUSTAINED ≥80, held 3+ bars — high conviction
PRIME ≥80, first bar — valid entry signal
GOOD 65–79 — quality setup, consider entry
MODERATE 40–64 — mixed signals, wait
WEAK <40 — avoid, confluence collapsed
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ READING THE DASHBOARD PANEL
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ENTRY SCORE — composite score 0–100. Header color shifts with tier:
green (PRIME) → cyan (SUSTAINED) → gold (ELITE) → red (WEAK)
Progress bar — 8-block visual bar. Updates every tick.
Score ▲▼— — arrow shows if score is building (▲) or fading (▼).
Useful for timing: enter when score is rising, not when it peaks.
Tier row — current tier label. Upgrades automatically to
◆ SUSTAINED PRIME or ◆◆ ELITE PRIME when streak activates.
COMPONENTS — individual 0–100 scores:
Structure = HTF EMA alignment × candle direction
Proximity = distance from nearest swing pivot level
Session = trading session quality by hour
Momentum = candle body strength (body ÷ total range)
Volatility = ATR vs 50-bar average (filters dead and spiking markets)
HTF Trend — higher timeframe direction. Confirmed bar only, no drift.
Caution — your weakest component. One actionable reason to wait.
Entry — ENTRY WINDOW or WAIT based on your Signal Threshold setting.
Persistence — consecutive PRIME bar counter.
— = no active streak 3 bars = SUSTAINED 6 bars = ELITE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ RECOMMENDED TIMEFRAMES AND MARKETS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Best timeframes: 1H · 4H · Daily
Works on: 5M · 15M · 30M (more signals, lower quality per signal)
Avoid: below 5M
Forex (EURUSD GBPUSD USDJPY) → NY or London session mode
Gold (XAUUSD) → NY session, 1H or 4H
Crypto (BTCUSD ETHUSD) → Crypto 24/7 mode
Indices (SPX NAS DAX) → NY session
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ WEIGHT PRESETS FOR DIFFERENT TRADING STYLES
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Weights are fully adjustable. Presets to get you started:
Trend Following (default)
Structure 30 / Proximity 25 / Session 20 / Momentum 15 / Volatility 10
Scalping (5M–15M)
Structure 20 / Proximity 15 / Session 30 / Momentum 25 / Volatility 10
Swing Trading (Daily–Weekly)
Structure 35 / Proximity 30 / Session 5 / Momentum 20 / Volatility 10
Mean Reversion (range markets)
Structure 15 / Proximity 40 / Session 20 / Momentum 15 / Volatility 10
Crypto 24/7
Structure 30 / Proximity 30 / Session 5 / Momentum 20 / Volatility 15
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ ALERTS — 6 CONDITIONS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1. Prime Setup Detected — score enters ≥80
2. Good Setup Forming — score enters 65–79 from below
3. Setup Degraded — score drops from quality zone
4. Weak Setup Warning — score collapses below 40
5. Sustained PRIME (3 bars)— streak hits 3 consecutive PRIME bars
6. Elite PRIME (6 bars) — streak hits 6 consecutive PRIME bars
Set alerts to "Once per bar close" in TradingView settings.
All alerts fire on confirmed closed bars only — no false triggers.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ HOW THE SCORE IS CALCULATED
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Score = weighted average of 5 components, normalised to 100%.
Weights are user-configurable and auto-normalised — they do not
need to sum to exactly 100.
1. STRUCTURE (default 30%)
Compares candle direction to HTF EMA(20) direction.
Fully bi-directional: bearish candle in bearish HTF = same score
as bullish candle in bullish HTF.
Aligned: score = 65 + (body ratio × 35), max 100
Misaligned: score = 5 + (body ratio × 25), max 30
2. PROXIMITY (default 25%)
Measures distance from the nearest confirmed pivot high or low
using ta.pivothigh/pivotlow (5-bar lookback) in ATR units.
Score = 100 − (ATR distance × 18), clamped 0–100.
At the level = 97–100. Far from structure = 0–20.
3. SESSION (default 20%)
Hour-by-hour quality score based on New York time.
NY mode: 08:00–11:00 = 100 · 03:00–05:00 = 88 ·
11:00–13:00 = 72 · 13:00–16:00 = 60 ·
dead zones = 25
London and Tokyo modes follow their respective peak hours.
Crypto 24/7 = flat 75 (no session bias).
4. MOMENTUM (default 15%)
Candle body divided by total candle range.
Full-body candle = 100. Doji = 0.
Filters indecisive wick-heavy candles.
5. VOLATILITY (default 10%)
ATR(14) divided by its 50-bar SMA.
Sweet spot 0.7–1.6 = score 100.
Too quiet (< 0.7): score scales down.
Too explosive (> 1.6): score drops sharply.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ NO-REPAINT — HOW IT IS ACHIEVED
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Three sources of repaint addressed:
HTF EMA: request.security(..., ta.ema(close,20) , lookahead_on)
The reads the EMA of the PREVIOUS confirmed HTF bar.
Locked until the next HTF candle closes. No live-bar drift.
Labels: all signals fire only on barstate.isconfirmed.
Never drawn on an open bar.
Pivots: 5-bar right lookback on confirmed bars only.
Verify: TradingView Replay mode — bar-by-bar playback matches
published chart exactly on any historical period.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ SETTINGS REFERENCE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Higher Timeframe — blank = auto.
Auto logic: 1–5M→30M · 6–15M→1H · 16–60M→4H ·
61–240M→Daily · Daily→Weekly · Weekly→Monthly
Signal Threshold — Entry Window fires above this score. Default 75.
PRIME tier is always fixed at ≥80 regardless of this setting.
Trading Session — NY · London · Tokyo · Crypto 24/7
Component Weights — all five individually adjustable.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
█ RISK DISCLAIMER
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
This indicator is a decision-support tool, not a trading strategy.
No backtested win rate or profit factor is implied or claimed.
Past signals do not guarantee future performance.
Always use a defined stop loss and proper position sizing.
Trading involves risk of loss. Use at your own discretion. Indicador

MTF Volume Delta Bar Synchrony | Rainbow MatrixGENERAL OVERVIEW
MTF Volume Delta Bar Synchrony is a multi-timeframe volume percentile fusion oscillator that condenses five independent volume readings — one per Fibonacci-spaced timeframe — into a single weighted Master Line, surrounded by per-TF "ghost lines" that fade visually as they diverge from the consensus. When the five timeframes align, the rainbow becomes a solid band; when they spread apart, the disagreement becomes a visible density property of the indicator itself. A compact 7×9 MTF Legend Table surfaces every dimension simultaneously: per-TF volume percentile values, trend direction, divergence flags, Pulse magnitude ratio, and named State classification — with an antenna marker flagging the row whose timeframe matches your chart's native resolution.
Optional Delta Twin Bars project per-candle directional overlays directly onto the price chart via force_overlay=true, combining the oscillator pane and an order-flow approximation in a single indicator. A hybrid Black Swan zone detects volume climax (surge) and squeeze (drought) extremes — either as static 80/20 thresholds (classic) or as a dynamic Fibonacci-scaled channel that adapts to recent volatility. A classic price↔volume divergence engine detects Wyckoff-style "no demand" rallies and selling-climax bottoms on every timeframe and on the Master line.
Designed as a sibling to the MTF RSI Synchrony indicator. Apply both side-by-side for the complete momentum + volume picture: RSI shows where price sits in its momentum range; Volume Synchrony shows whether the move has institutional backing. Same visual signature, same canonical color zones, same Legend Table layout — instant cross-indicator readability.
WHAT IS THE THEORY BEHIND THIS INDICATOR
Most volume indicators on TradingView operate on a single timeframe — volume bars, OBV, CVD approximations — and report raw, unbounded volume values that vary wildly across timescales. A 5-minute volume bar of 50,000 contracts is meaningless without context: is that "high" for 5-minute bars on this asset, or "low"? Compared to what window? A trader watching a 5-minute chart cannot intuitively cross-reference whether that surge corresponds to anything notable on the 4-hour view.
This indicator solves the cross-timescale comparison problem by bounding every volume reading to a 0-100 percentile rank: the same scale, regardless of timeframe, regardless of asset. The percentile answers a single question: "where does this bar's volume sit in the distribution of recent volume on this timeframe?" — a number anyone can read at a glance.
Five percentile readings are then fused via canonical Fibonacci weights (0.15 / 0.20 / 0.25 / 0.25 / 0.15 — peak weight on the macro TF3/TF4 where institutional consolidation tends to occur) into a single weighted Master Line. The Master adapts to a self-calibrating Fibonacci channel built from its own highest/lowest values over a configurable lookback, smoothed by EMA. Channel boundaries use the brand's canonical ratios: Z-Breathing (1.50σ), Z-Alert (1.85σ anchor), Z-Exhaustion (2.75σ), Black Swan (3.85σ) — same proportions as the RSI sibling for cross-indicator consistency.
The result is a volume picture that updates in real time, accounts for five timescales simultaneously, encodes "synchrony" itself as a visible rainbow density property, and triggers as an alertable signal when extremes converge.
FEATURES
🔹 Multi-Timeframe Volume Percentile Fusion Engine
🔹 Adaptive Fibonacci Channel (Z-Breathing → Z-Alert → Z-Exhaustion → Black Swan)
🔹 Hybrid Black Swan Zones (static 80/20 or dynamic Fibonacci-scaled)
🔹 Classic Price↔Volume Divergence Detection (per-TF + Master)
🔹 MTF Legend Table (7 columns × 9 rows, multilingual)
🔹 Volume Profile Reading (Pulse magnitude + State classification — 7-tier vocabulary)
🔹 Delta Twin Bars (per-candle chart overlay with 4 display modes + live intra-bar updates)
🔹 Multilingual Interface (EN / PT / ES / RU / ZH)
🔹 Multi-Timeframe Volume Percentile Fusion Engine
What It Does
Aggregates five independent volume percentile readings — one per Fibonacci-spaced timeframe — into a single weighted Master Line. Each per-TF reading is plotted as a "ghost" line that fades by distance to the Master, so the rainbow becomes a visual representation of multi-timeframe consensus.
Method
Default timeframes are 5 / 15 / 60 / 240 / D (Trigger / Intraday / Macro 1 / Macro 2 / Base). On each timeframe, ta.percentrank(volume, length) produces a 0-100 percentile rank with lookahead=barmerge.lookahead_off for anti-repaint integrity. The five percentiles are fused via canonical Fibonacci weights (0.15 / 0.20 / 0.25 / 0.25 / 0.15 — peak weight on TF3 and TF4 where institutional volume tends to consolidate). The Master itself is then clamped to for pane containment.
Per-TF length defaults are tuned to each timeframe's natural look-back window:
◇ TF1 (5m): 30 bars = 2.5 hours
◇ TF2 (15m): 50 bars = 12.5 hours
◇ TF3 (60m): 80 bars = 3.3 days
◇ TF4 (240m): 100 bars = 16 days
◇ TF5 (D): 150 bars = ~5 months
Set any per-TF override to 0 to inherit the global default (50). One-size-fits-all 50 bars across timeframes either lags on TF1 (16 hours of stale 5-minute history) or feels too reactive on TF5; the per-TF defaults match each horizon's natural cadence.
Why It Matters
Volume distribution is regime-dependent and timeframe-dependent. A single timeframe view can miss whether a 5-minute volume surge is the leading edge of a broader institutional move (visible on TF3/TF4) or a one-off scalper spike. The fusion engine surfaces alignment and disagreement instantly.
🔹 Adaptive Fibonacci Channel
What It Does
Renders six color-coded bands around the Master Line that adapt to its own recent volatility, using the brand's canonical Fibonacci ratios.
Method
Highest/lowest of the Master over lookback_dyn bars (default 50) are smoothed by EMA (default 10) to form dyn_up and dyn_dn. Channel bands are placed at canonical Fibonacci proportions:
◇ Z-Breathing: 1.50/1.85 ≈ 0.811 of half-channel
◇ Z-Alert: anchor at 1.85σ (the channel boundary itself)
◇ Z-Exhaustion: 2.75/1.85 ≈ 1.486
◇ Black Swan: 3.85/1.85 ≈ 2.081
All six band values are mathematically clamped to before rendering, so the rainbow stays inside the visible pane in volatile regimes (no auto-scale stretching). The algorithm itself is preserved bit-exact; only the rendered values are bounded.
Why It Matters
Static thresholds (e.g., 80/20) cannot adapt to regime changes. During a low-volatility consolidation, "70" might be a meaningful surge; during a news-driven trend, "70" might be the new baseline. The Fibonacci channel calibrates the warning levels to the asset's current regime, so the alerts stay informative regardless of market state.
🔹 Hybrid Black Swan Zones
What It Does
Flags volume climax (surge) and squeeze (drought) extremes either at static 80/20 thresholds (top 20% / bottom 20% historically) or at the dynamic Fibonacci 3.85σ band, depending on the operator's preference. Each zone is rendered as a glow line that brightens proportionally as the Master approaches.
Method
By default, Dynamic Black Swan Mode is ON for this indicator (matching the volume distribution's wider range vs canonical RSI). The Black Swan high/low values become osc_up4 / osc_dn4 — the Fibonacci 3.85σ proportion of the Master's channel. Toggle the mode OFF to revert to static 80/20 (top/bottom 20% volume thresholds — classic).
The proximity glow uses the canonical f_calc_glow pattern: transparency = 95 - (1 - dist/range) × 75, where range is the half-channel width. At zero distance, transparency = 20 (solid); at full range distance, transparency = 95 (invisible).
Why It Matters
Black Swan events on volume mark institutional climax moments — news breakouts, capitulation, distribution. The dynamic mode lets the indicator self-calibrate per asset and per regime, so a "climax" on a calm Forex pair and a "climax" on a meme stock both trigger at the appropriate statistical extremes rather than at an arbitrary 80% line.
🔹 Classic Price↔Volume Divergence Detection
What It Does
Detects regular bear divergences (price makes higher high while volume percentile pivot makes lower high — Wyckoff "no demand" rally) and regular bull divergences (price makes lower low while volume percentile pivot makes higher low — selling climax / capitulation). Runs on every individual timeframe AND on the Master line directly.
Method
For each TF, f_classic_divergence_vol(length, lookback) runs inside request.security: it detects pivot highs/lows on the per-TF volume percentile via ta.pivothigh / ta.pivotlow, captures pivot values using ta.valuewhen, and compares the current pivot vs the previous pivot. Default pivot lookback is 5 bars (matches the community standard).
Master divergence runs on the chart-TF directly (no request.security), so it always reflects the current chart resolution's pivot structure. When detected, it renders a connecting line + label between the two pivots on the indicator pane (red for bear, green for bull) and triggers the alert_divergence_native alert if enabled.
Per-TF divergence surfaces in the Legend Table's "Div" column: 🔻 for bear, 🔺 for bull, — for none. Multiple timeframes showing the same divergence direction = stronger conviction signal.
Why It Matters
Divergences between price and volume have been a cornerstone of Wyckoff/Volume Spread Analysis for decades. Most TradingView divergence indicators run on a single timeframe — by detecting per-TF AND Master simultaneously, this indicator surfaces both fast warnings (TF1 divergence) and high-conviction confirmations (Master + multiple TFs aligning).
🔹 MTF Legend Table
What It Does
Compact 7×9 table positioned in a configurable chart corner. Surfaces every dimension of the analysis at a single glance: per-TF resolutions, volume percentile values, trend direction, divergence status, Pulse magnitude, named State classification, plus a Master row and a status row.
Method
The table is rendered via table.new(force_overlay=false) on the indicator pane (kept off the price chart for mobile readability). Per-TF cells use:
◇ Col 0: ● TF label (matches ghost line color) + 📡 antenna marker if this TF == chart's native resolution
◇ Col 1: TF resolution string ("5", "15", "60", "240", "D"...)
◇ Col 2: Volume percentile value (color-coded by zone via the thermal matrix)
◇ Col 3: Trend arrow ▲ rising / ▼ falling / ▬ flat (±0.5 percentile point deadzone to avoid flicker)
◇ Col 4: Div indicator 🔺 bull / 🔻 bear / — none
◇ Col 5: Pulse magnitude ratio (color-coded by intensity tier)
◇ Col 6: State name (multilingual EXTREME / HIGH / ELEVATED / NORMAL / LOW / COMPRESSED / SQUEEZE)
The Master row (row 7) merges cols 0-1 into "🌈 Master (~XhYm)" — the "~XhYm" suffix is the geometric weighted mean of the 5 TF resolutions (same weights as the Master volume fusion), giving you the "effective timeframe" the Master is reading. The status row (row 8) merges cols 0-6 and shows the MTF Divergence summary: Aligned / Strong Top / Strong Bottom / Moderate Top / Moderate Bottom — with background color matching the severity.
All header strings, status messages, and state names support 5 languages via the System Language input (English / Português / Español / Русский / 中文).
Why It Matters
The Legend Table compresses what would otherwise require 5 separate chart panels into a single ~150-pixel-wide compact widget. The antenna marker is especially useful on mobile: it tells you instantly which row is "your" timeframe, so you can scan up/down to see whether faster/slower TFs confirm or contradict.
🔹 Volume Profile Reading — Pulse Magnitude + State Classification
What It Does
Two complementary readings that answer different questions about volume — both surfaced as dedicated columns in the Legend Table.
Method — Pulse Column
Pulse is the ratio volume / SMA(volume, length) per TF. 1.0× = volume at the baseline; below = drought; above = elevated. Color-coded by intensity tier:
◇ < 0.5× → aqua (drought extreme)
◇ 0.5-0.8× → teal (below baseline)
◇ 0.8-1.3× → gray (typical)
◇ 1.3-2.0× → yellow (elevated)
◇ 2.0-3.5× → orange (high activity)
◇ 3.5-6.0× → red (surge)
◇ ≥ 6.0× → purple (climax extreme)
Pulse values cap display at "9.9x+" to avoid overflow in narrow cells.
Method — State Column
State classifies the percentile rank into 7 named tiers using a multilingual dictionary:
◇ ≥ 85 → EXTREME (purple zone — top 15% historically)
◇ 71-85 → HIGH (red — top 30%)
◇ 62-71 → ELEVATED (orange)
◇ 38-62 → NORMAL (yellow / green — middle 24%)
◇ 29-38 → LOW (teal)
◇ 15-29 → COMPRESSED (blue)
◇ ≤ 15 → SQUEEZE (aqua — bottom 15%)
Why It Matters
Pulse and State answer different questions about the same volume reading:
◇ Value (percentile column 2): "Where in the historical distribution?" — a ranking answer.
◇ Pulse (column 5): "How intense vs recent baseline?" — a magnitude answer.
◇ State (column 6): "What's the human-readable label?" — a vocabulary answer.
These three columns together tell a complete story. A bar can be at Percentile 60 (NORMAL state) with Pulse = 3.5x (red surge) — meaning: "this bar's volume isn't historically rare, but it's a massive jump versus what's been happening recently." That's a different signal than Percentile 95 / Pulse = 1.0x (EXTREME state but typical magnitude) — meaning: "this is a rare historical bar, but the magnitude is normal relative to recent activity." The columns disambiguate.
🔹 Delta Twin Bars (Chart Overlay)
What It Does
Renders per-candle directional bars on the price chart (via force_overlay=true) whose dimensions encode the selected volume score and whose color encodes buy/sell pressure approximation. Bridges the gap between this script's oscillator pane and the price action itself.
Method
For each candle, the bar size = candle_range × (score / 100) × user_multiplier. The score source is configurable (Master or any TF1-TF5; default TF1 Trigger for the most responsive read).
Four display modes:
◇ Fixed High: bar always projects above the candle high (regardless of direction)
◇ Fixed Low: bar always projects below the candle low
◇ Dynamic: buy candles get bar above high, sell candles get bar below low (intuitive directional reading)
◇ Dynamic Inverted (default): buy candles get bar BELOW low, sell candles get bar ABOVE high — an order book metaphor where buy pressure builds support and sell pressure presses resistance
Bar color follows the user-configured buy/sell colors (green / red by default — matching the OHLC tick rule: close > open = buy bias, close < open = sell bias). An optional toggle ("Use Master Line Color") overrides this with the Master zone color via the thermal matrix — giving rainbow-colored bars that match the pane oscillator.
Bar width is pixel-controlled (1-8, default 8) via line.new with the user-selected linewidth — visually independent of chart zoom, distinguishable from candle wicks at any chart density.
Two update modes:
◇ Live (default): the current bar's twin bar updates on every tick — score, direction, and color reflect real-time data. When the bar closes, the live line is "frozen" into the confirmed pool. One additional persistent line is used (zero pool overhead).
◇ Confirmed-only: twin bar appears only when the candle closes (useful for backtesting comparisons where intra-bar flicker is unwanted).
The last 500 bars are rendered (Pine v6 line pool limit) with rolling FIFO management — older candles fall out of the pool and lose their twin bar, but the most recent 500 stay live.
🚨 Honest tick-rule disclosure
The buy/sell direction encoding uses the OHLC tick rule — close > open = buy bias, close < open = sell bias. This is NOT order-flow tick-data delta. Pine Script v6 has no tick-by-tick data access in indicator scripts on the free tier. The OHLC approximation is what virtually every "delta" indicator on TradingView free uses; this script discloses it transparently rather than claiming real order flow.
For most use cases (visual confirmation, trend bias, magnitude readings) the OHLC approximation captures the essential information. Traders who need true bid/ask delta should look at paid Order Flow tools or Sierra Chart / Bookmap.
Why It Matters
The Delta Twin Bars combine two analytical layers in a single indicator: the oscillator pane (Master fusion + ghost lines + Legend Table) and the chart overlay (per-candle directional reference). Most TradingView indicators force users to choose between oscillator-only or overlay-only paradigms; this script delivers both via force_overlay=true on selectively-rendered lines, preserving full pane functionality while adding a quick visual reference directly on the price candles.
🔹 Multilingual Interface
What It Does
Translates all HUD labels, status messages, alert text, state classifications, and Legend Table headers to 5 languages: English (default), Português, Español, Русский, 中文 (Chinese). 33 multilingual keys are maintained across all 5 languages.
Method
A single language dropdown input (in the GLOBAL SETTINGS group) selects the active language. The script uses Pine v6's _l == "PT" ? ... : _l == "ES" ? ... ternary chain pattern for each translated string, evaluated once at startup. Configuration tooltips, variable names, and code comments remain in English by convention — this script is designed to be readable to developers globally.
Why It Matters
Trading is a global activity. The Rainbow Matrix product family is designed for traders worldwide; multilingual UI removes a friction point for non-English-native users without adding development overhead.
HOW TO USE
Reading the Rainbow (Pane Oscillator)
◇ Master between 30 and 70 with all 5 ghost lines solid: typical volume profile, no anomaly to flag.
◇ Master entering Z-Alert (orange / teal bands): notable volume deviation — watch for follow-through confirmation across timeframes.
◇ Master in Z-Exhaustion (red high / blue low): elevated probability of climax or drought completing.
◇ Master touches Black Swan High (purple glow): volume climax event — statistically rare top-of-distribution moment, often coincides with news catalysts, breakouts, or capitulation.
◇ Master touches Black Swan Low (aqua glow): volume drought / squeeze — extreme compression, often precedes breakouts when paired with price consolidation.
Reading the Legend Table
The antenna marker (📡) flags your chart's native timeframe. Start your read there, then scan up/down the table to see whether faster/slower TFs confirm or contradict the current volume bias. Look at the relationship between Value (where in distribution), Pulse (how intense vs baseline), and State (named tier) for each row — divergences between these three readings within a single TF are early warnings.
The status row at the bottom summarizes MTF divergence: Aligned (TFs in agreement, default), Strong Top (TF1 ≥ 70 vs TF5 ≤ 30 — fast surge with slow drought), Strong Bottom (TF1 ≤ 30 vs TF5 ≥ 70 — fast quiet with slow surge), or Moderate variants of either.
Reading the Delta Twin Bars (Chart Overlay)
Tall bars = high volume score for that candle's TF source. With Dynamic Inverted mode (default), bars projecting BELOW buy candles signal "support building"; bars projecting ABOVE sell candles signal "resistance pressing" — an order book metaphor. Switch to Dynamic mode for a more intuitive directional read (buy bars project up, sell bars hang down). Use Fixed High/Low for cleaner price action when delta-only context is needed.
Reading Divergences
Master divergence (red line + 🔻 label on the pane) = price made a higher high while Master volume percentile made a lower high — Wyckoff "no demand" rally, often precedes reversal. Master bull divergence (green + 🔺) = price made a lower low while Master volume made a higher low — selling climax, often precedes bottom.
Per-TF divergences in the Legend Table's Div column give early granular warning: a TF1 divergence might fire 5-10 candles before the Master confirms. Multiple TFs aligning on the same divergence direction = high-conviction signal.
Tactical Combinations
◇ Master Black Swan High + Strong Top divergence + Bear Master divergence simultaneously = strongest reversal signal from highs.
◇ Master Black Swan Low + Strong Bottom divergence + Bull Master divergence = strongest reversal signal from lows.
◇ Master SQUEEZE state + multiple TFs SQUEEZE state + Pulse < 0.5x = pre-breakout compression — often precedes expansion events.
◇ Pulse spikes (red / purple tier) preceding percentile shifts = often mark turning points before the percentile catches up.
◇ Pair with MTF RSI Synchrony: Aligned RSI + Aligned Volume = high-conviction setup. Bear RSI div + Bear Volume div on Master simultaneously = strongest reversal signal.
INPUTS EXPLAINED
GLOBAL SETTINGS
◇ System Language (EN / PT / ES / RU / ZH) — affects HUD and alerts only; code stays in English.
◇ Table / Labels Font Size — Tiny / Small (default) / Normal / Large.
MULTI-TIMEFRAME
◇ AI Auto-Sync TFs — when ON, auto-adjusts the 5 TFs based on chart resolution.
◇ TF1-TF5 — manual TF override (defaults: 5/15/60/240/D).
◇ Default Volume Percentile Length — global default (default 50).
◇ TF1-TF5 Length Overrides — per-TF overrides; defaults 30/50/80/100/150; set to 0 to inherit global.
ENGINE
◇ Dynamic Black Swan Mode — ON by default (Fibonacci 3.85σ adaptive). OFF = static 80/20.
◇ Dynamic Channel Lookback (default 50) and Smoothing (default 10).
◇ Divergence Pivot Lookback — default 5 (community standard).
VISUALIZATION
◇ TF1-TF5 Color + Show toggles — TF1 and TF5 visible by default; TF2/3/4 hidden (opt-in).
◇ Ghost Fade Sensitivity — default 3.5 (lines invisible at ~20 percentile points from Master).
◇ Show Master Line / Show Rainbow Fills / Show Black Swan / Show Dynamic Channel — all default ON.
◇ Show MTF Legend Table — default ON.
◇ Show Divergence Column / Pulse Column — both default ON.
◇ Show Master Divergence Chart Line — default ON.
◇ Legend Table Position — Top/Bottom × Left/Right (default Bottom Right).
◇ Show Divergence Event Markers — default OFF (reduces clutter; toggle ON to display triangles).
◇ Show Static Reference Lines — default OFF (cleaner pane on install; toggle ON for 20 / 50 / 80 guides).
ALERTS
◇ Alert on Black Swan crossings (high / low) — default ON.
◇ Alert on Strong MTF Divergence — default ON.
◇ Alert on Z-Exhaustion zone entries — default OFF (opt-in).
◇ Alert on Master Classic Divergence — default ON.
DELTA TWIN BARS
◇ Show Delta Twin Bars — default ON.
◇ Score Source — Master / TF1 (default) / TF2 / TF3 / TF4 / TF5.
◇ Display Mode — Fixed High / Fixed Low / Dynamic / Dynamic Inverted (default).
◇ Buy / Sell Colors + Transparency + Size Multiplier — fully customizable.
◇ Use Master Line Color (override) — default OFF; toggle ON for rainbow-colored bars.
◇ Bar Width (pixels) — 1-8, default 8 (bold, high-visibility).
◇ Lookback (bars) — default 500 (Pine v6 pool maximum).
◇ Live Bar (intra-bar update) — default ON; toggle OFF for confirmed-only rendering.
IMPORTANT NOTES
🔸 Pine Script v6 — uses request.security with lookahead=barmerge.lookahead_off for anti-repaint integrity. The 5 per-TF volume fetches + 5 per-TF Pulse fetches + 5 per-TF divergence fetches + 6 other security calls = 21 total request.security calls; within TradingView's free-tier limits but noteworthy if combining with other heavy multi-TF indicators on the same chart.
🔸 Repaint behavior — historical bars use confirmed close data; the current real-time bar updates as ticks arrive (especially with Live Delta Bars enabled). The pivot-based divergence detection requires div_lookback confirmed bars before triggering — so divergence labels appear on the pivot bar in retrospect, not as live signals. This is standard pivot divergence behavior across all TradingView divergence indicators.
🔸 Tick rule approximation — Delta Twin Bars use the OHLC tick rule (close > open = buy bias) as a direction encoder. This is NOT real order-flow tick data. Pine Script v6 has no tick data access in indicator scripts. Same approximation is used by virtually every "delta" indicator on the TradingView free tier; this script discloses it transparently. For real bid/ask delta, use paid order flow tools.
🔸 Pine v6 line pool limit — Delta Twin Bars are bounded to 500 lines (Pine v6 hard limit). Older candles fall out of the rolling FIFO and lose their twin bar — this is a Pine engine constraint, not a bug. The current bar's live line uses ONE persistent slot reused across bars (no additional pool consumption).
🔸 Fibonacci ratios are canonical — the channel proportions (1.50 / 1.85 / 2.75 / 3.85) match the Rainbow Matrix brand standard across all sibling indicators. They are derived from the brand's design system and are not user-configurable — preserving cross-indicator visual consistency.
🔸 Master effective TF — the "~XhYm" label in the Master row is the geometric weighted mean of the 5 TF resolutions (same weights as the Master fusion: 0.15/0.20/0.25/0.25/0.15). With defaults 5/15/60/240/D, the effective TF is approximately 71 minutes (~1h11m). This tells you the "average horizon" the Master is reading.
🔸 License: MPL 2.0 (Mozilla Public License 2.0) — open source. Free to fork, modify, and republish under the same license terms.
UNIQUENESS
Three pillars differentiate this from the dozens of volume indicators already on TradingView:
1. Multi-timeframe percentile fusion with synchrony as a visual property. Most volume tools operate on a single timeframe with raw unbounded readings. This indicator bounds every reading to a 0-100 percentile scale, fuses five timeframes via Fibonacci-proportioned weights, and expresses synchrony itself as a "rainbow density" — solid when aligned, spread-out when diverging. The disagreement between fast and slow timeframes becomes immediately readable.
2. Three complementary volume readings in one Legend Table. Value (percentile rank), Pulse (magnitude ratio), and State (named tier) answer three different questions about the same volume reading. Most indicators give you one number; this one disambiguates "rare historical event" from "extreme recent magnitude" from "elevated relative position." The combination catches signals that single-metric views miss.
3. Combined oscillator + chart overlay in a single script. Delta Twin Bars project the per-candle volume score and tick-rule direction directly onto the price chart via force_overlay=true, while the full pane oscillator (Master fusion, ghost lines, Legend Table, divergence engine, dynamic channel) continues to operate independently. Most TradingView indicators force you to choose between oscillator-only or overlay-only paradigms; this script gives you both, with honest disclosure about the OHLC tick rule approximation.
Rainbow Matrix AI | Multi-timeframe institutional analysis tools for traders.
🌐 rainbowmatrix.ai
✉️ Contact: contact@rainbowmatrix.ai Indicador

Auto TrendLine Intelligence [BOS+CHoCH+FVG] [Rehan Khanani]================================================================
AUTO TRENDLINE INTELLIGENCE
================================================================
Auto TrendLine Intelligence is a professional-grade, institutional-level technical analysis indicator built for traders who think and operate like smart money. It combines automatic trend line detection with full Smart Money Concepts — BOS, CHoCH, and FVG — into one clean, powerful overlay.
This is not just a trend line tool. It is a complete market structure analysis system that tells you what the market is doing, why it is doing it and exactly where to enter, exit, and place your stop-loss.
================================================================
HOW IT WORKS
================================================================
The indicator runs five analytical engines simultaneously on every bar:
ENGINE 1 — AUTOMATIC TREND LINE DETECTION
The indicator automatically detects the most recent swing highs and swing lows using a pivot-based algorithm, then draws two types of trend lines in real time without any manual input:
Major Trend Lines (solid): Connect significant swing highs and swing lows using the full pivot lookback length. These represent the dominant structural trend and carry the highest weight for trading decisions.
Minor Trend Lines (dashed): Connect shorter-term pivots using a reduced lookback period. These represent intraday or near-term structure and are useful for precise entry timing.
Both lines update automatically as new pivots form. No manual drawing, no redrawing, no guesswork.
ENGINE 2 — BREAK OF STRUCTURE (BOS)
A Break of Structure is a continuation signal. It occurs when price convincingly breaks above a previous swing high (bullish BOS) or below a previous swing low (bearish BOS), confirming that the current trend is likely to continue.
Bullish BOS: price closes above the last confirmed swing high — signals trend continuation to the upside.
Bearish BOS: price closes below the last confirmed swing low — signals
trend continuation to the downside.
BOS labels appear directly on the chart at the point of the break.
ENGINE 3 — CHANGE OF CHARACTER (CHoCH)
A Change of Character is a reversal signal — the first indication that the current trend may be ending and a new one beginning. It is the most important signal in Smart Money analysis.
Bullish CHoCH: in a confirmed downtrend (lower highs, lower lows), price breaks above a recent lower high for the first time — this signals a potential reversal to the upside.
Bearish CHoCH: in a confirmed uptrend (higher highs, higher lows), price breaks below a recent higher low for the first time — this signals a potential reversal to the downside.
CHoCH labels are clearly marked on the chart and distinguished from BOS.
ENGINE 4 — FAIR VALUE GAP (FVG)
Fair Value Gaps are imbalance zones left behind by aggressive institutional buying or selling. Price frequently returns to these zones to rebalance before continuing in the original direction.
Bullish FVG: a gap between the high of the candle two bars ago and the low of the current candle — shown as a teal shaded zone.
Bearish FVG: a gap between the low of the candle two bars ago and the high of the current candle — shown as a red shaded zone.
FVG boxes automatically disappear when price returns to fill the gap (mitigation), keeping the chart clean at all times.
ENGINE 5 — LIQUIDITY ZONES
Equal highs and equal lows represent areas where institutional stop orders and limit orders are clustered. The indicator detects when two recent pivot highs or lows are at approximately the same price level and marks them with a dotted yellow line — highlighting where liquidity is likely to be swept before a major move.
================================================================
ENTRY SIGNAL SYSTEM (MULTI-FILTER CONFLUENCE)
================================================================
LONG and SHORT entry signals are generated only when ALL of the following conditions align simultaneously — ensuring institutional-grade signal quality:
For a LONG signal:
1. Price touches or approaches the support trend line within ATR buffer
2. Price is above the EMA 200 (bullish market bias confirmed)
3. RSI is not in overbought territory (momentum not exhausted)
4. Volume is above the 20-period average (institutional participation)
5. Candle closes bullish (price accepts support level)
For a SHORT signal:
1. Price touches or approaches the resistance trend line within ATR buffer
2. Price is below the EMA 200 (bearish market bias confirmed)
3. RSI is not in oversold territory (momentum not exhausted)
4. Volume is above the 20-period average (institutional participation)
5. Candle closes bearish (price rejects resistance level)
This five-layer confluence model ensures you only take trades where structure, trend, momentum, and volume all agree.
================================================================
AUTOMATIC TP1 / TP2 / SL LEVELS
================================================================
Every entry signal automatically plots:
Stop Loss: placed below/above the entry using ATR multiplier (default 1.5x ATR)
Take Profit 1 (TP1): at 50% of the full RR target — for partial exits
Take Profit 2 (TP2): at full Risk:Reward ratio target (default 2:1 RR)
All three levels are drawn as dashed lines directly on the chart with
exact price labels so you never have to calculate manually.
================================================================
INSTITUTIONAL DASHBOARD — 12 DATA POINTS
================================================================
A professional real-time dashboard is displayed in the corner of your
chart showing:
1. Market Bias — BULLISH or BEARISH based on EMA 200 position
2. Market Structure — Higher Highs/Lows | Lower Highs/Lows | Consolidation
3. EMA Stack — Bullish Stack | Bearish Stack | Mixed
4. RSI Reading — Exact value + zone (Overbought / Oversold / Neutral)
5. Volume Status — High Volume | Above Average | Below Average
6. ATR Value — Current ATR for volatility awareness
7. Support TL — Projected support trend line price at current bar
8. Resistance TL — Projected resistance trend line price at current bar
9. Fair Value Gap — Bullish FVG | Bearish FVG | None
10. SMC Event — Latest BOS or CHoCH event detected
11. Signal Status — LONG ENTRY | SHORT ENTRY | WATCHING
Dashboard position is fully adjustable: Top Right, Top Left, Bottom Right, or Bottom Left.
================================================================
FULL FEATURE LIST
================================================================
Automatic Features (Zero Manual Work Required):
- Auto major trend lines from pivot highs and lows
- Auto minor trend lines from shorter-term pivots
- Auto BOS detection and labeling
- Auto CHoCH detection and labeling
- Auto FVG zone drawing and auto-removal on mitigation
- Auto liquidity zone detection (equal highs / equal lows)
- Auto TP1, TP2, SL calculation and plotting on every signal
- Auto dashboard with 11 live market readings
Filters and Controls:
- EMA 200 trend direction filter
- EMA 50 for stack analysis
- RSI momentum filter (adjustable OB/OS levels)
- Volume spike filter (adjustable multiplier)
- ATR-based signal sensitivity buffer
- All filters individually toggleable
Visual Controls:
- Major and minor trend line toggle
- Individual color pickers for all line types
- Line width control (1 to 5)
- Extend lines right toggle
- FVG transparency control
- Dashboard position selector
Alert Conditions (9 Total):
1. LONG Entry Signal
2. SHORT Entry Signal
3. Any Entry Signal
4. Bullish BOS
5. Bearish BOS
6. Bullish CHoCH
7. Bearish CHoCH
8. Bullish FVG detected
9. Bearish FVG detected
================================================================
SETTINGS GUIDE
================================================================
Group 1 — Trend Line Settings
Pivot Lookback Length: Controls how significant a swing must be to form a trend line. Default is 10. Lower values (5-7) give more frequent lines suitable for scalping. Higher values (15-20) give fewer but stronger structural lines suitable for swing and position trading.
Show Major Trend Lines: Toggle the primary solid trend lines on/off.
Show Minor Trend Lines: Toggle the secondary dashed trend lines on/off.
Extend Lines Right: Extends all lines to the right edge of the chart.
Major Line Width: Visual thickness of major trend lines (1 to 5).
Color pickers: Customize all four line types independently.
Group 2 — Smart Money Concepts
Show BOS: Toggle Break of Structure labels on/off.
Show CHoCH: Toggle Change of Character labels on/off.
Show FVG: Toggle Fair Value Gap boxes on/off.
Show Liquidity Zones: Toggle equal high/low dotted lines on/off.
FVG Transparency: Adjust how opaque or subtle the FVG boxes appear.
Group 3 — Signal and Entry Settings
ATR Length: Period for ATR calculation (default 14).
ATR Buffer Multiplier: How close price must come to the trend line to
trigger a signal. Lower = stricter, higher = more relaxed.
Stop Loss ATR Multiplier: Distance of SL from entry in ATR units.
Risk Reward Ratio: Multiplier applied to the SL distance to set TP2.
Show TP/SL on Chart: Toggle the TP1, TP2, SL lines on/off.
Group 4 — Volume and Momentum Filter
Enable Volume Filter: When on, signals only fire on above-average volume.
Volume Spike Multiplier: Threshold multiplier over 20-period volume MA.
Enable RSI Filter: When on, blocks signals in exhausted momentum zones.
RSI Length, Overbought, Oversold: Standard RSI parameters.
Group 5 — Dashboard
Show Dashboard: Toggle the entire dashboard panel on/off.
Dashboard Position: Place it in any corner of the chart.
================================================================
HOW TO USE — STEP BY STEP
================================================================
Step 1 — Check the Dashboard
Before looking at any signal, check the dashboard. Confirm Market Bias, Structure, and EMA Stack all point in the same direction. Trade only when at least two of the three agree.
Step 2 — Identify the Trend Lines
Watch where the major trend lines are relative to current price. The support line (teal/blue) and resistance line (red) define your trading range and structural boundaries.
Step 3 — Wait for SMC Confluence
Before entering on a trend line touch, check whether a CHoCH has recently occurred in your direction. A CHoCH near a trend line is one of the highest-probability setups this indicator generates.
Step 4 — Watch for FVG Zones
If a Fair Value Gap is present near the trend line, this adds further confluence. Institutional traders frequently use FVG zones as entry triggers.
Step 5 — Enter on Signal
When a LONG or SHORT label appears, all five filters have aligned. Enter at the close of the signal candle. Your TP1, TP2, and SL levels will appear automatically on the chart.
Step 6 — Manage the Trade
Consider taking partial profits at TP1 (50% of position) and letting the remainder run to TP2. Move stop loss to breakeven after TP1 is hit.
Step 7 — Set Alerts
Use the 9 built-in alert conditions to be notified of signals and SMC events without watching the chart constantly.
================================================================
RECOMMENDED TIMEFRAMES
================================================================
Scalping: 1 minute, 5 minutes (Pivot Length 5-7)
Intraday: 15 minutes, 30 minutes, 1 Hour (Pivot Length 8-10)
Swing Trading: 4 Hour, Daily (Pivot Length 10-15)
Position Trading: Weekly (Pivot Length 15-20)
The indicator automatically adapts to any timeframe. Only the Pivot Lookback Length needs to be adjusted based on your trading style.
================================================================
COMPATIBLE MARKETS
================================================================
This indicator works on all liquid markets available on TradingView:
Forex: All major, minor, and exotic currency pairs
Crypto: Bitcoin, Ethereum, and all altcoins
Commodities: Gold (XAUUSD), Silver (XAGUSD), Oil (WTI, Brent)
Indices: S&P 500, NASDAQ, Dow Jones, FTSE, DAX, Nikkei
Stocks: Any individual equity with sufficient volume
Futures: All futures contracts available on TradingView
================================================================
WHO CAN USE THIS INDICATOR
================================================================
Beginner Traders:
The dashboard and automatic signals remove the need for manual analysis. Beginners can use the LONG and SHORT labels as guided entry points while learning how the underlying concepts work.
Intermediate Traders:
Use the BOS and CHoCH labels to understand market structure shifts and combine them with trend line touches for high-confluence entries. The FVG zones add an additional layer for precise entry timing.
Advanced and Professional Traders:
Use the full system as an institutional-grade market structure scanner. Combine BOS, CHoCH, FVG, and liquidity zones with your own HTF bias for a complete multi-confluence trading framework. The volume and RSI filters can be tuned precisely to your strategy requirements.
Algorithmic and Systematic Traders:
All 9 alert conditions can be connected to TradingView webhooks for automated notification systems or strategy integration.
Portfolio Managers and Analysts:
The dashboard provides a rapid one-glance market assessment across any asset — useful for screening multiple instruments quickly.
================================================================
IMPORTANT DISCLAIMER
================================================================
Auto TrendLine Intelligence is a technical analysis tool designed to support trading decisions. It does not guarantee future results. All trading involves risk. Always apply proper risk management, use appropriate position sizing, and conduct your own due diligence before entering any trade. Past signal performance is not indicative of future results. This indicator is not financial advice. Indicador

Smart Trend Flow Pro [MarkitTick]💡 Navigating modern market structures requires a robust mechanism capable of filtering out transient noise while capturing the dominant directional vectors. The Smart Trend Flow pro is an advanced analytical framework designed to dynamically track market momentum and volatility, transforming complex price action into a highly readable, visual heatmap. By synthesizing trend identification with continuous volatility scaling, this tool aims to provide clarity in both ranging environments and high-expansion phases, allowing for more structured and disciplined market analysis.
✨ Originality and Utility
● A Paradigm Shift in Trend Visualization
Traditional channel-based indicators often suffer from severe lag or become entirely unreadable during periods of intense market contraction. The utility of this script lies in its adaptive ability to map structural boundaries and instantly correlate them with localized market energy. By discarding static thresholds in favor of a dynamic, self-adjusting baseline, the tool presents a unified view of both direction and conviction.
● Beyond Binary Signals
Standard indicators frequently rely on binary conditions—such as a simple moving average crossover—which ignore the underlying volatility context. This script pioneers a synthesized approach where the strength of a trend is continuously evaluated against its own historical variance. This allows users to visually differentiate between a low-conviction drift and a highly energized breakout, providing a much richer context for potential trade management and risk assessment.
🔬 Methodology and Concepts
● Dynamic Boundary Engine
At the core of the script is a reactive boundary detection mechanism. Rather than projecting fixed bands, the engine establishes fluid upper and lower parameters based on recent localized extremes. These boundaries can be structurally smoothed using various adaptive algorithms, effectively tuning the sensitivity of the channel to match the specific rhythm of the asset being analyzed.
● Volatility Normalization Process
To accurately gauge market energy, the framework continuously measures the distance between the established boundaries. This raw measurement is then subjected to a rigorous statistical normalization process. By evaluating current fluctuations against a rolling historical baseline, the engine maps the resulting variance onto a bounded curvilinear scale. This abstract transformation isolates the pure kinetic energy of the market, stripping away absolute price dependencies to provide a standardized metric of volatility expansion and contraction.
● Integrated State Tracking
The logical engine monitors the interaction between the closing prices and the smoothed boundary parameters. A structural shift is recognized only when price definitively breaches and sustains its position relative to these dynamic thresholds. This state-tracking ensures that the primary directional bias is maintained until a statistically significant reversal occurs, minimizing false positives during minor retracements.
🎨 Visual Guide
● Color-Coded Heatmap Candles
The primary visual feature is the complete transformation of the standard candlestick chart into a continuous heatmap. The colors directly correspond to the synchronized output of the trend direction and the normalized volatility metric.
Bullish Gradients: When the market establishes an upward bias, the candles transition through a cool-to-hot spectrum. Deep, cold colors represent low-volatility accumulation phases, while bright, hot neon colors signify intense, high-volatility bullish expansion.
Bearish Gradients: Conversely, downward structural shifts are mapped using a separate color spectrum. Dark, muted tones indicate slow, grinding bearish action, whereas vivid, hot colors highlight rapid, high-volatility sell-offs.
Neutral States: When the price resides within the core boundary parameters, demonstrating no clear directional dominance, the candles default to a flat, neutral gray to reduce visual noise.
● Signal Markers
Buy Labels: Distinct markers appear precisely below the price action when the engine confirms a definitive upward structural breach.
Sell Labels: Clear markers are printed above the price action upon the confirmation of a downward structural breach.
📖 How to Use
● Interpreting the Heatmap
The most effective way to utilize this tool is to read the candle colors as a topographical map of market energy. A transition from a neutral state into a cold bullish or bearish color suggests the early formation of a trend. As the colors heat up and transition toward their neon extremes, it confirms that the directional move is being supported by expanding volatility, which often characterizes the most robust phase of a trend.
● Managing Trend Exhaustion
Traders can monitor the intensity of the heatmap to gauge potential momentum decay. If a strong trend has been characterized by hot, neon colors, a gradual cooling off—where the colors revert to darker, colder shades—may indicate that the localized volatility is subsiding, suggesting potential consolidation or a pending structural shift.
● Confirming Breakouts
The printed Buy and Sell labels serve as structural confirmation points. These markers are best utilized not in isolation, but in confluence with the heatmap. A signal label accompanied by an immediate transition into a high-volatility color spectrum carries significantly more analytical weight than a signal that remains mired in a cold or neutral visual state.
⚙️ Inputs and Settings
● Channel Settings
Channel Length: Determines the primary lookback window for establishing the core upper and lower boundaries. Increasing this value creates a wider, slower-moving channel, while decreasing it makes the system highly sensitive to recent price action.
Channel MA Type: Allows the user to apply different smoothing algorithms to the boundaries. Options range from the standard baseline to advanced weighting methods, providing precise control over signal reactivity.
● Analytics Settings
Squeeze/Z-Score Length: Defines the historical window used to evaluate the relative volatility. A longer length provides a smoother, more macro-level volatility assessment, while a shorter length makes the heatmap highly reactive to sudden micro-expansions.
● Candle Heatmap Settings
Bullish/Bearish Color Controls: Fully customizable inputs allowing the user to define the exact hex values for the cold and hot extremes of both the bullish and bearish spectrums.
Neutral Market Base: The default color applied when the market is bound within the channel without a confirmed directional state.
● Signal Settings
Label Colors: Configurable color selections for the printed Buy and Sell confirmation markers.
🔍 Deconstruction of the Underlying Scientific and Academic Framework
● Topological Price Mapping
At a fundamental level, the script treats financial time-series data not as discrete data points, but as a continuous topological surface. By evaluating the highest and lowest ranges over a specified temporal window, it effectively creates a rolling bounding box that encapsulates the probable distribution of future price vectors. The application of sophisticated moving average algorithms to these boundaries acts as a low-pass filter, mathematically attenuating high-frequency noise and exposing the true underlying macroeconomic drift.
● Non-Linear Variance Scaling
The most complex aspect of the engine is its approach to variance. Standard deviation on its own is an unbounded metric, making it difficult to utilize in a standardized visual format. The script solves this by isolating the width of the bounding box and comparing it against its own moving average and standard deviation. This transforms the raw width into a standardized probabilistic metric.
● The Sigmoidal Activation Function
To achieve the seamless visual gradient, this standardized variance must be mapped onto a finite plane. The engine employs a logistic function—specifically, a sigmoidal activation curve—to compress the unbounded variance data strictly between a 0 and 100 scale. This non-linear mapping ensures that the visual heatmap remains highly sensitive to subtle shifts around the mean, while gracefully asymptotically compressing extreme, outlier volatility spikes, thereby maintaining absolute visual coherence regardless of the asset's inherent behavior.
⚠️ 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. Indicador
