MAD Adaptive Trend Score [BackQuant]MAD Adaptive Trend Score
Overview
MAD Adaptive Trend Score is a trend oscillator built from a Median Absolute Deviation-based price filter and a multi-lookback relative-position score.
The indicator first calculates a rolling median and MAD from the selected source. Price deviation from the median is then clipped to a configurable MAD envelope, producing the MAD Adaptive Filter.
The current value of that filtered series is then compared with a range of its previous values. Each comparison contributes either +1 or -1 to a Trend Score.
The result is a bounded directional score that can be used with separate bullish and bearish thresholds to create a persistent trend state.
The script includes:
Exact rolling median and MAD calculations.
MAD-based clipping of source movement.
Configurable multi-lookback Trend Score.
Separate long and short regime thresholds.
Optional filter overlay on the main chart.
Trend candle colouring and signals.
Reference levels and alerts.
MAD Adaptive Filter
The first stage calculates the rolling median of the selected Source over the MAD Length.
It then calculates Median Absolute Deviation:
MAD = Median(|X - Median(X)|)
Raw MAD is multiplied by 1.4826:
Scaled MAD = Raw MAD × 1.4826
with a minimum value based on the instrument's minimum tick.
The 1.4826 factor is commonly used to scale MAD to approximately the same scale as standard deviation when the underlying distribution is normal.
The indicator then measures:
Deviation = Source - Rolling Median
and defines the maximum permitted deviation as:
Maximum Deviation = Scaled MAD × MAD Multiplier
The source deviation is clipped to this range before being added back to the median.
Conceptually:
If Source remains inside the MAD envelope, the filter follows Source.
If Source moves above the envelope, the filter is limited to the upper MAD boundary.
If Source moves below the envelope, the filter is limited to the lower MAD boundary.
The MAD Adaptive Filter is therefore not a conventional moving average. It is a source series whose distance from its rolling median is limited by the current MAD-derived envelope.
MAD Multiplier
MAD Multiplier controls the permitted distance between the filtered value and the rolling median.
Lower values:
Create a tighter envelope.
Clip more of the source movement.
Keep the filter closer to the median.
Higher values:
Create a wider envelope.
Allow more source movement through unchanged.
Make the filter follow price more closely.
Trend Score
The second stage scores the current MAD Filter against several previous values of the same filtered series.
For every lookback between Score Lookback Start and End:
+1 if the current MAD Filter is above the historical MAD Filter.
-1 otherwise.
The final Trend Score is the sum of all comparisons.
If N historical values are being compared, the theoretical score range is:
-N to +N
For the default 1-to-45 range, 45 comparisons are made, so the score can range from -45 to +45.
What the score represents
A high positive score means the current MAD-filtered value is above most of the historical filtered values being compared.
A strongly negative score means it is above very few of them.
For example, with 45 comparisons:
A score near +45 means the current filtered value is above nearly the entire comparison range.
A score near 0 means the comparisons are more evenly divided.
A score near -45 means the current filtered value is below, or equal to, nearly all of them.
The score is therefore best understood as a relative position / trend score of the filtered series.
It is not a return forecast or probability of future direction.
Why use several lookbacks?
Comparing the current filter with only one previous value would effectively reduce the calculation to short-term slope.
Using many previous values instead measures where the current filtered level sits relative to a broader section of its history.
A steadily rising filtered series will generally move toward higher positive scores because the current value becomes greater than an increasing number of historical values.
During sustained weakness, the opposite occurs.
Score Lookback Start and End
These settings define which historical MAD Filter values participate in the score.
For example:
Start = 1
End = 45
compares the current filter against each filtered value from 1 through 45 bars ago.
A shorter range:
Responds more quickly to recent changes.
Creates a smaller score range.
A longer range:
Includes more historical comparisons.
Produces a broader measure of relative trend position.
Usually changes more gradually.
Because the score range depends on the number of comparisons, threshold settings should be chosen with the selected score range in mind.
Trend State
The script converts the Trend Score into a persistent bullish or bearish signal state.
The bullish and bearish rules are deliberately separate.
Bullish condition
The signal becomes bullish when:
Trend Score > Long Threshold
Once bullish, the state remains bullish until a valid bearish condition occurs.
Bearish condition
The signal becomes bearish when the score crosses downward through the Short Threshold:
Previous Score >= Short Threshold
Current Score < Short Threshold
The bearish condition therefore requires an actual downward threshold crossing rather than simply remaining below the level.
Why use separate thresholds?
Using different bullish and bearish levels introduces persistence into the regime.
The signal does not need to reverse whenever the score crosses zero.
For example, with:
Long Threshold = 40
Short Threshold = -6
the score must reach a strongly positive state before the model turns bullish, but the bullish state can persist through a substantial amount of score deterioration before a bearish transition occurs.
This creates a form of threshold hysteresis and reduces rapid switching around a single center level.
The thresholds are fully configurable and do not need to be symmetrical.
Initial state
The signal begins neutral.
A bullish state can be established once the Long Threshold condition is satisfied.
A bearish state requires a valid downward crossing of the Short Threshold.
Signal markers are shown only when an established bullish state changes to bearish or an established bearish state changes to bullish.
The initial transition from neutral does not produce a long/short marker.
Reference Lines
The optional dashed reference lines display the Long and Short Thresholds directly in the oscillator pane.
These levels correspond to the actual regime settings and can be useful when visually tracking how the Trend Score approaches a possible state change.
MAD Filter Overlay
The MAD Adaptive Filter can optionally be plotted directly on the main price chart.
This makes it possible to compare:
Raw price.
The rolling-median/MAD envelope response.
The active trend colour.
The overlay uses the same bullish or bearish state colour as the oscillator.
Trend Candles
Optional chart candles are coloured from the stored trend state:
Bullish state = Long Color.
Bearish state = Short Color.
The colour represents the indicator's trend regime rather than the direction of each individual candle.
Background Colour
An optional transparent background can also display the current trend regime on the main chart.
This is purely visual and does not alter the calculation.
How to interpret it
Strong positive score
The current MAD Filter is above most values in the selected historical comparison range.
This typically accompanies a relatively strong upward position in the filtered trend.
Falling score while still bullish
The filtered trend is losing relative strength, but the Short Threshold has not yet been crossed.
The persistent state therefore remains bullish.
Short Threshold crossing
The score has deteriorated far enough to cross below the selected bearish boundary, changing the stored state to bearish.
Rising score while bearish
The score can recover substantially while the trend remains bearish.
A new bullish state is not established until the score exceeds the Long Threshold.
How to use the indicator
The indicator can be used as:
A directional trend filter.
A persistent bullish/bearish regime indicator.
A way to measure the relative position of a MAD-filtered price series.
A confirmation tool alongside other price or market-structure analysis.
The score itself can also provide additional context beyond the binary trend colour.
For example, a bullish regime with a score near its maximum is different from a bullish regime whose score has already fallen substantially toward the bearish threshold.
Input Guide
MAD Length
Controls the rolling sample used to calculate the median and Median Absolute Deviation.
Shorter values adapt more quickly.
Longer values produce a broader statistical reference window.
MAD Multiplier
Controls how far the filtered source may move away from its rolling median.
Lower values produce stronger clipping.
Higher values allow the filter to follow Source more closely.
Score Lookback Start / End
Defines the historical MAD Filter values used in the Trend Score comparisons.
Long Threshold
Score level that must be exceeded to establish a bullish state.
Short Threshold
Level that must be crossed downward to establish a bearish state.
Data Window
The script exposes:
Rolling Median.
Raw MAD.
Scaled MAD.
These values can help show how the underlying MAD filter is being constructed.
Limitations
The indicator is reactive rather than predictive.
The score measures the current filtered value relative to historical filtered values; it does not estimate future returns.
Threshold selection can materially change signal frequency and persistence.
A very tight MAD Multiplier can suppress meaningful movement along with noise.
A very wide MAD Multiplier makes the filter increasingly similar to the original Source.
Long score ranges can improve persistence but also delay changes in regime.
Strong trends can keep the score near an extreme for extended periods.
Alerts
The script includes:
MAD Trend Score Long: stored signal changes from bearish to bullish.
MAD Trend Score Short: stored signal changes from bullish to bearish.
Summary
MAD Adaptive Trend Score combines two simple ideas.
First, the selected Source is constrained around a rolling median using Median Absolute Deviation. Source movement inside the MAD envelope passes through normally, while movement beyond the envelope is clipped to the current boundary.
Second, the current filtered value is compared with a configurable range of its own historical values.
Those comparisons are summed into a Trend Score, with positive values indicating that the current filtered level is above more of the historical comparison range and negative values indicating the opposite.
Separate Long and Short Thresholds then convert the score into a persistent bullish or bearish regime.
The result is a MAD-based filtered series and relative-position trend score for experimenting with trend persistence and threshold behaviour. インジケーター

Williams Variable A/D Pressure [MarkitTick]💡 This tool reframes Larry Williams' Variable Accumulation/Distribution concept as a fully adaptive, confluence-filtered oscillator, then extends it into a complete ATR-based trade-management layer with a live on-chart dashboard. Rather than reading a single fixed-formula line, traders get a volume-weighted pressure reading that can be reshaped through eight different smoothing engines, gated by a trend-strength filter and a higher-timeframe bias check, and translated directly into projected entry, stop, and take-profit levels the moment a qualifying signal appears.
✨ Originality and Utility
The core value of this script is not the Variable A/D formula itself — that calculation is decades old — but the pipeline built around it. Three distinct engineering layers are stacked with a specific purpose each, which is what justifies combining them into a single publication rather than three separate scripts:
A selectable adaptive-smoothing stage that lets the trader choose how the raw pressure sum is denoised — from simple averaging to cascaded, lag-reduced, and custom recursive estimators — instead of being locked into one fixed filter shape.
A dual confluence gate (trend-strength via ADX and directional bias via a higher timeframe) that suppresses crossovers occurring in weak or conflicting conditions, rather than firing on every raw cross of the smoothed line against its signal average.
An execution layer that converts a confirmed crossover into a concrete, volatility-scaled trade plan (entry, stop, three take-profit tiers) with automatic on-chart tracking of which levels have been touched, plus JSON webhook payloads for each event so the signal can drive external automation without manual re-entry of parameters.
None of these layers is arbitrary window-dressing: the adaptive filter changes what "the trend" looks like, the confluence gate decides whether that trend is tradeable, and the trade-management layer answers the practical question of where to actually place risk once a decision has been made. Removing any one of the three would leave either a raw unfiltered oscillator, an unfiltered signal, or a signal with no execution framework.
🔬 Methodology and Concepts
• Williams Variable Accumulation/Distribution Core
For every bar, a raw pressure value is calculated as the bar's directional efficiency — (close − open) divided by the bar's full range (high − low) — multiplied by that bar's volume. This produces a signed, volume-weighted read of how much of the bar's traded volume pushed price toward its close relative to its open, scaled by how decisively the bar closed within its own range. This raw series is then summed over the WVAD Period using a simple moving average multiplied by the period length, which reconstructs a rolling total (rather than an average) of accumulated buying or selling pressure over that window — consistent with Williams' original "variable" accumulation/distribution concept, where the weighting factor varies bar to bar instead of using a fixed multiplier.
• Adaptive Filter Engine
The rolling WVAD sum is then optionally reshaped by one of eight selectable smoothing methods before it becomes the tool's working "WVAD" line:
SMA / EMA / RMA — standard simple, exponential, and Wilder-style moving averages applied directly to the WVAD sum.
Double WMA — a weighted moving average applied to the output of a first weighted moving average, compounding the weighting to reduce lag further than a single WMA pass.
Triple VWMA — a volume-weighted moving average cascaded through itself three times, so the smoothing itself continues to lean on volume at each stage rather than only at the raw-pressure stage.
HMA — a Hull Moving Average pass, used here for its reduced-lag response relative to standard averages.
LLAMA — a proprietary in-house filter unique to this script. It combines a simple moving average of the WVAD sum with a linear extrapolation term: the average per-bar slope of the WVAD sum across the lookback window, scaled by half that window's length, is added back to the moving average. In practice this projects the average forward along its recent trend rather than leaving it lagging behind price the way a plain moving average would.
Kalman Filter — also a proprietary, simplified single-state implementation rather than a textbook multi-variable Kalman filter. It maintains a running error estimate and a fixed process-noise term equal to the reciprocal of the selected length; on each bar it computes an adaptive gain from the ratio of predicted error to that error plus a fixed measurement-noise constant, then nudges its estimate toward the new WVAD value by that gain. Shorter lengths raise the process-noise term and make the filter react faster to new data; longer lengths make it progressively smoother and slower to adapt.
Selecting "None" bypasses this stage and the raw WVAD sum is used directly.
• Signal & Confluence Logic
A Signal Length moving average of the (optionally filtered) WVAD line produces the Signal line, and the difference between the two produces the histogram. A raw long or short bias is registered when the WVAD line crosses above or below its Signal line. That raw bias only becomes an active Long/Short signal when both confluence conditions pass: the ADX Filter, when enabled, requires the prior bar's ADX reading to be at or above the ADX Threshold before a crossover is accepted, filtering out signals born in low-trend-strength conditions; the HTF Confirmation filter, when enabled, requires the previous, fully closed candle on the selected higher timeframe to have closed bullish for long signals or bearish for short signals, filtering out crossovers that fight the higher-timeframe bias.
• Confirmation & Non-Repainting Design
The script is built so that no decision depends on data that has not yet closed. The crossover check itself compares the previous bar's WVAD and Signal values, the ADX gate reads the previous bar's confirmed ADX value, and the higher-timeframe request pulls the prior, already-closed candle on that timeframe rather than the currently forming one. Entry price for a new trade plan is likewise taken from the previous bar's close rather than the live price. Entry/exit alerts only fire once a bar is fully confirmed. One practical consequence worth understanding: because the crossover and entry reference both use the prior bar, there is a small, consistent one-bar delay between the moment the underlying pressure line actually crosses its signal and the bar on which the trade plan is drawn and the alert can fire — this is a deliberate confirmation design choice, not an inconsistency. Take-profit and stop-loss "hit" detection, by contrast, is checked against each bar's own intrabar high/low as it happens and can alert in real time, since that behavior simply reports a price touching an already-fixed level rather than altering a prior signal.
🎨 Visual Guide
• Oscillator Pane
The WVAD line plots the (optionally adaptively filtered) pressure sum.
The Signal line plots its moving average.
The Histogram, drawn as columns, shows the difference between the two and cycles through four shades: a solid strong color when rising above zero, a faded shade when falling but still above zero, a solid opposite color when falling below zero, and a faded shade when rising but still below zero — giving an at-a-glance read of both direction and momentum change.
A flat Zero Line marks the neutral pressure boundary.
BULL and BEAR text markers appear directly on the oscillator at the bar where a confirmed long or short signal registers.
• Price Chart Overlay Elements
Several elements are pushed onto the main price chart even though the indicator's native pane is the oscillator below it:
Heatmap Candles optionally recolor the actual price candles' bodies, wicks, and borders based on whether the WVAD line is above, below, or equal to its Signal line — turning the price chart itself into a running visual of the underlying bias.
A second copy of the BULL/BEAR marker is placed directly below or above the corresponding price bar, so the signal is visible on the price chart without needing to also watch the oscillator pane.
• Trade Level Projection
When a confirmed signal fires (and levels are not locked), five horizontal lines and matching labels are drawn from the signal bar forward: the Stop-Loss line and label, the Entry line and label, and three Take-Profit lines and labels (TP1–TP3). A shaded Risk fill spans the zone between stop and entry, and a shaded Reward fill spans between entry and TP3, giving an immediate visual sense of the risk/reward geometry. All five lines automatically extend to the right as new bars form. Once a take-profit or stop level is touched, its label text updates in place to show a hit confirmation and the resulting percentage gain or loss from entry — the lines are not redrawn or repositioned, only the label text and the ongoing color state update.
• Dashboard Panel
An optional table (position configurable) summarizes, in real time: the symbol and timeframe, whether Lock Signal is active, the current directional Bias, the raw WVAD and Signal values, the Histogram value, a filled-bar Strength readout (WVAD magnitude relative to its own 100-bar high), current Volume and a filled-bar Volume Ratio (versus its 20-bar average), the Higher-Timeframe Bias (only shown when that filter is enabled), the current ADX reading (only shown when the ADX filter is enabled), the active Adaptive Filter name (only shown when one is selected), and the live Trade direction with Entry, SL, and TP1–TP3 prices, each recoloring once its corresponding level has been hit.
📖 How to Use
Treat a WVAD-over-Signal cross, confirmed by a BULL/BEAR marker and matching histogram color flip, as the core directional bias; the heatmap candles offer the fastest visual confirmation of that same bias directly on price.
Enable the ADX Filter to require a minimum trend-strength reading before a crossover is accepted — useful for avoiding signals generated during flat, low-conviction chop.
Enable HTF Confirmation and choose a higher timeframe to only accept longs when that timeframe's last closed candle was bullish, and shorts when it was bearish — this narrows signals to those aligned with the broader trend context.
Use the Adaptive Filter dropdown to trade off responsiveness against smoothness: SMA/EMA/RMA are the most transparent baseline options, Double WMA and Triple VWMA add extra lag reduction (the latter leaning more heavily on volume), HMA targets minimal lag, and LLAMA and Kalman Filter are the script's proprietary adaptive options for traders who want the smoothing itself to react to changing conditions rather than stay fixed.
Lock Signal freezes the currently displayed trade-level lines and labels so a new opposite signal will not replace them while it is enabled; it does not stop new BULL/BEAR markers, histogram behavior, or alert conditions from continuing to register — it only holds the visual trade plan in place.
The Entry price used for any trade plan is the previous bar's close, not the live price at the moment the signal appears, so real-world fills will vary from the plotted entry level depending on slippage and gap risk.
Configure the Alerts group's action-tag fields to match whatever automation system consumes the webhook payloads, then build a TradingView alert on this script using "Any alert() function call" to receive the JSON messages for entries, exits, and each TP/SL event.
⚙️ Inputs and Settings
• Core Settings
WVAD Period — the summation length for the raw Variable A/D pressure calculation.
Signal Length — the moving-average length used to derive the Signal line from the (filtered) WVAD line.
• Filters
Use HTF Confirmation / HTF Timeframe — enables the higher-timeframe directional gate and sets which timeframe it checks.
Use ADX Filter / ADX Threshold / ADX Length — enables the trend-strength gate and sets its minimum qualifying reading and DMI length.
Adaptive Filter / Adaptive Filter Length — selects which of the eight smoothing methods (or none) is applied to the WVAD sum, and its lookback length.
• Trade Tools
Lock Signal — freezes the current trade-level projection against replacement by a new signal, as described above.
Show Trade Levels — toggles whether entry/SL/TP lines, labels, and fills are drawn at all.
SL × ATR — sets the stop distance as a multiple of ATR from the entry reference price.
TP1 × R / TP2 × R / TP3 × R — set each take-profit distance as a multiple of the initial risk (R) defined by the stop distance.
ATR Length — the lookback used for the ATR value driving stop and target distances.
• Visuals
Show Histogram, Show WVAD/Signal Lines, Show Signal Markers, Show Zero Line, and Color Candles independently toggle each corresponding chart element described in the Visual Guide.
• Dashboard
Show Dashboard and Position control whether the summary table is displayed and which corner it occupies.
• Alerts
Long / Short / Close Long / Close Short Action and TP1 / TP2 / TP3 / SL Hit Action — free-text tags inserted into each event's JSON webhook payload (alongside ticker, timeframe, and relevant price fields) so external automation can route each message correctly.
Colors for every line, fill, label, candle state, and dashboard element are independently configurable and are purely cosmetic.
🔍 Deconstruction of the Underlying Scientific and Academic Framework
The foundation is Larry Williams' Variable Accumulation/Distribution concept: a price-volume flow measure in the same family as Chaikin's Accumulation/Distribution Line, but weighting each bar's volume by its own directional efficiency — (close − open)/(high − low) — rather than the Close Location Value used in Chaikin's version, making the "variable" weighting bar-specific rather than fixed.
The adaptive-smoothing stage draws on several established ideas from technical filtering theory: cascaded weighted and volume-weighted averaging (repeated WMA/VWMA passes) as a lag-reduction technique, Alan Hull's reduced-lag moving average construction, and the broader concept of adaptive filters that vary their responsiveness with market conditions rather than using a static weighting scheme — the category popularized by adaptive moving-average research such as Kaufman's work. Within that category, this script's LLAMA and Kalman Filter options are simplified, single-parameter, in-house approximations: LLAMA borrows the linear-extrapolation logic underlying least-squares/regression-adjusted moving averages (projecting a simple average forward using its own recent slope), while the Kalman Filter option implements a single-state recursive estimator in the spirit of Kalman filtering — updating an estimate and its error term each bar based on a fixed process/measurement noise ratio — rather than the multi-state, matrix-based formulation used in full Kalman filter implementations.
The ADX/DMI confluence gate is drawn from Welles Wilder's Directional Movement System, using ADX as a proxy for trend strength independent of direction. The higher-timeframe confirmation gate reflects standard multi-timeframe analysis practice, where aligning a lower-timeframe signal with a higher-timeframe directional read is used to reduce signals that contradict the broader trend. Finally, the ATR-based stop and R-multiple take-profit structure reflects standard volatility-adjusted position and risk management practice, sizing trade levels to each instrument's own recent average range rather than to a fixed point or percentage value.
⚠️ 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. We 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. インジケーター

インジケーター

Parabolic SAR Constraint Kinematics & Run GeometryOverview
Parabolic SAR Constraint Kinematics & Run Geometry studies how a continuing Parabolic SAR step is formed and how the surrounding run develops. It keeps TradingView's ta.sar() as the plotted SAR series and adds measurements of the run's Extreme Point, remaining Arc, acceleration-factor progression, and prior-two-bar price constraint.
The central distinction is between the free parabolic candidate and the candidate after the two-bar constraint. The script measures how much movement the constraint removes, how much movement remains, and how frequently material constraints occur within a fully observed run. A synchronization check compares the reconstructed candidate with ta.sar() before exposing the related constraint percentages.
The PSAR formula itself is standard. The added functionality is the coordinated measurement of its step mechanics, run-relative geometry, observation completeness, and bounded run history. The indicator does not adapt the PSAR formula, filter its side changes, optimize parameters, or rank trading opportunities.
Chart layers
The default display contains the canonical SAR dots, an Extreme Point trace, a translucent SAR-to-Extreme-Point Arc, small side-change markers, yellow material-constraint halos, and a compact upper-right panel.
Cyan and pink distinguish the tracked SAR-below and SAR-above run states. Green and amber distinguish the corresponding Extreme Point traces. Colors and visibility are configurable. These colors describe tracked states; they do not prescribe an action.
The Extreme Point is the highest observed high in a SAR-below run or the lowest observed low in a SAR-above run. It is updated according to the selected confirmation setting.
Optional layers include the free candidate point, the constraint bridge, an Arc midline, the current run's origin line, descriptive event markers, and completed-run summaries. These additional layers are disabled by default to avoid crowding the chart. The bridge compares the free candidate with the plotted SAR on materially constrained bars after the synchronization check; the reconstructed guarded candidate can differ from the plotted SAR by the permitted tolerance.
Reading the compact panel
The default layout remains a three-row grid. Abbreviated captions and reduced spacing save horizontal space without changing the measurements or their numeric precision.
STATE: BELOW or ABOVE means the tracked SAR side relative to price. FULL means the run's beginning was observed; PARTIAL means tracking began during an existing run. TIGHT identifies the contracted-Arc state. SYNTHETIC identifies a non-standard chart.
RUN: An example such as "11b ✳3 ∥4" means 11 bars in the tracked run, three Extreme Point updates, and four bars since the last Extreme Point update. The star identifies updates; the parallel strokes identify elapsed bars without an update.
ARC: Current normalized SAR-to-Extreme-Point distance, followed by Arc Retention.
STEP: Absolute one-bar SAR movement, followed by that movement as a percentage of the remaining Arc. This percentage is a geometric ratio, not a return or probability; it is not capped at 100%.
MOTION: Mechanical state, TX percentage, observed AF, and synchronization symbol. TX means Step Transmission. For example, "FREE TX100.0% AF0.08" indicates an observed FREE state, transmission of 100.0% of the reconstructed free step, and an observed AF of 0.08.
CODE: The four-axis run signature and completed-run count. CODE is the compact label for the run signature, not a trading signal. The suffix n20 means 20 completed full runs are retained for the duration/brief-run history. When the signature display is disabled, HIST shows the sample count, average duration in bars, and brief-run share instead.
Hovering over the cells reveals definitions, the processing scope, reconstruction error, constraint percentages, recent recorded signature states, and rolling history summaries. The panel shows the latest execution state; moving the cursor over an older bar does not make the panel display that bar's historical state. Extended Data Window output can be enabled for historical numeric inspection inside the research window.
Arc and distance units
Arc = abs(Current SAR - Tracked Extreme Point)
Arc Retention = 100 x Current Arc / Widest Arc recorded in the same tracked run
A lower retention value means the current Arc is narrower relative to that run's widest recorded Arc. It does not establish that a price reversal is approaching.
Distance units are selectable: ATR at run start, percent from run origin, minimum ticks, or raw price. The ATR-style normalizer smooths true range using RMA, SMA, EMA, or WMA. The range used for normalization is captured when tracking of the run begins, and percent distances use the absolute close captured as the run origin. In a PARTIAL run, these references belong to the first tracked bar, not the unknown actual beginning of the run.
Normalization and optional marker spacing do not alter the canonical SAR calculation.
Tight Arc and re-expansion
After the configured minimum run age, TIGHT is entered when Arc Retention is at or below the selected contraction threshold. Defaults are five bars and 35% retention.
The contracted state is released only after a new Extreme Point appears and retention reaches the contraction threshold plus the selected hysteresis, capped at 100%. Default hysteresis is 20 percentage points, giving a default release level of 55%.
The two thresholds reduce repeated state changes near a single boundary. TIGHT is a latched run state, so a retention value above the entry threshold does not by itself end that state. Neither contraction nor re-expansion forecasts a future market event.
Observed acceleration factor
Observed AF = min(Starting AF + Recorded EP Updates x AF Increment, Effective Maximum AF)
AF Progress = 100 x (Observed AF - Starting AF) / (Effective Maximum AF - Starting AF)
Defaults are 0.02 for the starting factor, 0.02 for the increment, and 0.20 for the maximum. If the entered maximum is below the starting factor, the effective maximum is raised to the starting factor. When both are equal, AF progress is represented as 100%.
The observed AF is reconstructed from the tracked Extreme Point sequence. It is not an independently exposed internal AF series supplied by ta.sar(). Partial-run values do not recover unobserved pre-window updates.
Free candidate and two-bar constraint
The reconstruction is attempted on eligible continuing bars of FULL runs, with the required prior values available and the current raw SAR side agreeing with the tracked run.
Free Candidate = Previous SAR + Previous Observed AF x (Previous Tracked EP - Previous SAR)
For a SAR-below run:
Guarded Candidate = min(Free Candidate, Previous Low, Low Two Bars Ago)
For a SAR-above run:
Guarded Candidate = max(Free Candidate, Previous High, High Two Bars Ago)
The resulting guarded candidate is compared with the current ta.sar() value. The default permitted difference is two minimum ticks; the tolerance is adjustable and includes a small numerical floor.
If the reconstruction is outside tolerance, the state becomes CHECK and Constraint Load and TX are unavailable. If the bar is not eligible, the state is INIT. A successful check establishes agreement within the selected tolerance on that bar, not exact recovery of every internal PSAR state or independent validation of the model.
Constraint Load and Step Transmission
Free Step = abs(Free Candidate - Previous SAR)
Removed Distance = abs(Free Candidate - Guarded Candidate)
Constraint Load = 100 x Removed Distance / Free Step
TX measures the guarded directional step as a percentage of the free directional step. Direction here means the mechanical direction of the tracked PSAR run, not a proposed trade.
TX = 100 x Guarded Directional Step / Free Directional Step
The displayed constraint percentages require synchronization and a valid positive denominator. They are bounded between 0% and 100%. In ordinary eligible cases, they describe the removed and transmitted portions of the reconstructed step. A zero or invalid denominator produces unavailable data rather than an invented percentage.
A measurable constraint requires both a removed distance of at least one quarter of a minimum tick and Constraint Load of at least 1%. A material constraint additionally requires the user-selected materiality threshold, which defaults to 12.5%.
MOTION states and symbols
INIT: The current bar is not eligible for the continuing-run reconstruction, including during partial tracking or at the start of a run.
CHECK: The guarded candidate differs from ta.sar() by more than the permitted tolerance.
FREE: The measurable-constraint conditions are not satisfied. This includes effects below the residual or load thresholds, not necessarily a mathematically exact zero effect.
TRACE: A measurable constraint exists, but its load is below the materiality threshold.
BRAKE: A material constraint exists and the guarded directional step remains greater than one quarter of a minimum tick.
PINNED: A material constraint exists and the guarded directional step is at or below that quarter-tick threshold.
The check mark means agreement within tolerance; the exclamation mark means outside tolerance; the ellipsis means not yet eligible. None is a confidence rating or market recommendation.
Yellow halos and run occupancy
A yellow halo identifies a bar meeting the synchronized material-constraint conditions. It marks a mechanical effect on the PSAR step, not an entry, exit, reversal prediction, target, or stop.
Run Constraint Occupancy = 100 x Materially Constrained Counted Bars / Synchronized Counted Bars
The counts follow the selected confirmation setting and exclude the side-change bar. Under the default setting, they are committed at bar close. The percentage measures how frequently the guardrail materially affected the eligible observations in that run, not the probability of a future outcome.
Run signature: A, F, P, C
An example code is A3·F2·P2·C0.
A is Arc Retention.
F is observed AF Progress.
P is Extreme-Point Pause Share: 100 x Bars Since Latest EP / (Run Age - 1), with zero used at age one.
C is current Constraint Load.
A, F, and P use four fixed percentage bands:
1: below 25%
2: 25% to below 50%
3: 50% to below 75%
4: 75% or higher
C uses:
C0: valid load below 1%
C1: 1% to below 25%
C2: 25% to below 50%
C3: 50% to below 75%
C4: 75% or higher
C-: Constraint Load is unavailable
C- can occur because the bar is ineligible, synchronization fails, or the denominator is invalid. When no complete signature can be formed, placeholder bands are shown. C is based on the numeric load, whereas MOTION also applies the quarter-tick residual test and the selected materiality threshold; the two displays need not change together.
A3·F2·P2·C0 therefore describes retention from 50% to below 75%, AF progress from 25% to below 50%, pause share from 25% to below 50%, and valid constraint load below 1%.
These are fixed ranges, not sample quartiles, learned regimes, rankings, or probabilities. The code helps compare similarly structured observations without implying similar future outcomes. Up to three recent distinct synchronized signature observations are available in the tooltip; this is not an automatic historical pattern search.
FULL, PARTIAL, and completed-run history
A FULL run begins at an observed SAR side change inside the research window. A PARTIAL run was already underway when tracking began. Only completed FULL runs enter the rolling history.
The memory setting defaults to 20 and accepts 3 to 100 runs. Duration and brief-run history retain the latest completed full runs. The brief threshold defaults to four bars or fewer.
Constraint-occupancy history accepts only completed full runs with a valid occupancy value. Runs without that value are skipped for this particular average, so its sample can differ from the duration/brief-run sample.
Optional completed-run labels also show EP updates, time at the maximum observed AF stage, constraint occupancy, and tight-Arc episode count. These summaries describe completed observations, not simulated transactions.
Research window and runtime
Recent bars is the default scope. The custom research window defaults to 3,000 bars and can be set from 500 to 50,000. All available bars removes that custom limit, subject to the history available on the chart.
The boundary is fixed when the script loads or recalculates. Subsequent realtime bars are included; the window is not a continuously sliding hard cap. Reloading or changing an input rebuilds it.
Before the boundary, canonical ta.sar() and the selected normalizer still evaluate to provide continuous underlying series. The window limits custom run analysis, reconstruction, history, events, and plotted research output; it is not Pine's native calc_bars_count restriction and does not prevent every underlying calculation from running on earlier bars.
Larger windows and All available bars can increase runtime. Use a smaller window if a runtime warning occurs. This is a research and resource setting, not an access restriction.
Controls and alerts
Users can change the research scope, PSAR factors, confirmation behavior, normalization, history length, constraint threshold, synchronization tolerance, visual layers, marker limits, panel layout and position, right-edge clearance, text size, bold formatting, and colors.
Alerts are disabled by default. Available conditions report a SAR side change, Arc contraction, Arc re-expansion, the onset of a material constraint, an age milestone, the observed AF maximum, an EP pause, or completion of a brief full run. They do not specify trading actions.
Extended Data Window output is also disabled by default. Enabling it exposes additional numeric series without changing the underlying measurement rules.
Suggested research workflow
Start on a standard candlestick or bar chart with default settings. Identify the SAR dots, Extreme Point trace, and Arc before reading the panel. Check FULL or PARTIAL, inspect ARC and STEP, and then use MOTION and its tooltip to examine the reconstructed constraint.
For a worked mechanical example, a free directional step of ten ticks reduced to six ticks has a four-tick removed distance: Constraint Load is 40% and TX is 60%, provided the guarded candidate synchronizes and the other eligibility conditions hold. This example explains the arithmetic; it does not describe a trading result.
Use CODE to compare descriptive states, or enable the candidate point and bridge for closer mechanical inspection. Keep the symbol, timeframe, PSAR factors, distance unit, and observation policy consistent when comparing records.
Realtime behavior and limitations
Confirm state changes at bar close is enabled by default. Run changes, EP updates, descriptive event records, and history counters are committed under that setting. The active ta.sar() point, current geometry, constraint calculations, halos, and current displayed signature can nevertheless change before the bar closes. The panel can retain a committed run state while live geometric values update. Disabling confirmation allows more provisional intrabar behavior.
The script is not described as completely non-repainting. Use closed bars for reproducible comparisons.
Non-standard chart types supply synthetic or transformed OHLC. The panel marks them as SYNTHETIC; their measurements describe that generated chart series, not standard market bars.
PSAR can change sides frequently in irregular or sideways markets. A synchronized reconstruction is only a numerical consistency check within tolerance. Changing the available history, research boundary, settings, or timeframe can change the tracked run statistics. Extreme parameter values may produce more unavailable or CHECK observations. Defaults are general research settings, not optimized values.
This open-source indicator is a descriptive visualization and numerical research tool. It makes no claims about forecast accuracy, trading performance, or a predictive edge, and it does not provide individualized recommendations or trading instructions. インジケーター

Volume Profile Breakout Continuation
What this is - and is not. This is one state machine, not separate tools stacked on a chart. A range-compression detector, a volume profile, a higher-timeframe filter, a pullback tracker and a trade-management layer are chained so that each stage only exists because the previous one fired. It is not a volume profile indicator with signals bolted on, and it is not a breakout indicator with a profile drawn next to it.
Why the parts are inseparable. The profile is built only over the bars of a detected accumulation range - remove the range detector and there is nothing to profile. The breakout is defined as a close outside that same range - remove the profile and the pullback has no POC to return to. The trigger is a close back through the POC in the breakout direction - remove the breakout and the trigger has no direction. Take any stage away and the remaining logic has nothing to act on.
Mechanism
1. Accumulation. When the range of the last N bars is at or under k × ATR, an accumulation box opens on that bar and grows while price stays inside. It is drawn as it forms, not in hindsight. A box that expands past the abandon threshold, or runs too long, is dropped and faded.
2. Profile. A small volume-at-price histogram is built inside the box from the accumulation bars only and refreshed each bar. Each bar's volume is spread evenly across the rows its high-low spans. POC is the heaviest row; the value area is expanded outward from the POC to the chosen percentage.
3. Breakout. A confirmed close outside the box. With the higher-timeframe filter on, long breakouts require the prior completed HTF close above its EMA and shorts below. At this moment POC, VAL and VAH are frozen and a second box opens to frame the pullback.
4. Pullback. Price comes back into the POC zone (a tolerance expressed as a percentage of the range height). The setup is invalidated by a close through the far edge of the value area or by a wait timeout.
5. Trigger. A confirmed close back through the POC in the breakout direction marks the entry.
What you see
- Purple accumulation boxes with the profile tucked inside (heatmap or single-hue mode, POC row in gold).
- A teal pullback box from the breakout bar to the trigger bar, with the POC line running through it and a label on the bar that touches the zone.
- Entry labels with entry, TP and SL; TP and SL boxes that extend while the trade is open and truncate at the exit; exit labels showing the percentage actually taken. Past trades stay on the chart.
- A developing session profile floated off the last bar, plus finished day profiles painted in place at each rollover and never redrawn.
- A monospace dashboard: stage, HTF bias, accumulation range, setup and day POC, day value area, pullback status, position, TP/SL, running record, readiness.
Settings
- Accumulation: range lookback, compression multiple, minimum and maximum bars, abandon multiple, ATR length.
- Setup profile: rows, value-area percentage, histogram width, past-setup fade and count.
- Session profile: rows, width, offset, side, color mode, past profiles to keep and their width and transparency.
- HTF bias: on/off, timeframe (auto steps up one tier from the chart), EMA length.
- Pullback: POC zone half-width, maximum wait.
- Trade management: fixed-percent or ATR-multiple TP/SL, max bars in trade, entry cooldown, optional post-exit cooldowns by exit type, past-box fade.
- Session: end-of-day flatten hour and minute (New York).
- Webhook: optional JSON payload on entry and exit with a strategy id and quantity.
How to use. Start with the default settings on the timeframe you normally trade and watch how often boxes form and how often breakouts fail before the pullback. Tighten the compression multiple for fewer, cleaner ranges; widen the POC zone if pullbacks are missing the level by a hair. The trade-management layer is a study aid: the labels and boxes show what the mechanical rules would have done, so you can judge the logic against your own read of the chart.
The defaults are a starting point for one instrument, not an optimized or recommended configuration, not intended to suggest any particular outcome.
Non-repainting. Every state transition, entry and time-based exit is evaluated on confirmed bars only. The higher-timeframe values are requested with lookahead off and reference the previous completed HTF bar, so history and live behave the same. Finished day profiles are painted once at the rollover and never redrawn. TP and SL are checked against the bar's high and low. The profile uses chart-timeframe bar volume, not tick data, so it is an approximation, as every profile built in Pine is; instruments without volume fall back to a time-at-price count. インジケーター

STP Trade Idea AnalysisThe STP Trade Idea Analysis Indicator is a conditional price-path projection engine designed to help traders evaluate potential market direction, important reaction levels, and alternative price scenarios directly on the chart.
Rather than relying on a single technical signal, the indicator combines multiple forms of market structure and price action analysis to provide a clearer view of where price may move next. The system evaluates Elliott-wave structure, Fibonacci levels, Fair Value Gaps (FVGs), Supply and Demand, trend information, and technical confluence to identify meaningful areas of support, resistance, and potential price reactions.
A key feature is the Primary and Secondary Elliott price paths. The Primary path represents the currently favored scenario based on the available market structure, while the Secondary path provides an alternative if price action develops differently. These paths are conditional projections rather than fixed predictions and can adjust as new market information becomes available.
Key Features
Conditional Price-Path Projection – Displays Primary and Secondary Elliott-style scenarios based on current market structure.
Primary Elliott Path – Shows the currently favored 1–5 impulse and A–B–C corrective price path.
Secondary Elliott Path – Displays an alternative scenario if market structure begins to shift.
Fibonacci Levels – R1–R4 and S1–S4 levels derived from the 6:00 AM ET anchor and prior regular-session trading range.
Bullish FVGs – Green shaded areas identify bullish price imbalances that may act as future reaction or support zones.
Bearish FVGs – Red shaded areas identify bearish price imbalances that may act as future reaction or resistance zones.
Supply and Demand Zones – Identify areas where buying or selling pressure may influence future price action.
Confluence Support and Resistance – Highlights important decision zones where multiple independent technical levels cluster.
21 and 50 EMAs – Provide additional visual context for trend direction and price structure.
How to Use the Indicator
For the clearest analysis, I recommend using the indicator primarily on the 1-hour and Daily charts.
Start with the Daily chart to understand the larger market structure, longer-term trend, major support and resistance areas, and the broader Primary and Secondary price-path scenarios. This provides the higher-timeframe context for the trade.
Next, move to the 1-hour chart for a more detailed view of the current setup. Use the 1-hour chart to evaluate developing Elliott structure, FVGs, Fibonacci levels, Supply and Demand, and nearby confluence zones.
Pay particular attention to the Primary Elliott path. This represents the currently favored scenario based on the market information available to the indicator. The Secondary Elliott path should not be ignored. It represents an alternative scenario and can help identify where your original trade thesis may be weakening or where market structure may be changing.
Use the Confluence Support and Resistance zones as potential decision areas. These zones are especially important because they represent areas where multiple independent technical factors cluster, rather than a level derived from a single calculation.
Bullish and Bearish FVG shaded zones can provide additional context. Watch how price behaves as it approaches or enters these imbalances. A reaction, rejection, continuation, or fill can provide useful information about whether the Primary price path remains intact.
The Fibonacci R1–R4 and S1–S4 levels provide additional reference points for potential price reactions and targets. They are established using the 6:00 AM ET anchor and prior regular-session range.
Suggested Workflow
1. Start with the Daily chart
Identify the broader trend, Elliott scenario, major zones, and directional context.
2. Move to the 1-hour chart
Evaluate the current price structure and more actionable Primary and Secondary paths.
3. Identify Confluence Support and Resistance
Look for areas where price may react, consolidate, reverse, or break through.
4. Review FVGs and Fibonacci Levels
Use these as additional confirmation and as potential areas for reaction.
5. Compare the Primary and Secondary paths
The Primary path represents the favored scenario. The Secondary path helps you prepare for an alternative outcome.
6. Let price action confirm the scenario
The projected path should be used as a roadmap, not as a guarantee. As price structure changes, the favored scenario can change as well.
Understanding the Projection
The goal of the indicator is not to predict an exact future price. Instead, it provides a structured framework for answering a more useful trading question:
If the current market structure continues, what is the most probable price path, and what alternative path should I be prepared for if conditions change?
Using the Daily chart for broader context and the 1-hour chart for trade analysis allows traders to evaluate both the larger market structure and the developing setup before making a trading decision.
Important: The STP Trade Idea Analysis Indicator is intended for technical analysis, education, and trade planning. Primary and Secondary price paths are conditional scenarios based on available market data and should not be interpreted as guaranteed future price movements.
インジケーター

Gaussian Trend Filter | Lyro RS█ Overview
Gaussian Blur Trend Filter | Lyro RS is a trend-following overlay that runs price through a two-pass Gaussian blur to build a smoothed baseline, then classifies the market as bullish, bearish, or neutral from the slope of that baseline combined with price's position relative to it.
Where a single moving average reacts to every wiggle in price, this indicator convolves the same Gaussian kernel over price twice. The second pass smooths the already-smoothed series, producing a wider effective kernel with cleaner slope behaviour than a single-pass filter of the same length — fewer false slope changes, later noise-driven flips.
The result is a coloured baseline with a filled cloud back to price, flip labels marking the exact bar of a trend change, and recoloured candles so the whole chart reflects the current state at a glance.
█ How It Works
⚪ Gaussian Weighting
Each bar in the lookback window is weighted using a Gaussian curve rather than a flat or linear taper, so nearby bars dominate but older bars still contribute smoothly instead of dropping out abruptly.
w = math.exp(-(i * i) / (2.0 * sigma * sigma))
sigma is set as a percentage of Kernel Length via the Blur Width input, which shapes how quickly that weighting falls off.
⚪ Two-Pass Convolution
The first pass smooths raw close into an intermediate series. The second pass smooths that already-blurred series with the same kernel. Two convolved Gaussians combine into one wider, cleaner Gaussian — this is what removes the "noise of the noise" that a single pass leaves behind.
⚪ Trend Classification
The trend only flips to bullish when the baseline is rising and price closes above it, and only flips to bearish when the baseline is falling and price closes below it. Outside of those conditions the previous state is held, so the trend is sticky rather than flickering on ambiguous bars.
⚪ Visual Layer
The baseline is drawn as a stacked outer-glow / glow / core-line plot for a soft neon look, the raw first-pass line is kept visible but faint as a reference, the space between baseline and price is filled as a trend cloud, and candles are recoloured to match the active trend.
█ How to Use
⚪ Reading the Cloud
Cloud colour and fill direction show the current bias and how far price has stretched from the smoothed baseline.
⚪ Flip Labels
"Long" and "Short" labels mark the exact bar where trend state changed — useful as an entry trigger or as confirmation of a bias shift.
⚪ Tuning Kernel Length
Shorter length reacts faster and produces more flips; longer length is smoother but lags further behind price. Lower timeframes generally want shorter settings.
⚪ Tuning Blur Width
Controls how sharply the Gaussian weighting falls off relative to Kernel Length. Lower values keep more first-pass detail; higher values flatten the weighting curve for extra smoothness.
⚪ Alerts
Two built-in alert conditions — Bullish Flip and Bearish Flip — let you get notified the moment the trend state changes without watching the chart.
█ Settings
Kernel Length (5–100, default 30) — number of bars used in the Gaussian window for both blur passes.
Blur Width (0.1–1.0, step 0.05, default 0.35) — Gaussian sigma as a fraction of Kernel Length.
Custom Color Palette — Classic, Mystic (default), Accented, or Royal preset schemes.
Use Custom Palette — overrides the preset with your own Up/Down colours.
█ Important
The double Gaussian pass trades reactivity for a cleaner slope — the baseline will lag raw price more than a single-pass filter of the same length. Reduce Kernel Length on faster markets or lower timeframes if that lag feels excessive. Trend state is confirmed on bar close and does not repaint historically, though the state of the currently forming bar can still change until it closes.
This script is provided for educational and informational purposes only and does not constitute financial advice. Past performance of any strategy, indicator, or trading approach does not guarantee future results. インジケーター

McGinley Regime Ribbon [AxeAlgo]McGinley Regime Ribbon
----------------------------------------------------------------------
WHAT THIS SCRIPT DOES
----------------------------------------------------------------------
McGinley Regime Ribbon classifies the current market into one of four regimes, Trend Up, Trend Down, Ranging, or Volatile, on any chart, in real time, and colours a woven ribbon to match.
It is a context filter. It does not predict future price direction and it does not generate buy or sell signals. Its job is to tell you which kind of tool fits current conditions, so you can stop applying trend logic to a range or fade logic to a trend.
- Trend Up or Trend Down: trend and breakout tools are in context, and mean reversion tends to fight the move.
- Ranging: fades, support and resistance, and VWAP reversion tend to fit, while breakout tools tend to produce false starts.
- Volatile: wide, structureless movement with no dependable edge for either style. The label is a suggestion to stand aside.
----------------------------------------------------------------------
BACKGROUND, WHY A McGINLEY RIBBON AND NOT AN EMA RIBBON
----------------------------------------------------------------------
A standard EMA moves at one fixed speed set only by its length. That same speed applies in a dead calm range and in a fast trend. That fixed speed is the main reason an EMA ribbon whipsaws: in chop, price crosses back and forth through a band that cannot get out of the way, and the stacked or not stacked alignment reading that any ribbon based classifier depends on flickers along with it.
The McGinley Dynamic (John R. McGinley, CMT) handles this inside the formula rather than by adding more smoothing. Each line updates every bar with a term that measures how far price has pulled away from the line, raised to the fourth power. When price pulls away, the line speeds up to close the gap on its own. When price is riding the line, it settles back to roughly the pace of an EMA of the same length. The line is fast when it needs to be and calm when it needs to be, with no separate trend or chop switch attached on top.
The Ribbon Smoothness input is the published tuning constant that scales the baseline speed so it lines up with an EMA of the chosen length. Lower reacts faster, higher is steadier, and the adaptive behaviour happens on top of that either way.
----------------------------------------------------------------------
THE SHARED SPEED FACTOR
----------------------------------------------------------------------
The textbook McGinley formula lets each line compute its own deviation from price. In a five line ribbon that breaks the one property a ribbon needs, a stable relative order between the lines, because a slower line always lags price more than a faster one, so it sees a larger deviation and speeds up by a different amount on an ordinary bar.
In this script only the middle line computes its own deviation. The other four reuse that same speed factor. Relative responsiveness between any two lines is then a fixed ratio of their lengths, exactly like an EMA ribbon, while the ribbon as a whole still accelerates in trends and calms in chop as a group. The speed factor is bounded so one extreme bar cannot collapse every line at once. The five lengths keep Fibonacci spacing, 8, 13, 21, 34 and 55 by default, scaled from a single Ribbon Length input.
----------------------------------------------------------------------
HOW THE REGIME IS CLASSIFIED
----------------------------------------------------------------------
Three independent readings are combined on each bar.
1. Ribbon alignment. How many of the five lines are stacked in order, fast above slow for up or the reverse for down. A full stack is directional structure, a partial stack is not.
2. ADX, taken from the Directional Movement Index. Above the trending threshold points to a real directional push, below the chop threshold points to none. ADX on its own cannot separate trend from chop, which is why it is only one of three inputs.
3. Normalised ATR percentile. ATR divided by price, ranked against its own recent history on a 0 to 100 scale. A high percentile means volatility is unusually elevated for this symbol specifically. Ranking against its own history is what lets the thresholds work across different symbols and timeframes without re-tuning.
From those three:
- Volatile requires an elevated ATR percentile together with a ribbon that has come apart. A fully stacked ribbon is treated as a trend no matter how fast it is moving, so elevated volatility on its own never forces the Volatile state.
- Trending requires not Volatile, ADX at or above the trending threshold, a fully stacked ribbon, and a ribbon spread, meaning its width measured in ATR, at or above a minimum.
- Ranging is the calm, structureless default that applies when neither of the above holds.
----------------------------------------------------------------------
STABILITY AND CONFIRMATION
----------------------------------------------------------------------
Four layers keep the regime from flickering on a boundary.
- Hysteresis. The reading needed to leave a regime is looser than the one needed to enter it, so a value parked on a threshold does not flip every bar.
- Minimum hold. A changed raw regime becomes official only after it has held for a set number of bars. Entering Volatile is exempt by default, because standing aside should not wait.
- Flip rate chop filter. If the official regime has already changed several times inside a recent window, the market is whipsawing by definition, and a fresh trend call is held back until it settles. An already established trend is exempt, so this never fights a real trend through a pullback.
- Higher timeframe confirmation. The same classifier is run on a higher timeframe using confirmed bars only, then folded into an agreement flag and into the published gates. It can require the higher timeframe to merely not conflict, or to match the trend direction exactly.
----------------------------------------------------------------------
SCORES
----------------------------------------------------------------------
- Regime Confidence, 0 to 100. How far past its defining threshold the current regime sits. A reading right on the line scores near zero.
- Regime Maturity, 0 to 100. How long the current run has lasted compared with past runs of the same type on this symbol. A high value means the current phase is already longer than most earlier ones, which can flag a stretched range or an extended trend.
- Trend Quality, 0 to 100. A weighted blend of ADX, ribbon alignment, ribbon spread and mid line slope, reduced when volatility is elevated.
----------------------------------------------------------------------
WHAT YOU SEE ON THE CHART
----------------------------------------------------------------------
- A woven ribbon of 21 thin strands interpolated across the five McGinley lines, with no solid fill. Each strand is a shade of the current regime colour, darker on the slow edge and lighter on the fast edge, over a soft wide glow. Gold for Trend Up, ruby for Trend Down, royal blue for Ranging, indigo blue for Volatile.
- Shade is driven by Regime Confidence. A confident reading gets the full saturated colour. A borderline reading is pulled toward a greyed version of the same colour, never a different colour and never invisible, so the ribbon colour itself tells you how much to trust the call.
- On a regime change every strand cross fades from the old colour to the new one over a few bars, so the ribbon melts between colours instead of snapping.
- A diamond when the regime officially flips into a directional call. A gold diamond below the bar for Trend Up and a ruby diamond above the bar for Trend Down, following the usual arrow convention. Flips into Ranging or Volatile are reported on the dashboard rather than the chart.
----------------------------------------------------------------------
DASHBOARD
----------------------------------------------------------------------
A compact on chart panel showing the current regime, the tool family it favours, Trend Quality, Regime Confidence, ADX, ATR percentile, the recent flip count, how long the regime has run against its own median, any pending flip and its confirmation countdown, and the higher timeframe regime with its agreement state. If the optional signal section is enabled it also shows average result by regime.
Position is selectable. The whole panel can be turned off.
----------------------------------------------------------------------
OPTIONAL, GRADE A SIGNAL BY REGIME
----------------------------------------------------------------------
An optional section lets you wire in an external signal series from another indicator, positive for long, negative for short, zero for flat. The script measures each entry forward return over a chosen number of bars in ATR units and reports the average result grouped by the regime the signal fired in, so you can see which regimes your own signal actually performs in. It is off by default and stays blank until pointed at a real signal.
----------------------------------------------------------------------
INPUTS
----------------------------------------------------------------------
- Ribbon. Price source, overall length, smoothness, and drawn width. Drawn width changes appearance only, not detection.
- Trend Criteria. A single dial, Strict, Normal or Lenient, that moves the trend strength bar, the minimum ribbon width, the volatility cut off, the confirmation delay and the quality floor together.
- Higher Timeframe Check. On or off, and which timeframe to use.
- Display. Element toggles, panel position, and the four regime colours.
- Grade A Signal By Regime. The optional external signal section above.
- Advanced. Higher timeframe agreement rules, ADX and ATR lengths, volatility lookback, colour fade length, and whether markers and alerts wait for the bar close.
----------------------------------------------------------------------
CALCULATION AND REPAINT BEHAVIOR
----------------------------------------------------------------------
Chart timeframe logic uses only the current bar own data. Higher timeframe reads take the last closed higher timeframe bar with lookahead off, so they do not repaint. The regime change diamonds and the alert calls are gated to confirmed, closed bars by default.
The ribbon colour on the open, still forming bar can update until that bar closes, because the live bar regime is not final until then. This is expected for a context tool. The confirmed markers and alerts are the parts that wait for the close.
There is a warm up period. The ribbon, ADX and the percentile window all need history first, and until that fills the panel reads Calibrating and no regime is published.
----------------------------------------------------------------------
LIMITATIONS
----------------------------------------------------------------------
- This is a classifier, not a strategy. It describes current conditions, it does not tell you where to enter or exit.
- Regime calls lag by design. Hysteresis, the minimum hold and the chop filter all trade a few bars of delay for fewer false flips.
- On very short histories, or the first bars of a new symbol, there is not enough data to rank volatility or measure regime maturity, and those readings stay blank until enough runs have completed.
- Thresholds are preset driven. The three criteria presets cover most cases, but unusual instruments may still need the Advanced dials.
----------------------------------------------------------------------
DISCLAIMER
----------------------------------------------------------------------
Trading involves substantial risk of loss and is not suitable for every investor. Nothing in this script or its description constitutes financial, investment, or trading advice. The regimes detected by this script label current and past conditions only and are not indicative of future results. Test any tool on your own markets, timeframes and settings before relying on it.
インジケーター

Trendline Indicator with Dynamic Breakpoint TrackingTrendline Indicator with Dynamic Breakpoint Tracking
This indicator automates the process of manually drawing and redrawing trendlines as price structure evolves, rather than plotting a single static line.
How it works
The script tracks confirmed swing highs and lows (pivots). It starts in downtrend mode, watching the most recent swing low:
When that low is broken, the line resets. It anchors to the top of the prior move and snaps its second point to the next confirmed swing high that's lower than that top — drawing a fresh descending resistance line.
As price continues down, each new broken low re-anchors the line the same way, so the resistance line keeps stepping down along the sequence of lower highs.
If price closes at or above the current resistance level, the script flips to uptrend mode and begins drawing an ascending support line using the mirror-image logic: anchoring from the bottom of the move and snapping to the next confirmed higher low.
The two modes alternate automatically as market structure shifts between making lower highs and higher lows.
Dynamic breakpoint tracking
Unlike a fixed trendline, the breakpoints this script uses to define the line are re-evaluated continuously:
If a transition is only halfway confirmed (e.g. resistance broke but no higher low has formed yet) and price reverses back through the original anchor before that confirmation completes, the script recognizes the transition failed and reverts to the prior trend immediately, rather than waiting on a reversal that isn't materializing.
A stale-anchor safeguard prevents the line from getting permanently locked onto an old price level if the market structure it's tracking becomes irrelevant.
Inputs
Pivot Left/Right Bars — sensitivity of swing detection (smaller = faster but noisier, larger = smoother but more lag)
Max bars to search for anchor point — how far back the script looks when re-anchoring
Line colors/width, signal colors, and toggles for trend labels, pivot markers, and the debug status table
Notes
Pivot-based detection is inherently lagging by design (a swing can only be confirmed once bars exist on both sides of it), so the line reacts after structure is confirmed, not in real time.
Built for visualizing trend structure and potential trend-change points — not a standalone buy/sell signal generator. Combine with your own confirmation and risk management.
インジケーター

Tech Leadership Map+ [Herman]Tech Leadership Map
Tech Leadership Map is a relative-market leadership indicator designed to show whether technology-focused market activity is currently leading, lagging, or moving without a clear advantage relative to the broader US equity market.
The indicator does not generate traditional buy or sell signals. Instead, it provides an additional market-context layer that can help traders evaluate whether current market participation supports or conflicts with the directional move they are analyzing.
It includes two selectable and independent leadership models:
* **Price**
* **Volume Pressure**
Both models convert several measurements into a standardized four-component composite score.
---
Why Tech Leadership Matters
Technology shares represent an important component of US equity index activity, particularly for Nasdaq-related instruments.
When technology is outperforming the broader market, Nasdaq-focused markets may be receiving stronger relative participation. When technology is underperforming, broader-market strength may not be confirmed by technology leadership.
This indicator attempts to make that relationship easier to observe directly on the chart.
It should be treated as a **relative-market context tool**, not as a standalone forecasting system.
---
Leadership States
The indicator evaluates four separate components.
Each component contributes:
**+1** = favors the selected technology leader
**0** = neutral / unavailable confirmation
**-1** = favors the benchmark
The resulting Composite Score can therefore range from:
**+4 to -4**
The default classification is:
** GREEN — Tech Leading**
Composite Score of +2 or higher.
Technology-oriented activity is showing stronger relative leadership than the selected benchmark.
** YELLOW — No Clear Edge**
Composite Score between -1 and +1.
The measurements are mixed and neither side has sufficient agreement to establish a clear leadership state.
** RED — Tech Lagging**
Composite Score of -2 or lower.
Technology-oriented activity is showing weaker relative leadership than the selected benchmark.
These colors describe the current relative-leadership condition. They do not represent predictions of future price direction.
---
# 1. PRICE MODE
The default Price model compares:
**QQQ — Price Leader**
with
**SPY — Price Benchmark**
Both symbols can be changed in the indicator settings.
The model evaluates four components.
### 1. Performance From RTH Open
The indicator measures the percentage performance of QQQ and SPY from the beginning of the configured US Regular Trading Hours session.
It then compares those performances.
If QQQ has performed better from the RTH open, the component favors the leader.
If SPY has performed better, it favors the benchmark.
---
### 2. Relative-Strength Ratio Slope
The indicator calculates the relative-strength relationship:
**QQQ / SPY**
The logarithm of this ratio is evaluated using a linear-regression slope.
A rising relative-strength relationship indicates improving technology leadership.
A falling relationship indicates weakening technology leadership relative to the benchmark.
---
### 3. Short-Term Momentum Difference
The model compares short-term rate-of-change momentum between the leader and benchmark.
By default, this component uses a 5-bar momentum comparison.
This allows the indicator to identify situations where both markets may be moving in the same direction while one is accelerating more strongly than the other.
---
### 4. Correlation-Break Confirmation
QQQ and SPY normally exhibit a relatively high degree of correlation.
The indicator measures correlation between their logarithmic returns.
When correlation falls below the model's internal threshold, the short-term momentum difference receives an additional confirmation vote.
The purpose of this component is to emphasize periods where relative movement becomes more meaningful because the two markets are no longer behaving as closely together.
---
# 2. VOLUME PRESSURE MODE
Volume Pressure provides an alternative model that does **not use QQQ/SPY price movement to determine leadership**.
The default market-internal sources are:
**NASDAQ: VOLDQ**
versus
**Broad Market / NYSE: VOLD**
These represent net up-volume minus down-volume market internals.
The symbols are editable because VOLDQ and VOLD represent different market universes and should not be interpreted as literal constituent-by-constituent equivalents of QQQ and SPY.
---
## Normalization
NASDAQ and broad-market internal series can operate on substantially different numerical scales.
For that reason, the indicator first normalizes each series independently before comparing them.
This prevents the raw numerical magnitude of one internal from automatically dominating the comparison.
---
## Volume Pressure Components
The model then evaluates four measurements.
### 1. Pressure Level
Compares the current normalized leader pressure with the normalized benchmark pressure.
---
### 2. Fast Pressure
Applies short-term smoothing to both normalized internal series and compares their relative position.
This helps reduce some bar-to-bar noise while preserving short-term changes in leadership.
---
### 3. Pressure Momentum
Measures the change in normalized internal pressure over the selected momentum lookback.
This identifies which market internal is currently improving or deteriorating faster.
---
### 4. Pressure Impulse
Each normalized internal is compared with its own slower baseline.
The difference between those impulses determines which market is showing the stronger deviation from its recent baseline.
---
# Chart Display
The default visualization uses colored dots placed along the chart.
The colors correspond directly to the current leadership state:
**Green = Tech Leading**
**Yellow = No Clear Edge**
**Red = Tech Lagging**
Optional chart-bar coloring can also be enabled.
By default, leadership dots are displayed only during the configured US Regular Trading Hours session:
**09:30–16:00 New York time**
This behavior can be changed in the settings.
---
# Statistics Table
The optional statistics table provides additional information about the active model.
Depending on the selected source, it displays:
* active leadership source
* current leadership state
* Composite Score
* individual component votes
* correlation in Price mode
* normalized internal gap in Volume Pressure mode
The table is intended to make the calculation transparent rather than displaying only the final color.
---
# How to Use It
The indicator is primarily intended as a **confirmation and market-context tool**.
For example, when analyzing a Nasdaq-related market, a trader may compare the current directional setup with the technology leadership state.
A bullish market setup occurring while technology is leading represents a different relative-market environment from the same setup occurring while technology is lagging.
Similarly, a bearish setup occurring while technology leadership is weakening may provide different contextual information from one occurring during strong technology leadership.
The indicator does not determine whether a trade should be entered. Entry, exit, risk management, market structure, liquidity, volatility, news conditions, and other factors remain separate trading decisions.
---
# Alerts
Three state-change alerts are available:
* Technology leadership becomes positive
* Technology leadership becomes negative
* Leadership becomes mixed
Alerts trigger when the composite state transitions into the corresponding condition.
---
# Repainting / Realtime Behavior
The indicator is designed without future-data references.
All external symbol requests use `lookahead_off`, and the script does not reference future bars or negative offsets.
However, values on the **currently forming realtime bar can change until that bar closes**, because the underlying markets and market internals are still updating.
Historical completed bars represent the final calculated state for those completed chart bars.
Users who require confirmed information should therefore evaluate the state after the relevant bar has closed.
---
# Data Availability
The indicator depends on external TradingView symbols.
Price mode requires valid data for the selected Price Leader and Price Benchmark.
Volume Pressure mode requires valid data for the selected market-internal symbols.
Availability of individual symbols can vary depending on TradingView data access, exchange coverage, account configuration, or symbol availability.
If the required data is unavailable, the indicator reports that state rather than attempting to substitute another source automatically.
---
# Originality
Tech Leadership Map combines two distinct approaches to relative-market analysis inside one standardized leadership framework.
Rather than displaying QQQ/SPY relative strength or market internals as isolated raw series, the indicator evaluates several independent characteristics of leadership and converts them into a transparent four-vote Composite Score.
The Price model evaluates:
* session-relative performance
* relative-strength trend
* relative momentum
* correlation-based confirmation
The Volume Pressure model independently evaluates:
* normalized internal pressure
* smoothed pressure leadership
* internal momentum
* pressure impulse
Both engines produce the same standardized leadership states, allowing users to compare price-based leadership with non-price market-internal participation using a consistent visual framework.
The complete Pine Script source code is published openly so users can inspect the calculations and understand exactly how each state is derived.
---
## Important Notes
This indicator is an analytical tool and is not intended to provide investment advice or guarantee future market performance.
Leadership describes a relative condition between the selected markets or market internals. It should not be interpreted as a prediction that the charted instrument must rise or fall.
Users should evaluate the indicator together with their own analysis, trading methodology, and risk-management process. インジケーター

MarketMaulers CISDMarketMaulers CISD marks the level where delivery changed state: the open of the run that raided a level and then failed to hold it. It runs on the chart timeframe and on up to two higher timeframes at once, and it draws one line per setup rather than a lane of candles, because the level is the whole product.
Potential · Confirmed · Invalidated
FROM ZERO: WHAT A CISD IS
Read it as a three-candle story.
C1 is the candle whose high or low is worth taking. C2 is the candle that takes it and closes back inside. C3 is the candle that opens afterwards, where the reclaim either gets proven or does not.
The CISD LEVEL is not C1's extreme and it is not C2's close. It is the OPEN of the consecutive same-direction run that did the raiding. That run is a sequence of candles all closing the same way, and its open is where the move that swept began. When price closes back through that open, the run that swept is now the run that failed. Delivery has changed state. That is the entire concept, and everything below is about identifying that one price honestly.
THE TIMEFRAME NAMES A GRANULARITY, NOT A CANDLE
This is the part most implementations get wrong, and it is the difference between a tool that fires several times an hour and one that marks something.
A CISD timeframe names the resolution you are confirming on. Its C1 and C2 candles come from one fractal step ABOVE it:
1m from 15m · 3m from 30m · 5m from 1H · 15m from 4H · 1h from 1D · 4h from 1W · 1D from 1M
So a 5m CISD is a 1H C1 and C2, confirmed on 5m closes. Hunting "the current 5m candle sweeps the previous 5m candle" is a different and much noisier thing that happens several times an hour and means little.
Two consequences follow, and both are visible.
• A CISD only draws when your chart timeframe is at or BELOW its own granularity. From a 15m chart a 5m CISD stays hidden, because the chart cannot resolve the closes that confirm it.
• A slot confirms at ITS OWN granularity. On a 5m chart the 15m slot waits for a 15m close, not a 5m one. Set a slot to CHART and the chart timeframe becomes the granularity, with its C2 still pairing one step up.
THE TWO-SIDED SWEEP RULE
A candle that takes BOTH sides of the prior candle is indecisive. It swept the highs and the lows, so there is no side it committed to and no direction to deliver in. No C2, no setup, either way. This gates everything and it is on by default.
MAULER MODE is the single exception and it is off by default. If that two-sided candle CLOSED beyond one of C1's extremes then it was decisive after all, and the setup stands. It loosens the strictest gate in the model, so it is worth turning on deliberately rather than leaving on.
WHERE THE LEVEL COMES FROM, AND WHY IT MOVES
The anchor is the open of the first candle of the current same-direction run. Only an opposite-close candle resets it. Wicks, extremes and dojis are transparent to it, and a run can span a candle boundary, because delivery often starts inside the previous candle.
Two rules keep that anchor honest.
• A RATCHET. Any candle opening beyond the current anchor drags the anchor to its own open. A rally pulls a dead anchor up with it, so a shallow wick past the extreme can never capture a stale run from hours ago. The anchor always sits at the origin of the CURRENT move.
• RE-ANCHORING TO THE FINAL SWEEP. When price sweeps, pulls back, then sweeps again further, the level moves to that last leg. The anchor is structural, a run open, so a bare noise wick past the extreme re-captures the same value. Only a genuine pullback and resweep shifts the mark.
WHAT POTENTIAL MEANS, AND THE ONE CASE THAT SURPRISES PEOPLE
Potential means one thing only: price has not closed through the level yet. It is not a statement about which candle the close belonged to.
So when the C2's own sealing close is already through the level, the CISD is CONFIRMED at that seal and draws that way immediately. There is no waiting for a later candle to say what has already happened.
That test runs at the seal and never in the middle of C2, because the level re-anchors every time price sweeps a new extreme inside the candle. A bar confirming against the level as it stood an hour ago would be confirming against a level that no longer exists.
INVALIDATION
A hunt dies when price takes the C2's own extreme before the level is reclaimed. That is a raw trade through it, not a close, because a trade is a trade at any resolution and the setup does not survive the manipulation extreme being taken back.
Failed levels are removed by default, which keeps every line on the chart a setup that is still live or one that actually worked. Turn on Keep failed and they stay as dotted, faded history with an invalidation tag, which is the honest picture when you are reviewing rather than trading.
WHY IT DOES NOT REPAINT
There is no security call anywhere in this script. The engine accumulates its own higher-timeframe candles from the bars it runs on rather than requesting them, so there is no lookahead idiom to get wrong and no repaint surface at all.
Confirmation reads the previous, always-complete bar, and only on a bar where the slot's own timeframe has rolled, which is what makes a 15m slot confirm on 15m closes rather than on whatever the chart happens to be. Every state change is judged on closed data.
THE TABLE
Three rows, one per slot, bull state and bear state. It reports what happened LAST rather than what has ever happened, so a side that confirmed and was later invalidated reads as invalidated. A readout that cannot go backwards is not a readout.
Deliberately independent of what draws. Most people run one slot on the chart and want the state of the other two without adding lines to the price pane.
ALERTS
CISD armed (potential) · CISD confirmed · CISD invalidated
Messages carry the slot timeframe, the direction, the event and the level price, so what arrives is a level you can act on rather than a notification that something happened somewhere. Create one alert on this indicator with the condition set to Any alert() function call and it carries every enabled event for every slot at once.
An optional killzone filter quiets alerts outside three editable windows. It touches alerts only. Outside your windows the chart is identical: setups still arm, confirm, draw and invalidate on exactly the same rules, you do not get pinged for them.
MADE TO FIT YOUR CHART
Three slots each with their own bull and bear colour. Potential and confirmed lines have separate style and width. Labels on or off with three text sizes. Three right-extension modes, including freezing a confirmed level at the bar it confirmed, which is the honest history: the level did its job there. Keep failed on or off, with a budget for how many finished levels stay per side. Table position, text size, and a toggle per section.
The kept-level budget goes to 250 a side, and the tooltip is blunt about what that means. TradingView caps a script at 500 lines and 500 labels total. Past roughly 80 a side with more than one slot on, the platform ceiling decides what you see rather than this number does. It is a budget, not a promise.
HOW TRADERS ACTUALLY USE IT
Start with one slot and leave the other two off. The default pair, 5m and 15m, is two different fractals on one chart, and running both before you have read either one on its own is how a clean idea turns into noise.
Leave Draw potential off at first. With it off, every line on your chart is a CISD that actually confirmed. Turn it on when you want to see the setups the tool was watching that never paid, which is a different and slower kind of study.
The invalidation alert is the underrated one. Knowing a level died is a stand-down, and stand-downs are cheaper than entries.
WHAT THIS TOOL IS NOT
It marks a level and reports what happened to it. It does not project targets, it does not size a position, it does not stack or merge zones, and it does not tell you the setup was good. Those are layers on top of a CISD rather than part of one, and this file marks the CISD.
Works on any market and any timeframe.
Display only. This marks a level and reports what happened to it, it does not fire buy/sell signals and it does not forecast. Educational tool, not financial advice.
Published open-source. The fractal pair table, the two-sided sweep gate, the delivery-run anchor and its ratchet, the re-anchor-to-final-sweep capture, the seal confirm, the per-slot granularity gate and the alert transport are all readable in the source. Everything above explains what it marks and how it decides what to mark; the code is there so you can check that the description is accurate rather than take it on faith. Read it, fork it, argue with the constants.
インジケーター

インジケーター

VIKING + AXE & SHIELD## VIKING + AXE & SHIELD — What This Indicator Does
**VIKING + AXE & SHIELD was built so you only need one TradingView indicator on your chart.**
Instead of stacking separate indicators for moving averages, RSI, Accumulation/Distribution, OBV, CMF, ADX, relative volume, relative strength, support/resistance and other context, this script combines them into **one overlay indicator and one compact information panel**. The goal is to keep the chart clean while still showing trend, momentum, volume, money flow, relative strength and important price levels in one place.
The indicator automatically works from the **timeframe you are currently viewing**. For example, if the chart is on 1H, the RSI and A/D calculations are based on hourly bars. On Daily, they use daily bars. On Weekly, they use weekly bars.
### Moving averages
VIKING plots four commonly used trend averages directly on the price chart:
* **9 EMA**
* **21 EMA**
* **50 SMA**
* **200 SMA**
The 9 and 21 EMAs are intended to show shorter-term trend and momentum, while the 50 and 200 SMAs provide broader trend structure. Their current prices are also printed beside the averages so you can immediately see where they are without moving the cursor over them.
Internally, the script also examines the relationship between these moving averages and price. It can recognize conditions such as bullish or bearish MA stacking, price reclaiming or losing moving averages, golden/death-cross conditions, and developing trend structures. Those calculations are kept in the script even though they are not all printed in the VIKING panel.
### AXE & SHIELD support and resistance
AXE & SHIELD is the support/resistance part of the system.
Rather than simply drawing every recent high and low, it detects pivot-based price zones and tracks how those zones behave after they are created. Zone width is adjusted using ATR, and nearby pivots can be merged into the same area rather than creating a cluttered chart full of almost-identical levels.
The script evaluates support and resistance using several ideas, including:
* how well price closes relative to the zone,
* how deeply price penetrates it,
* how strongly price reacts away from it,
* how many times the zone has already been tested,
* and whether the zone has actually broken.
This creates an internal **zone survival score** rather than assuming every support or resistance level has equal strength. The score itself is intentionally kept internal so the chart remains simple.
Support levels are shown in the selected support color and resistance in the selected resistance color. Provisional/unconfirmed levels can be shown with a dotted appearance, and the script can mark zones that have been swept.
The nearest support and nearest resistance are also exported to TradingView's data window/status line if enabled.
---
# The VIKING information panel
The panel condenses several indicators into a small area instead of requiring separate lower chart panes. It includes:
**ADX / 52W High**
**P-RVOL / RS**
**OBV / ADR%**
**CMF / Average Volume**
**RSI full readout**
**A/D Pressure full readout**
The panel position and text size are adjustable. Strong, caution and weak/broken conditions are color coded so the information can be scanned quickly.
## ADX — trend strength
ADX answers a simple question:
**How strong is the current trend?**
The script uses a 14-period DMI/ADX calculation.
* Above **25** = Strong
* Below **20** = Choppy
* Between 20 and 25 = Building
It also compares ADX with three bars ago and adds arrows to show whether trend strength is increasing or decreasing.
Example:
`ADX 30.6 Strong ↑`
means a relatively strong trend whose strength is still increasing.
Important: **ADX does not tell you whether the trend is bullish or bearish.** It measures the strength of the trend.
## 52W Hi — distance from the 52-week high
The panel calculates the highest price over approximately 252 bars and shows how far the current price is from that high as a percentage.
Example:
`52W Hi -8.2%`
means price is currently about 8.2% below its 52-week high.
This provides quick context about whether a stock is trading near leadership territory or well below previous highs.
## P-RVOL — projected relative volume
P-RVOL is more sophisticated than simply comparing today's volume with yesterday's volume.
The script builds a historical intraday volume curve using previous sessions. By default, it uses:
* the previous **20 sessions**,
* a **15-minute calculation timeframe**,
* and regular NYSE hours of **9:30 AM–4:00 PM New York time**.
It looks at how much volume normally occurs by the current point in the trading session and projects what the full day's volume may look like.
Example:
`P-RVOL 1.50x`
roughly means the current trading pace is projecting toward about **1.5 times normal session volume**.
The arrows show whether projected relative volume itself is increasing or decreasing.
This makes P-RVOL especially useful early in the trading day because you do not have to wait until the closing bell to know whether participation appears unusually strong.
## RS — relative strength
The RS rating measures the stock's performance relative to the S&P 500.
The calculation gives more weight to recent performance while also considering longer periods, using approximately:
* 63 trading days,
* 126 days,
* 189 days,
* 252 days.
The stock's performance is compared against SPX over those same periods.
The result is converted into an RS-style rating, and an arrow indicates whether relative strength is improving or deteriorating.
Example:
`RS 83 ↑`
means the stock is showing relatively strong performance and its relative-strength trend is improving.
## OBV — buying and selling pressure
On-Balance Volume looks at volume together with whether price closed higher or lower.
VIKING does not clutter the panel with OBV's huge raw cumulative number. Instead it examines the **five-bar change** and converts it into an easy description:
* Strong Buying ↑
* Buying ↑
* Strong Selling ↓
* Selling ↓
* Neutral →
That gives the useful information from OBV without needing an OBV pane.
## ADR% — average daily range
ADR% shows the stock's average trading range as a percentage over the previous 20 bars.
Higher ADR stocks generally make larger percentage moves, while lower ADR stocks generally move less.
For example:
`ADR% 4.94%`
means the stock has recently been moving through an average daily range of roughly 4.94%.
This gives a fast way to judge how volatile or active a stock normally is.
## CMF — Chaikin Money Flow
CMF measures where price closes within each candle's range and weights that behavior by volume over 20 periods.
Positive CMF generally indicates buying pressure, while negative CMF indicates selling pressure.
VIKING calculates both the current CMF value and its recent direction.
A reading such as:
`CMF +0.20`
suggests positive money flow.
A negative reading suggests the opposite.
## Average Volume and liquidity label
VIKING calculates average volume over 50 bars and adds a simple liquidity classification:
* **Liquid** = average volume above 500,000
* **Thin** = above 100,000
* **Avoid** = below 100,000
This is meant as a quick screening aid, not a universal definition of liquidity.
---
# RSI without needing an RSI pane
One of the main purposes of VIKING is to provide enough numerical information about RSI that a separate RSI pane is unnecessary.
The readout looks like:
`RSI 37.2 | Δ5 +1.9 | Dist -1.9 | Acc3 +9.3`
It contains four pieces of information.
### RSI
The first number is standard **RSI(14)**.
The script also calculates a **14-period SMA of RSI** as its baseline.
A simplified way to think about the current reading:
* above 60 = stronger momentum
* 40–60 = middle/transition area
* below 40 = weaker momentum
These same thresholds control the panel's RSI color.
### Δ5
`Δ5` means:
**How much has RSI changed over the previous five bars?**
Example:
`Δ5 +7.0`
means RSI is seven points higher than five candles ago.
`Δ5 -7.0`
means RSI is seven points lower.
Because it is based on bars, the meaning automatically changes with your chart:
* 1H chart = five hours
* Daily chart = five trading days
* Weekly chart = five weeks
This makes the same indicator useful across multiple timeframes.
### Dist
`Dist` is the distance between current RSI and its 14-period RSI moving-average baseline.
Example:
`RSI 55 | Dist +7`
means RSI is seven points above its recent baseline.
`RSI 55 | Dist -4`
means RSI may still be above 50, but it is actually below its recent RSI trend.
That distinction helps identify whether momentum is strengthening or weakening instead of relying only on the absolute RSI number.
### Acc3
`Acc3` measures **three-bar acceleration**.
The script compares RSI's move over the latest three bars with its move over the previous three bars.
This is useful because a single bad candle does not automatically destroy an otherwise improving momentum trend.
For example:
`RSI 42 | Δ5 +5 | Dist +3 | Acc3 +7`
can be read as:
RSI is still relatively low, but it has improved over five bars, moved above its recent baseline, and the recent three-bar move is stronger than the three bars before it.
So rather than simply knowing **where RSI is**, VIKING also tells you:
**where it came from, where it sits relative to its trend, and whether that movement is gaining or losing strength.**
---
# A/D Pressure without needing an Accumulation/Distribution pane
Standard Accumulation/Distribution is cumulative. Raw values can become extremely large and are difficult to compare between different stocks.
VIKING therefore converts A/D into a normalized **A/D Pressure** reading instead of displaying the raw cumulative number.
It examines the change in A/D over 20 bars and divides that change by the total volume over the same period. The result is converted to a scale capped between approximately **-100 and +100**.
The readout looks like:
`A/D -11 | Δ5 -5 | Dist -9 | Acc3 +6`
### A/D
The first number is the current normalized pressure.
Broadly:
* positive = accumulation pressure
* negative = distribution pressure
* near zero = relatively balanced
The panel colors stronger positive readings at +20 or higher and stronger negative readings at -20 or lower.
### A/D Δ5
This tells you how much normalized A/D pressure has changed over five bars.
`Δ5 +10`
means accumulation/distribution behavior has improved by 10 points over five candles.
`Δ5 -10`
means it has deteriorated.
### A/D Dist
A/D Pressure has its own **20-period moving-average baseline**.
`Dist` tells you how far current pressure is above or below that normal path.
Positive Dist means current A/D pressure is stronger than its recent baseline.
Negative Dist means it is weaker.
### A/D Acc3
Acc3 uses the same concept as RSI.
It compares the change in A/D Pressure during the latest three bars with the previous three bars.
This creates some very useful combinations.
For example:
`A/D -11 | Δ5 -5 | Dist -9 | Acc3 +6`
means:
**A/D is still negative, it is still worse than five bars ago, and it remains below its baseline — but the most recent three-bar behavior is improving.**
In other words:
**The condition is still weak, but it may be starting to turn.**
That is much more informative than simply displaying a raw A/D value.
---
# Stage and long-term trend context
The script also contains daily calculations involving the **200-day and 220-day moving averages**.
It checks whether price is moving above the 200-day average while the long-term average is flat or improving, including cases where price gaps completely above the prior 200-day average.
These calculations are designed to provide longer-term stage/trend context directly on the chart rather than adding another separate study.
---
# How to read the indicator as a whole
VIKING is not intended to make a trading decision from one number.
Its purpose is to let several independent pieces of evidence confirm or disagree with each other.
For example, a strong setup might show something like:
```text
ADX 31 Strong ↑
P-RVOL 1.45x ↑
OBV Strong Buying ↑
CMF +0.18
RS 82 ↑
52W Hi -4.2%
RSI 58.4 | Δ5 +7.2 | Dist +5.1 | Acc3 +4.0
A/D +28 | Δ5 +12 | Dist +9 | Acc3 +7
```
That would tell you:
**Trend strength is increasing, volume participation is elevated, OBV and CMF show buying pressure, the stock is relatively strong, it is close to its 52-week high, momentum is improving, and accumulation pressure is strengthening.**
The opposite combination would warn that multiple parts of the market structure are deteriorating.
The important idea is that **no individual reading needs to be treated as a buy or sell signal. VIKING is a compact market-context system.**
## Why it was built
Most TradingView layouts become crowded when you add:
RSI + A/D + OBV + CMF + ADX + relative volume + moving averages + support/resistance + relative strength.
VIKING + AXE & SHIELD is designed to replace that stack with **one indicator**.
Price stays as the main focus.
The moving averages and important support/resistance levels stay directly on the chart, while indicators that would normally require separate panes are converted into compact numerical or descriptive readings in the VIKING panel.
That gives you more chart space while still preserving information about:
**trend, momentum, participation, accumulation/distribution, money flow, volatility, relative strength and market structure.**
That is the core purpose of the script.
インジケーター

Multi-Timeframe Trend & AlignmentComprehensive Technical Overview: Multi-Timeframe Trend & Alignment Pro
This custom script is an institutional-grade technical analysis dashboard designed for professional traders who demand multi-timeframe confirmation, structural alignment, and real-time performance tracking directly on their chart canvas. By unifying multiple Exponential Moving Averages (EMAs), Simple Moving Averages (SMAs), HTF (Higher Timeframe) momentum oscillators, and performance metrics into a single dynamic interface, the script eliminates chart clutter and provides an immediate read on market structure.
Key Architectural Features
Dual Moving Average Suite: Supports up to 10 customizable EMAs and 10 customizable SMAs, allowing traders to track short-term scalping triggers alongside long-term structural baselines simultaneously.
Dynamic Table Matrix: Automatically aggregates active moving averages, sorts them by price value in real time, calculates distance metrics (points and percentage from current price), and dynamically adjusts background coloring based on structural alignment.
Multi-Timeframe (MTF) Intelligence: Incorporates robust higher-timeframe metrics via request.security, evaluating trend health across EMAs, MACD, ADX trend strength, SuperTrend direction, and RSI without repainting issues.
Performance Percentage Tracking: Automatically computes and displays Day-to-Day (DTD), Week-to-Week (WTD), Month-to-Month (MTD), Year-to-Date (YTD), and 1-Year rolling performance benchmarks.
Clean Visual Management: Features native price scale label projections and conditional toggle controls to ensure a distraction-free trading workspace.
Input Customization Guide
Global Settings
Source: The price source used for all moving average calculations (default is close).
HTF Trend Timeframe: Selects the reference timeframe for higher-timeframe trend context (e.g., Daily, 4-Hour, Weekly).
EMA / SMA Settings
Show / Length / Width / Color: Inline controls to toggle individual averages on/off, adjust lookback lengths, set line thickness (1–4), and assign distinct color profiles.
Display Controls
Show Alignment Table: Toggles the real-time on-screen data matrix.
Show Performance %: Appends DTD, WTD, MTD, YTD, and 1-Yr return metrics to the summary table.
Show HTF Trend Metrics: Appends higher-timeframe technical indicators (MACD, ADX, SuperTrend, RSI) to the dashboard.
Trading Strategies & Practical Applications
Trend Stack Confluence: When shorter-length moving averages cleanly stack above longer-length averages while price holds above key HTF baselines, the table shifts to a bullish-aligned background, signaling institutional accumulation.
Mean Reversion & Distance Tracking: Use the Dist (Pts / %) column in the real-time table to gauge overextension. Extreme percentage deviations from core moving averages (like the 50 or 200 period lines) often highlight prime mean-reversion entries or profit-taking zones.
Multi-Timeframe Filter: Pair the primary chart execution with the embedded HTF metrics. Taking long setups only when the HTF EMA stack and SuperTrend register as bullish ensures alignment with dominant macro order flow. インジケーター

AMD Structure Map [AxeAlgo]AMD Structure Map
============================================
------------------------------------------------------------
WHAT THIS SCRIPT DOES
------------------------------------------------------------
AMD Structure Map automatically detects the Accumulation → Manipulation →
Distribution cycle on any chart, in real time, and draws each phase as its
own labeled zone directly on the candles — so the market's own three-act
structure is visible as it forms, instead of something you have to
eyeball yourself after the fact.
This is a pattern-recognition and structure-labeling tool. It identifies
and visualizes market structure per the AMD model. It does not predict
future price direction, it does not generate buy or sell signals, and
nothing it draws should be treated as a trading recommendation.
------------------------------------------------------------
BACKGROUND — WHAT "AMD" MEANS
------------------------------------------------------------
AMD is a way of reading price action as three sequential acts:
Accumulation is a period where price contracts into a range while orders
build on both sides of the market. Manipulation is a deliberate-looking
move beyond that range — far enough, and on enough volume, to run the
stop-losses and breakout orders sitting just outside it — that then fails
and closes back inside. Distribution is the real, sustained move that
follows, expanding in the opposite direction of that failed move.
The core idea is that the Manipulation phase exists to create liquidity:
a move beyond an obvious range draws in breakout traders and triggers
stops on the other side, providing the volume needed for the real
directional move that follows. Whether or not you subscribe to that
interpretation, the three-part sequence — range, false break, real break
— is a recurring, observable structure across most liquid markets and
timeframes, and this script exists to detect it mechanically and
consistently rather than by eye.
------------------------------------------------------------
HOW EACH PHASE IS DETECTED
------------------------------------------------------------
ACCUMULATION is flagged by genuine volatility contraction: a fast-length
ATR reading meaningfully below its own slow-length ATR baseline, averaged
over a short recent window rather than judged off a single bar, combined
with a minimum range width relative to current volatility. This rules out
both a lone quiet tick being mistaken for real compression and micro-noise
ranges being mistaken for a real base. Once contraction is confirmed, the
zone locks to the highest high and lowest low of the seed window and does
not move afterward.
MANIPULATION is a liquidity sweep: a wick that pierces beyond the
Accumulation range by a minimum distance, on volume above this specific
cycle's own frozen baseline (measured from its own seed window, not a
constantly-rolling average that would otherwise get distorted by the
sweep's own volume spike), that closes back inside the range within a
short window of bars. It does not have to reverse on the exact same bar
it pierced — it is given a handful of bars to do so, since real liquidity
sweeps do not always resolve instantly. The moment a sweep confirms, the
script labels the zone with an Expected Direction: opposite the side that
was swept, since that is what the AMD model itself defines Distribution to
be. If price later sweeps the OPPOSITE side too, before the range
resolves, that second sweep supersedes the first and the call flips —
capped at one such re-arm, since a range swept a third time no longer
looks like a clean setup.
DISTRIBUTION is a confirmed break — by distance and by volume, both judged
against that same frozen baseline — in the direction the Manipulation
phase called. Only at that point is the cycle logged as complete. A break
in the SAME direction as the earlier sweep is logged separately and
honestly as "Manipulation Failed," since the expected reversal did not
occur — the script does not force an incomplete or contradictory sequence
into the AMD narrative just because a Manipulation event happened
somewhere in the range's history.
------------------------------------------------------------
ON THE EXPECTED DIRECTION LABEL
------------------------------------------------------------
The "Expected Direction" shown on the Manipulation zone is a direct
restatement of the AMD model's own definition, not an independent
forecast: Distribution is, by definition, the move opposite the side that
got swept. It carries no probability estimate, is not back-tested, and is
not a trade instruction. It is confirmed or denied by the same real
price-and-volume break logic used everywhere else in the script — nothing
is assumed true until price actually does it.
------------------------------------------------------------
WHAT YOU SEE ON THE CHART
------------------------------------------------------------
Each phase is drawn as its own colored zone box with a label. The
Accumulation zone appears the moment contraction confirms. The
Manipulation zone appears the moment a sweep confirms, labeled with the
Expected Direction. The Distribution zone appears ONLY once the break
genuinely confirms in that expected direction — it is sized to the
Accumulation range's own width rather than to whatever the breakout bar's
own volatility happened to produce, then grows to track the real move for
a limited window before freezing in place, so it always reads as a
proportionate rectangle rather than an arbitrary spike or a box that
keeps expanding indefinitely.
A cycle that does not complete — a Manipulation that failed to lead to a
real Distribution break, or a breakout with no Manipulation ever detected
beforehand — is marked with a single small flag rather than a full zone
box, since nothing pattern-like actually happened there. A small signal
also marks the exact first candle a genuine Distribution phase begins on.
An optional session-window highlight is available for traders who want to
see which cycles are forming inside a specific trading session.
------------------------------------------------------------
DASHBOARD
------------------------------------------------------------
A compact corner table shows the current phase and its status, the
current Expected Direction, an optional higher-timeframe bias reading
(a simple moving-average slope check on a timeframe you choose, shown
purely as background context and never used to filter or alter
detection), and a running Follow-Through Rate.
The Follow-Through Rate is a historical tally, going back to when the
chart loaded, of how often this chart's own past Manipulation calls
actually went on to confirm into a real Distribution break versus failing
or the range simply expiring. It is not a win rate, not the result of a
back-tested strategy, and not a claim about the cycle currently forming.
The percentage is intentionally hidden until a minimum number of cycles
have been observed, so a small handful of outcomes is never presented as
a statistically meaningful rate.
------------------------------------------------------------
INPUTS
------------------------------------------------------------
A single Detection Sensitivity dial (Loose / Normal / Strict) governs
every underlying threshold at once — the seed window length, the required
depth of volatility contraction, the sweep depth and volume requirements,
and the breakout distance and volume requirements. Loose finds more
cycles at looser quality; Strict finds fewer, higher-conviction cycles
only.
Beyond that, every visual element can be toggled or recolored
independently: the zone boxes, the phase labels, the Expected Direction
label, the Distribution start signal, the Follow-Through Rate row, the
higher-timeframe bias row, the session highlight, and the on-chart legend.
A "completed cycles only" mode is also available, which hides everything
while a cycle is still forming and only draws it — retroactively, all at
once — if and when it actually completes the full sequence.
------------------------------------------------------------
CALCULATION AND REPAINT BEHAVIOR
------------------------------------------------------------
All detection logic runs exclusively on confirmed, closed bars. Nothing is
decided from an intrabar wick on the currently forming candle. A sweep
candidate's return window is evaluated bar by bar as it actually happens,
never by looking ahead. A confirmed Manipulation call can be superseded
later within the same range by the one-time re-arm described above, but
only by an equally real, fully confirmed opposite-side sweep — never
speculatively, and never by revising a call that has already led to a
resolved outcome. Once a range resolves, or a zone's phase has finished,
its boundaries are not redrawn or repainted. Higher-timeframe data is
requested with lookahead explicitly disabled, so historical bars never
change; only the still-forming higher-timeframe candle can naturally
update until it itself closes, which is standard behavior for any
multi-timeframe context reading and is not repainting in the sense of
historical values changing after the fact.
------------------------------------------------------------
LIMITATIONS
------------------------------------------------------------
This script is a structure-labeling tool, not a trading system. It has no
concept of risk management, position sizing, or trade execution, and it
does not account for spread, slippage, commissions, or liquidity
conditions specific to any individual broker or exchange. Detection
quality depends heavily on the instrument, timeframe, and chosen
sensitivity setting — a setting well suited to one market or timeframe may
under- or over-detect on another, and some manual tuning of the
sensitivity dial is expected. Past detected cycles, and the Follow-Through
Rate built from them, describe what has already happened on this specific
chart and are not a guarantee of how future cycles on the same chart, or
on any other chart, will behave.
------------------------------------------------------------
DISCLAIMER
------------------------------------------------------------
This script detects and labels historical and current market structure
per the AMD model only. Nothing it displays is a probability of future
price direction, a guarantee, or a buy or sell instruction — a
Manipulation event describes a liquidity sweep that has already happened,
not a prediction of what comes next, and a Distribution zone is only ever
drawn once the corresponding break has already confirmed. The Expected
Direction label is a restatement of the pattern's own definition, not a
forecast. The Follow-Through Rate is a tally of what has already happened
to this chart's own past Manipulation calls, typically a modest sample
size, and should not be read as a win rate or as investment advice.
Trading involves substantial risk of loss and is not suitable for every
investor. Nothing in this script or its description constitutes financial,
investment, or trading advice, and past structure detected by this
script is not indicative of future results. Use at your own discretion
and risk.
インジケーター

Volatility RegimeVolatility Regime
OVERVIEW
This indicator classifies the current market into one of three volatility regimes — Low, Medium, or High — and displays them in a separate panel below the price chart. Rather than measuring volatility in absolute terms, it evaluates how current volatility compares to its own recent history, so the classification adapts automatically to any instrument and timeframe without needing manual recalibration.
METHODOLOGY
Volatility is calculated as the standard deviation of logarithmic returns over a user-defined lookback period. That value is then compared to its own distribution over a longer historical window using a percentile rank calculation. The result is a 0-100 reading showing where current volatility stands relative to its own recent history, rather than relying on a fixed, one-size-fits-all threshold that would behave differently across instruments.
COMPONENTS
- Volatility Percentile Rank line: plots the 0-100 percentile reading of current volatility, colored according to the active regime.
- Threshold lines: two dashed horizontal lines mark the Low and High volatility thresholds (default 33 and 66), both adjustable.
- Panel background shading: the background of the indicator panel is tinted according to the active regime for quick visual reference.
- Regime label: a label on the most recent bar displays the current regime as text (LOW / MEDIUM / HIGH).
REGIMES
- Low Volatility Regime: percentile rank at or below the low threshold. Current volatility is compressed relative to its recent history.
- Medium Volatility Regime: percentile rank between the two thresholds. A transitional or average volatility state.
- High Volatility Regime: percentile rank at or above the high threshold. Current volatility is expanded relative to its recent history.
PURPOSE
This tool adds volatility context to trading decisions rather than generating direct buy or sell signals. Market behavior tends to differ meaningfully across volatility regimes, and being aware of the active regime can help with position sizing, stop placement, and identifying which type of setups are more likely to be relevant at a given time.
HOW TO USE IT
- Check the current regime shown in the panel before evaluating a setup on the main chart.
- Consider adjusting position size and stop-loss distance according to the active regime — wider stops and smaller size are generally more appropriate in high volatility conditions, and the opposite in low volatility conditions.
- A prolonged Low Volatility Regime can indicate the market is compressing and may be approaching an expansion phase.
- Volatility Length, Percentile Rank Lookback, and both threshold levels are adjustable in the settings to fit different instruments and timeframes.
NOTES
This indicator is a contextual tool intended to support discretionary or systematic analysis. It does not predict market direction and should be used alongside a broader trading methodology and proper risk management. インジケーター

STOC - Super Cycle Price Structure v2.0STOC – Super Cycle Price Structure | Initial Release
STOC – Super Cycle Price Structure combines trend alignment, rolling support and resistance, volatility contraction, and price-action signals in a single chart overlay. It helps traders study developing trends, identify potential breakout and pullback setups, and monitor weakening price structure.
Trend Structure
• Customizable 21-period Fast EMA and 50-period Base EMA.
• Customizable 150-period and 200-period SMAs.
• Trend cloud and background shading for market context:
- Green: Price above the Base EMA, with the Base EMA above the 150 SMA, the 150 SMA above the 200 SMA, and the 200 SMA rising versus 20 bars earlier.
- Yellow: Price and the Base EMA above the 200 SMA, without full bullish alignment.
- Red: Conditions outside the two bullish classifications. This does not independently confirm a downtrend.
Support, Resistance and Setup Detection
• R1: Highest high over the resistance lookback, excluding the current candle.
• S1: Lowest low over the support lookback, excluding the current candle.
• Configurable base-depth and ATR-contraction thresholds.
• Optional breakout volume confirmation, using volume relative to its 50-period average.
Signal Guide
• BO — Breakout: Price crosses above rolling resistance while the full bullish trend filter is active. The optional relative-volume filter applies when enabled.
• PB — Pullback: Price touches or moves below the Fast EMA, then closes above it with a bullish candle while the full bullish trend filter remains active.
• Orange Dot — Contraction Begins: Marks the start of a qualifying volatility-contraction condition within the configured base-depth limit, with price above the 200 SMA.
• X — Trend Exit: Price crosses below the Base EMA, highlighting potential trend weakness.
The contraction marker is a simplified volatility-contraction screen; it does not verify a complete multi-swing VCP pattern. Breakout signals do not require a preceding contraction marker.
Customization and Alerts
Toggle moving averages, trend cloud, background shading, support/resistance, and signal markers. Adjust lookback periods, contraction sensitivity, base-depth limits, and breakout-volume requirements.
Separate alert conditions are available for breakouts, pullbacks, and Base EMA exits.
Optional percentage reference bands are calculated from the previous chart candle’s close. They are illustrative levels, not exchange-defined circuit limits.
Usage Notes
All lengths refer to bars on the selected chart timeframe. Signals can change while the current candle is forming; use Once Per Bar Close when configuring alerts for closing-bar evaluation. Pullback signals may repeat and exit markers are independent of previous entry signals.
Disclaimer: For educational and informational purposes only. This indicator does not guarantee profitable outcomes or constitute investment advice. Apply independent analysis, position sizing, and risk management.
インジケーター

Supertrend + Fibonacci OTE Grid & Bands [BigBeluga]🔵 OVERVIEW
The Supertrend + Fibonacci OTE Grid & Bands is an advanced technical analysis indicator designed by BigBeluga to combine trend-following Supertrend mechanics with dynamic Fibonacci retracement grids and volatility-based channel bands directly on the chart. Traditional Supertrend systems rely solely on stop lines, often missing optimal retracement zones (OTE) during trend pullbacks. To solve this limitation, this script integrates dual operating modes—anchored OTE grids that project Fibonacci levels across active trend swings, and continuous Fibonacci channel bands scaled by Average True Range (ATR).
The indicator visualizes trend direction, dynamic stop losses, shaded OTE zones, and proximity-highlighted grid levels. The core calculations track trend swings using customizable ATR lookbacks, compute proportional Fibonacci levels (0.0 to 1.0), and dynamically adjust line widths and colors when price approaches specific thresholds. Custom color palettes, bar/candle color toggles, and label configurations allow traders to fine-tune visual settings across various timeframes and asset classes.
🔵 HOW IT WORKS
The system operates through an integrated architecture where each component dynamically influences chart behavior:
1 — Supertrend Trend & Swing Engine
Stop Loss Line & Fills: Computes volatility-scaled Supertrend lines using ATR parameters, plotting colored stop-loss streams with gradient area fills.
Trend Extreme Tracking: Automatically tracks trend highs and lows upon trend direction flips to anchor structural Fibonacci calculations.
2 — Dual Fibonacci Modes (OTE Grid & Bands)
OTE Grid Mode: Projects an anchored Fibonacci retracement grid (0.0, 0.236, 0.382, 0.500, 0.618, 0.705, 0.786, 1.000) across the active trend swing, complete with a shaded Optimal Trade Entry (OTE) zone between the 0.618 and 0.786 levels.
Fibonacci Bands Mode: Plots continuous, ATR-scaled channel bands extending outward from the Supertrend line using proportional ratio offsets.
3 — Proximity Highlight & Styling Engine
Price Proximity Detection: Measures distance between price and individual grid levels using ATR multipliers to dynamically highlight active levels with distinct colors and thicker line widths.
Visual Customization: Supports bar and custom candle coloring by trend, adjustable line styles (Solid, Dotted, Dashed), and dynamic right-edge price labels.
🔵 HOW TO USE
Apart from serving as a comprehensive trend and retracement mapping tool, the indicator can be applied in several ways:
Follow Trend Momentum: Stay aligned with prevailing market direction by monitoring the Supertrend line color and trend-colored candles/bars.
Identify OTE Retracement Zones: In OTE Grid mode, monitor the shaded zone between the 0.618 and 0.786 Fibonacci levels for potential trend continuation entries during pullbacks.
Track Key Level Interactions: Watch for automatic color highlights and width changes on grid levels as price approaches critical Fibonacci thresholds.
🔵 SETTINGS
The indicator includes several customizable configuration groups to tailor calculations and visual styling to your trading style:
General Settings: Select between OTE Grid and Fibonacci Bands modes, toggle right-edge price/ratio labels, choose grid line styles (Solid, Dotted, Dashed), adjust grid highlight distance thresholds via ATR multipliers, and enable dimming for non-OTE levels.
Supertrend Parameters: Configure the ATR Period and Multiplier to adjust the sensitivity and distance of the core stop-loss line.
Fibonacci Bands Parameters: Define the ATR period and outer band multiplier specifically used when operating in Fibonacci Bands mode.
Main Styling & Colors: Set bullish and active price highlight colors, and toggle bar/candle coloring based on the active trend direction.
Fibonacci Level Settings: Enable or disable individual Fibonacci ratios (0.000, 0.236, 0.382, 0.500, 0.618, 0.705, 0.786, 1.000) and customize their individual display colors.
🔵 NOTES
Why this implementation is unique:
It merges classic Supertrend stop mechanics with both anchored OTE grids and continuous Fibonacci channel bands.
Features dynamic price proximity highlighting and custom linefill engines optimized for Pine Script version 6.
Provides extensive modular inputs for styling, level visibility, and operational mode switching.
インジケーター

JFX Structure FibJFX Structure Fib
ENGLISH
JFX Structure Fib is a multi-timeframe market-structure and automatic Fibonacci retracement framework designed for discretionary traders. It does not generate BUY/SELL signals or manage trades. Its purpose is to organize higher-timeframe directional context, confirmed chart-timeframe structure breaks, and retracement levels into one clean workflow.
HOW IT WORKS
1. Adaptive bias timeframe
By default, the script automatically assigns a higher bias timeframe according to the active chart timeframe. Examples include M5 -> H1 and M15 -> H4. A Custom mode is also available for users who prefer a different higher-timeframe relationship.
2. Confirmed higher-timeframe bias
The bias engine reads confirmed higher-timeframe structure. An optional Structure + EMA mode can require both structural direction and EMA alignment. The higher-timeframe values are based on completed higher-timeframe bars to reduce discrepancies between historical and realtime behavior.
3. Valid chart-timeframe BOS
The script displays only BOS events that meet its structural rules. A valid BOS requires a confirmed close through a confirmed swing that has not already been counted as broken, alignment with the active higher-timeframe bias, and a valid opposite structural swing after the broken swing to serve as the impulse origin.
4. BOS-origin impulse tracking
After a valid BOS, the script tracks the continuing impulse rather than fixing the Fibonacci endpoint immediately. The impulse extreme remains dynamic until price produces the configured confirmed retracement. This reduces arbitrary Fibonacci anchoring while an impulse is still extending.
5. Automatic Fibonacci lock
When the retracement threshold is confirmed, the impulse is locked and the script plots four configurable Fibonacci retracement levels. Defaults are 0.618, 0.705, 0.790, and 0.886. The chart displays ratio values only, without prices.
6. Fibonacci history
Completed or superseded Fibonacci structures can be retained as bounded historical references. Users can choose how many recent Fibonacci structures remain visible. Historical levels are visually muted so the active structure remains easy to identify.
7. Compact dashboard
The dashboard summarizes the chart-to-bias timeframe mapping, confirmed higher-timeframe bias, current structural direction, Fibonacci state, and retained Fibonacci history.
HOW TO USE IT
- Apply the indicator to the timeframe on which you want to analyze structure.
- Leave Bias timeframe mode on Auto for the default multi-timeframe mapping, or select Custom if your framework uses a different higher timeframe.
- A bullish or bearish BOS is displayed only when the script's validity conditions are satisfied.
- After the post-BOS impulse retraces by the configured lock threshold, the Fibonacci structure becomes fixed and its retracement levels are displayed.
- Use the Fibonacci levels as location/context within your own trading plan. The script intentionally does not define entries, stop losses, take profits, or expected performance.
KEY SETTINGS
- Bias timeframe mode: Auto or Custom.
- Bias method: Structure or Structure + EMA.
- Bias and chart-structure pivot sensitivity.
- Use newest valid BOS: allows a newer valid BOS to supersede the current structure.
- Structure invalidation: close or wick beyond the impulse origin.
- Fibonacci lock retracement.
- Four customizable Fibonacci ratios.
- Optional minimum impulse size measured in ATR.
- Fibonacci history count.
- Optional bias/chart swing reference levels.
- BOS, Fibonacci, dashboard, and alert visibility controls.
ORIGINALITY AND PROTECTED-SOURCE RATIONALE
BOS, market structure, and Fibonacci retracement are established concepts and are not claimed as original inventions. The original contribution of this script is the specific workflow and implementation that connects adaptive higher-timeframe bias, valid BOS filtering, post-break structural-origin selection, dynamic impulse tracking, confirmed retracement locking, bounded Fibonacci lifecycle/history, and a chart-focused visual state model. The source is protected to preserve this implementation while allowing the community to use the indicator freely.
LIMITATIONS
- Confirmed pivots require right-side bars before a swing is known. This means structure detection intentionally has confirmation delay.
- The higher-timeframe bias uses completed higher-timeframe information, so it will react more slowly than an indicator using an unfinished higher-timeframe candle.
- The automatic timeframe mapping is a practical default, not a universal rule. Different instruments or trading plans may require Custom mode.
- BOS validity depends on the selected pivot sensitivities. Very low settings can identify more minor structure; higher settings can identify fewer but broader swings.
- Fibonacci levels describe retracement location only. They do not establish that price will reverse from a level.
- The script does not calculate trade entries, stop losses, take profits, win rate, profit factor, or profitability.
- A newer valid BOS can replace the active structure when that option is enabled.
- Market behavior varies by instrument, timeframe, volatility regime, session, data feed, and execution environment.
Use the indicator as an analytical framework and validate its behavior on the instruments and timeframes relevant to your own process before relying on it for live decisions.
BAHASA INDONESIA
JFX Structure Fib adalah framework market structure multi-timeframe dan automatic Fibonacci retracement untuk discretionary trader. Indikator ini tidak memberikan sinyal BUY/SELL dan tidak mengatur posisi trading. Tujuannya adalah menyusun higher-timeframe bias, valid chart-timeframe BOS, dan retracement Fibonacci dalam satu workflow yang bersih dan mudah dibaca.
CARA KERJA
1. Adaptive bias timeframe
Secara default indikator memilih bias timeframe yang lebih tinggi berdasarkan timeframe chart aktif. Contohnya M5 -> H1 dan M15 -> H4. Mode Custom tetap tersedia jika pengguna ingin menggunakan hubungan timeframe yang berbeda.
2. Confirmed higher-timeframe bias
Bias membaca structure dari higher timeframe yang sudah confirmed. Mode Structure + EMA dapat digunakan untuk meminta alignment tambahan dari EMA. Data higher timeframe berasal dari candle yang sudah selesai agar perilaku historical dan realtime lebih konsisten.
3. Valid chart-timeframe BOS
Indikator hanya menampilkan BOS yang memenuhi aturan structure. BOS harus terjadi melalui confirmed close pada confirmed swing yang belum pernah dihitung sebagai broken, searah dengan higher-timeframe bias, serta memiliki opposite structural swing yang valid setelah swing yang di-break untuk menjadi origin impulse.
4. BOS-origin impulse tracking
Setelah valid BOS, indikator tetap mengikuti extreme impulse selama impulse masih berkembang. Endpoint Fibonacci belum langsung dikunci. Extreme baru dikunci setelah terjadi confirmed retracement sesuai threshold yang dipilih.
5. Automatic Fibonacci lock
Setelah retracement threshold terkonfirmasi, Fibonacci dikunci dan empat retracement level ditampilkan. Default: 0.618, 0.705, 0.790, dan 0.886. Chart hanya menampilkan angka ratio Fibonacci tanpa harga.
6. Fibonacci history
Fibonacci yang telah selesai atau digantikan dapat disimpan sebagai historical reference. Jumlah history dapat diatur oleh pengguna dan tampilannya dibuat lebih redup daripada Fibonacci aktif.
7. Compact dashboard
Dashboard menampilkan mapping chart timeframe ke bias timeframe, confirmed HTF bias, current structure, status Fibonacci, dan jumlah history yang sedang disimpan.
PENGGUNAAN
- Pasang indikator pada timeframe yang ingin digunakan untuk membaca structure.
- Gunakan Auto untuk mapping timeframe default, atau Custom jika menggunakan framework multi-timeframe sendiri.
- BOS bullish/bearish hanya muncul jika seluruh aturan validasinya terpenuhi.
- Setelah impulse pasca-BOS mengalami retracement sesuai threshold, Fibonacci dikunci dan level retracement ditampilkan.
- Gunakan Fibonacci sebagai area location/context dalam trading plan Anda sendiri. Indikator sengaja tidak menentukan entry, stop loss, take profit, atau ekspektasi hasil trading.
ORIGINALITAS DAN ALASAN SOURCE DILINDUNGI
BOS, market structure, dan Fibonacci retracement merupakan konsep yang sudah umum dan tidak diklaim sebagai penemuan baru. Nilai original script ini terletak pada workflow dan implementasinya: adaptive HTF bias, valid BOS filtering, pemilihan structural origin setelah break, dynamic impulse tracking, confirmed retracement lock, bounded Fibonacci history, serta visual state yang dibangun menjadi satu framework. Source dilindungi untuk menjaga implementasi tersebut sementara indikator tetap dapat digunakan gratis oleh komunitas.
KETERBATASAN
- Confirmed pivot membutuhkan sejumlah candle di sisi kanan sehingga swing diketahui dengan delay yang disengaja.
- Bias HTF menggunakan candle HTF yang sudah selesai sehingga lebih lambat dibandingkan metode yang membaca unfinished HTF candle.
- Auto timeframe mapping adalah default praktis dan bukan aturan universal.
- Sensitivitas BOS tergantung pada pivot settings yang digunakan.
- Fibonacci hanya menunjukkan lokasi retracement dan tidak menjamin reversal.
- Indikator tidak menghitung entry, SL, TP, win rate, Profit Factor, atau profitabilitas.
- Valid BOS yang lebih baru dapat menggantikan active structure jika opsi tersebut diaktifkan.
- Hasil visual dan perilaku structure dapat berbeda menurut instrument, timeframe, volatility regime, session, dan data feed.
Gunakan indikator sebagai analytical framework dan lakukan validasi pada instrument serta timeframe yang sesuai dengan proses trading Anda sebelum menggunakannya dalam keputusan live.
インジケーター

Liquidity & FVG Engine MTF [Pro]Liquidity & FVG Engine MTF
OVERVIEW
This tool watches price the way a discretionary ICT trader watches it: it keeps track of untouched swing highs and lows across several timeframes at once, flags the moment one of those levels actually gets taken out, and then looks for the Fair Value Gap that tends to show up right after that liquidity grab. Instead of forcing you to flip between chart timeframes to manually mark highs and lows, it does that bookkeeping for you and leaves a clean, readable map of what has been swept, what is still resting, and where price left a gap on its way through.
HOW IT THINKS
Every time a pivot high or low forms on any of the timeframes you enable (1H and 4H by default, with Daily, Weekly and a custom timeframe also available), the script stores it as a pending liquidity level and marks it with a dot. That level stays on the chart, untouched, until price actually interacts with it.
When price takes out a level, the indicator does three things at once. It fades the dot into a swept line so you can see exactly where and when liquidity was taken. It checks the impulse that caused the sweep for a Fair Value Gap, since sweeps and gaps tend to travel together in this kind of price action. And if no gap is found immediately, it keeps watching the next several candles for a reversal gap to form, on the theory that the real move often shows up a few bars after the initial grab, not on the sweep candle itself.
SESSION LIQUIDITY
On top of the swing based levels, the script builds its own Asia and London session ranges directly from the UTC session hours, independent of your broker's timezone or the exchange your chart is set to. The high and low of each session become liquidity levels in their own right, and get swept and reacted to exactly like any swing high or low.
MITIGATED FVGs, EXPLAINED
A gap does not disappear the moment price touches it. What this indicator calls "mitigated" is simply a Fair Value Gap that has been revisited by price after it formed. The box does not vanish when that happens. It turns grey, gets tagged "Mitigated", and is kept on your chart as history rather than being deleted.
The reason that matters is that a mitigated gap is not necessarily a dead gap. Some get tapped once and hold, becoming the base of the next leg. Others get tapped and sliced straight through. Keeping the grey boxes visible for a while lets you scroll back and actually see which behaviour happened at that location, instead of having the evidence erased the instant it stops being "active". You control how many of these grey boxes stay on your chart at once through the history setting, so you can keep as much or as little of that visual record as you want without cluttering the chart forever.
A PRACTICAL WAY TO USE IT
None of this is a signal generator that tells you to buy or sell. It is a map, and the way most people use a map like this is roughly the same three step read every time.
Note which liquidity level is still sitting untouched nearby, on whichever timeframe you trust for bias. An untouched high or low is a magnet until it isn't.
Wait for the sweep itself. A wick that pierces the level and a close that snaps back inside it is a very different event from a candle that just closes through and keeps going, so pay attention to which sweep mode you have configured and what actually happened on that candle.
Look at what the indicator draws immediately after the sweep. A fresh, opposite direction Fair Value Gap appearing in the following bars is the classic follow through many ICT style traders look for as confirmation that the sweep was a genuine reversal event rather than the start of a continuation.
From there, how a person actually structures the trade is personal. Some will look to enter on the first retracement into that fresh gap, treating its edge as an entry zone with a stop beyond the sweep wick. Others prefer to wait for a shift in short term structure after the gap forms before committing, using the gap as confluence rather than as the trigger itself. Either way, the mitigated gap history is useful here too, since it lets you go back and study how price has behaved around similar gaps at similar levels earlier in the session, which is a quick way to build a feel for whether the pair or symbol you're trading tends to respect these zones cleanly or chop through them.
Treat every level and every gap as one piece of evidence, not a standalone signal. The most convincing setups tend to be where a session liquidity sweep, a higher timeframe level, and a fresh FVG all line up in the same place at the same time, rather than any single one of them appearing in isolation.
SETTINGS AT A GLANCE
Pivot Left and Right Bars control how sensitive swing detection is. Lower values catch more, smaller swings.
Merge Tolerance lets nearby levels from different timeframes combine into a single label instead of stacking duplicate dots on top of each other.
Sweep Detection Mode switches between a strict wick and close ICT style sweep, or a looser touch based definition.
Up to five independent timeframes can be enabled for swing liquidity, each with its own colour and label.
Asia and London session ranges can be toggled on or off independently, with their own colours.
The FVG engine has its own ATR based minimum and maximum size filters, so you can exclude gaps that are too small to matter or too large to be realistic entries.
Visual and memory settings let you cap how many active levels, historical swept lines, and mitigated FVGs stay on the chart at once, keeping things readable on lower timeframes over long sessions.
ALERTS
Two alert conditions are built in. One fires the moment any liquidity level is swept. The other fires when a Fair Value Gap forms following a sweep. Both can be wired into TradingView's standard alert system so you do not have to watch the chart tick by tick.
A NOTE ON RISK
This script is a decision support tool, not a trading signal or a promise of future performance. It plots historical and current price behaviour so you can build and test your own approach around it. Always use proper risk management and position sizing, and treat any strategy built around it as something to validate on your own before trading it with real capital. Nothing in this description or in the indicator constitutes financial advice.
インジケーター

QC Radar - Multi-Timeframe Price Action [QuantCrawler]Track more. Display less.
QC Radar combines supply/demand origin zones, market structure, and fair value gaps across multiple timeframes with a proximity dashboard designed to keep the chart readable.
Instead of displaying every tracked zone at once, Radar prioritizes areas near current price. More distant areas continue updating in the background and become eligible for display as price approaches.
What makes Radar different?
Radar separates tracking from display.
An area can remain active without occupying chart space. The dashboard shows nearby zones, their exact ranges, distance from price, proximity status, and whether they are currently drawn or hidden.
This lets you follow higher-timeframe context while keeping your execution chart focused.
Main features
Multi-timeframe tracking
Use the chart timeframe plus two configurable higher-timeframe layers. Each layer can independently display structure/origin zones, FVGs, or both.
For example, track 15-minute and hourly areas while viewing a 1-minute or 5-minute chart.
Local and major structure
Two swing scales identify confirmed structure events:
• Break: a close beyond a confirmed swing that continues—or initially establishes—the structure direction.
• Shift: a structure break in the opposite direction.
Badges identify the timeframe and swing scale. Optional spacing and connectors help separate overlapping annotations.
Candle-anchored supply and demand
Following a confirmed structure break, Radar searches for the nearest qualifying opposite-direction candle within its search window.
Demand zones use that candle’s low through its upper body edge. Supply zones use its lower body edge through its high.
These are mechanically defined potential reaction areas, not measurements of resting institutional orders.
Fair value gaps
Radar identifies three-candle true fair value gaps:
• Bullish: the third candle’s low is above the first candle’s high.
• Bearish: the third candle’s high is below the first candle’s low.
Boundaries use those exact candle prices. Optional tick-size and ATR filters exclude smaller gaps without changing their dimensions.
FVGs can retire on first touch, midpoint reached, or full fill, evaluated using later completed candles on their own timeframe.
Proximity dashboard
Distances are measured to the nearest zone edge, with zero distance while price is inside.
Statuses include:
• INSIDE
• CLOSE
• NEAR
• WATCH
Choose points, percentage, or chart ATR as the distance unit. Chart visibility and dashboard range have separate controls, alongside a combined chart-zone limit.
Relative volume
Optional origin-volume labels compare the originating candle’s volume with the average of its preceding 20 source-timeframe candles.
A reading of 0.82x means volume was 18% below that average. This is not buy/sell delta or accumulated zone volume.
Getting started
The default setup enables chart-timeframe and 15-minute tracking. The second higher-timeframe slot defaults to one hour and starts disabled.
Proximity defaults are:
• CLOSE within 25 points
• Chart areas within 75 points
• Dashboard areas within 225 points
• Maximum four areas drawn
• Six dashboard rows
Adjust these distances for your instrument and chart timeframe based on your trading preference.
Dashboard size, position, and row count are in the first Inputs section.
Hover-help explanations are included throughout the settings.
Important behavior and limitations
Radar uses confirmed candles for structure and zone lifecycle changes. Higher-timeframe updates are applied at the first chart-bar close following the completed source candle.
Confirmed pivots require subsequent candles. Zones and structure lines are therefore visually anchored back to their origins after confirmation; they were not necessarily available at the timestamp where their drawing begins.
Proximity readings update with price, while invalidation and FVG retirement follow their confirmed source-timeframe rules.
Display limits, overlap filtering, and available history affect which areas are visible. Hidden does not mean invalidated, and the indicator does not maintain an unlimited historical archive.
Use standard time-based intraday candles. Enabled higher timeframes must be higher than—and exact multiples of—the chart timeframe.
QC Radar is a visual analysis tool. It does not place orders, provide guaranteed reactions, or establish profitability. Use independent analysis and risk management. インジケーター

Adaptive Market Regime MapAdaptive Market Regime Map is a chart-overlay context tool that separates directional conditions from volatility conditions. It is designed to help traders describe the current market environment without presenting buy or sell signals.
WHAT IT SHOWS
The indicator organizes market context into two layers:
• Directional regime: Bullish, Bearish, or Neutral
• Volatility state: Compressed, Normal, or Expanding
A layered corridor is plotted around an adaptive equilibrium line. Its width responds to ATR, while its color and intensity reflect the current directional regime and measured trend strength.
In bullish conditions, the lower half of the corridor is emphasized as support context. In bearish conditions, the upper half is emphasized as resistance context. These areas are descriptive context zones, not fixed support or resistance levels and not trade-entry signals.
HOW IT WORKS
The directional engine combines:
• the distance between a fast EMA and the equilibrium EMA, normalized by ATR;
• the slope of the equilibrium EMA, also normalized by ATR;
• path efficiency, calculated from net movement relative to total movement over the selected window.
The resulting directional score is bounded and compared with the Trend Threshold to classify the market as Bullish, Bearish, or Neutral.
The volatility engine compares current ATR with a moving baseline of ATR:
• below the Compression Ratio: Compressed
• above the Expansion Ratio: Expanding
• between both thresholds: Normal
The dashboard displays the current regime, normalized strength, volatility state, and the number of bars spent in the current directional regime.
HOW TO USE IT
Use the map as a context filter alongside your own analysis:
• Bullish indicates persistent positive directional structure.
• Bearish indicates persistent negative directional structure.
• Neutral indicates that directional strength is below the selected threshold.
• Compressed indicates volatility below its recent baseline.
• Expanding indicates volatility above its recent baseline.
The corridor can also provide visual context around the equilibrium line. Price moving outside the corridor does not, by itself, constitute a breakout or reversal signal.
INPUTS
Regime Engine
• Fast Length: Period of the faster EMA used in directional separation.
• Equilibrium Length: Period of the central EMA used for the corridor.
• Slope Lookback: Bars used to measure the equilibrium slope.
• Efficiency Length: Window used to compare net movement with total path movement.
• ATR Length: ATR period used for normalization and corridor width.
• Volatility Baseline: Window used for the rolling ATR baseline.
• Spread Weight and Slope Weight: Relative contribution of both directional components.
Classification
• Trend Threshold: Minimum absolute directional score required for a bullish or bearish regime.
• Compression Ratio: ATR-to-baseline ratio below which volatility is classified as compressed.
• Expansion Ratio: ATR-to-baseline ratio above which volatility is classified as expanding.
Regime Corridor
• Inner Zone ATR and Outer Zone ATR: Width of the two corridor layers.
• Show Outer Context Zone: Displays or hides the lighter outer layer.
• Show Equilibrium Line: Displays or hides the central line.
• Color Transition Bars: Controls how quickly a new regime color reaches full intensity. This affects presentation only.
• Tint Candles By Regime and Tint Chart Background: Optional visual context, disabled by default.
State Changes
• Label Confirmation Bars: Number of persistent state bars required before a label is displayed.
• Same-Label Minimum Distance: Minimum distance between labels of the same type.
• Neutral labels are optional and disabled by default.
ALERTS
The script provides five alert conditions:
• Market Regime Changed
• Bullish Regime Started
• Bearish Regime Started
• Compression Started
• Expansion Started
Alerts are confirmed on bar close by default. Label confirmation is separate from alert timing, so the optional label delay does not delay the corresponding regime alert.
REALTIME AND REPAINTING BEHAVIOR
The script does not use higher-timeframe requests, future data, offsets into the future, or lookahead logic. Historical classifications are calculated from information available on each bar.
On an open realtime bar, price, ATR, the corridor, and the displayed regime can change as new ticks arrive. With Confirm Alerts On Bar Close enabled, alerts trigger only after the bar is confirmed. This is the recommended setting for stable alert behavior.
LIMITATIONS
• This is an indicator, not a strategy or automated trading system.
• It does not predict future price movement.
• Bullish and bearish states are contextual classifications, not trade recommendations.
• The corridor provides volatility-scaled context and does not define fixed support or resistance levels.
• Results depend on symbol, timeframe, data quality, and selected parameters.
• Very short history can produce a warmup state until all calculations are available.
• Non-standard chart types use synthetic chart prices and may behave differently from standard OHLC charts.
ORIGINALITY
This script is an original implementation. Its distinctive contribution is the combination of an ATR-normalized directional engine, path-efficiency weighting, separate volatility classification, asymmetric regime-context zones, and a compact state dashboard in one causal chart overlay. インジケーター

Equalhigh EMA SignatureEqualhigh — EMA Signature v2
### User Manual
**Equalhigh — EMA Signature v2** is an adaptive statistical support indicator designed to identify the EMA that a specific asset historically respects the most.
Instead of assuming that EMA 20, 50, 100, or 200 is automatically relevant, the indicator scans a configurable range of EMA periods and determines which one has historically produced the most reliable price rebounds.
The objective is to identify the asset's own **EMA Signature**.
---
## Concept
Different securities often react to different moving-average periods.
One stock may repeatedly rebound from EMA 21, another from EMA 34, another from EMA 57.
This indicator attempts to quantify that behavior by testing many EMA candidates and ranking them according to their historical effectiveness as dynamic support.
The strongest EMA is plotted directly on the chart.
The second-best EMA can also be displayed.
---
## How It Works
For every EMA candidate, the indicator looks for historical support tests.
A valid support test requires price to approach the EMA from above and enter a tolerance zone around the EMA.
Once the EMA is touched, the indicator observes the following candles and evaluates whether price produces a meaningful rebound.
Each EMA is evaluated using several statistics:
* Number of historical tests
* Number of successful rebounds
* Hit rate
* Average rebound magnitude
* Frequency of support breakdowns
* Statistical confidence
* Sample size
The highest-ranked EMA becomes the current **EMA Signature**.
---
# EMA Signature Score
The indicator does not simply choose the EMA with the highest raw win rate.
A result such as:
**EMA 137: 2 successful rebounds out of 2 = 100%**
should not automatically beat:
**EMA 34: 23 successful rebounds out of 30 = 76.7%**
The first result has too little statistical evidence.
For this reason, Equalhigh — EMA Signature uses a composite score.
### Score structure
* **65% — Statistical reliability**
* **15% — Rebound strength**
* **10% — Sample depth**
* **10% — Support integrity**
Statistical reliability uses a **Wilson lower confidence bound**, which penalizes very small samples.
This makes the ranking significantly more robust than a simple hit-rate comparison.
---
# Main Chart Elements
## Best EMA Signature
The strongest historical EMA is plotted as the main highlighted line.
The label displays:
**EMA period**
and
**Signature Score**
Example:
> ★ EMA 34
> Score 76.8
This means EMA 34 currently has the strongest statistical support profile among all EMA periods tested.
---
## Second-Best EMA
The second-highest-ranked EMA can optionally be displayed.
This is useful because some securities do not have one unique support EMA, but rather a cluster of closely related EMA periods.
For example:
* EMA 32
* EMA 34
* EMA 38
may all rank highly.
This can indicate a broader **dynamic support zone** rather than one exact mathematical line.
---
# Top 5 Dashboard
The dashboard ranks the five strongest EMA candidates.
### EMA
EMA period being evaluated.
Example:
**34**
means EMA 34.
---
### SCORE
The Equalhigh EMA Signature Score.
Higher values indicate stronger historical evidence that the EMA acts as dynamic support.
A practical interpretation:
| Score | Interpretation |
| -------: | --------------------- |
| 75+ | Very strong signature |
| 65–75 | Strong |
| 55–65 | Moderate |
| 45–55 | Weak |
| Below 45 | Low confidence |
These levels should be interpreted comparatively rather than as absolute probabilities.
---
### TESTS
Number of historical support interactions detected for the EMA.
A larger sample generally increases confidence.
An EMA with 25–40 tests is statistically much more meaningful than one with only 3–5 tests.
---
### HIT
Percentage of historical EMA tests that produced the required rebound.
Example:
**78.6%**
means that approximately 79% of detected support tests met the selected rebound criteria.
---
### AVG
Average maximum rebound after successful EMA tests.
Example:
**+6.3%**
means successful historical tests produced an average maximum rebound of approximately 6.3% during the selected evaluation window.
---
### BREAK
Percentage of support tests where price clearly lost the EMA.
Lower is generally better.
Example:
**10.7%**
indicates relatively strong support integrity.
---
### BULL
Historical success rate when the support test occurred during the indicator's bullish market regime.
This allows the user to compare general EMA behavior with behavior during favorable market conditions.
---
# Rebound Detection
A support interaction is not counted simply because the candle touches the EMA.
The indicator checks several conditions.
### 1. Approach from above
Price must approach the EMA from above.
This is important because the indicator is specifically searching for **dynamic support**, not resistance.
---
### 2. EMA touch zone
Price does not need to touch the EMA perfectly.
A tolerance based on ATR is used.
This is more realistic than requiring exact contact because markets rarely reverse at mathematically perfect levels.
---
### 3. Support must remain valid
Price is allowed to temporarily move slightly below the EMA.
However, a sufficiently large close below the EMA is treated as a support failure.
---
### 4. Rebound confirmation
After the EMA interaction, price must rise by the selected minimum percentage within the selected evaluation window.
Example:
**Minimum rebound = 3%**
**Evaluation window = 10 bars**
A successful test requires price to produce at least a 3% rebound during the following 10 candles.
---
# Settings
## Minimum EMA
Defines the shortest EMA included in the scan.
Default:
**10**
---
## Maximum EMA
Defines the longest EMA included in the scan.
Default:
**250**
---
## EMA Step
Controls the distance between tested EMA periods.
Example:
Minimum EMA = 10
Maximum EMA = 250
Step = 5
The indicator tests:
10, 15, 20, 25, 30...250
### Recommended
Use:
**5** for fast exploration
**2** for normal use
**1** for maximum precision
A Step of 1 allows unusual signatures such as:
EMA 37
EMA 43
EMA 61
to be discovered.
---
# Statistical Lookback
Defines how much historical data is used to evaluate each EMA.
Default:
**750 bars**
On a Daily chart, this represents roughly three years of trading history.
A longer lookback provides more observations but may include outdated market behavior.
A shorter lookback adapts faster to structural changes but reduces sample size.
---
# EMA Touch Tolerance — ATR
Defines how close price must come to the EMA to qualify as a support test.
Default:
**0.20 ATR**
ATR-based tolerance automatically adapts to the volatility of the security.
This makes the indicator more transferable between low-volatility stocks and highly volatile assets.
---
# Maximum Break Tolerance — ATR
Determines how far price may close below the EMA before the support is considered broken.
Default:
**0.35 ATR**
Increasing this value allows more temporary undercuts.
Decreasing it makes support validation stricter.
---
# Rebound Evaluation Window
Number of bars available for price to confirm a rebound.
Default:
**10 bars**
On a Daily chart:
10 bars ≈ two trading weeks.
---
# Minimum Rebound %
Defines the minimum move required for an EMA interaction to be classified as successful.
Default:
**3%**
For volatile securities, a larger requirement may be appropriate.
For defensive or low-volatility securities, a smaller value may be preferable.
---
# Minimum Number of Tests
Defines the minimum historical sample required before an EMA can qualify for the ranking.
Default:
**5**
Increasing this value makes the model more selective.
For long historical datasets, values between **7 and 10** may provide stronger statistical confidence.
---
# Touch Cooldown
Prevents several consecutive candles around the same EMA from being counted as separate independent support events.
Default:
**5 bars**
Without a cooldown, one prolonged consolidation around an EMA could artificially create many support tests.
---
# Suggested Daily Settings
For most liquid equities:
| Setting | Suggested value |
| -------------------- | --------------: |
| Minimum EMA | 10 |
| Maximum EMA | 250 |
| EMA Step | 2 |
| Statistical Lookback | 750 |
| Touch Tolerance | 0.20 ATR |
| Break Tolerance | 0.35 ATR |
| Rebound Window | 10 bars |
| Minimum Rebound | 3% |
| Minimum Tests | 5 |
| Cooldown | 5 bars |
---
# Practical Workflow
A useful workflow is to start with:
**EMA 10 → 250**
**Step = 5**
This quickly identifies the broad area where the strongest EMA may exist.
For example, the results may show:
EMA 30
EMA 35
EMA 40
as the strongest group.
The user can then change:
**Step = 1**
to perform a finer scan.
The final result may reveal something such as:
> EMA 34 — Score 77
This becomes the asset's current **EMA Signature**.
---
# How to Use the Indicator
EMA Signature should generally be treated as a **support context tool**, not as a standalone buy signal.
The setup becomes more interesting when price approaches the Best EMA while other factors confirm the level.
Examples include:
* Rising volume on the rebound
* Bullish candle structure
* Relative strength improvement
* Previous horizontal support
* Gap support
* Fair Value zone
* Oversold momentum
* Positive market regime
* Higher-timeframe trend alignment
The strongest opportunities generally occur when several independent forms of support converge around the same price level.
---
# Example
Suppose the indicator identifies:
**EMA 36**
with:
* Score: 78
* Tests: 27
* Hit rate: 81%
* Average rebound: +6.4%
* Break rate: 11%
Price then falls back toward EMA 36.
This does **not** mean the stock has an 81% probability of rising.
It means that, according to the historical rules selected in the indicator, EMA 36 has produced successful rebounds in approximately 81% of comparable historical interactions.
The current market context still matters.
---
# Why the Best EMA Can Change
EMA Signature is adaptive.
The best EMA may change because:
* volatility changes,
* market regime changes,
* the stock enters a stronger trend,
* institutional behavior changes,
* historical observations are added,
* old observations leave the lookback window.
For example:
EMA 50 may dominate during a slow long-term trend.
Later, EMA 21 may become dominant during a strong momentum phase.
This is intentional.
---
# Important Statistical Considerations
Historical interactions are not fully independent events.
EMA periods are also highly correlated.
For example:
EMA 34 and EMA 35 will naturally produce similar values.
Therefore, the indicator should not be interpreted as discovering a mathematically unique "perfect EMA".
A group such as:
EMA 32
EMA 34
EMA 36
should often be interpreted as a **support family or support zone**.
---
# Limitations
The indicator is based on historical price behavior.
It cannot anticipate:
* earnings surprises,
* profit warnings,
* regulatory decisions,
* macroeconomic shocks,
* geopolitical events,
* takeover announcements,
* major fundamental changes.
A historically strong EMA can fail abruptly when market conditions change.
The model also does not prove causality.
Price may appear to react to an EMA because the EMA overlaps with another important technical or fundamental price level.
---
# Best Use
Equalhigh — EMA Signature v2 is particularly useful for:
* Pullback trading
* Trend continuation setups
* Swing trading
* Dynamic support analysis
* Finding non-standard EMA periods
* Comparing support quality between securities
* Identifying repeated institutional price behavior
* Locating potential re-entry zones after a trend pullback
---
## Final Principle
Traditional technical analysis asks:
> **Does this stock respect EMA 20, EMA 50 or EMA 200?**
Equalhigh — EMA Signature asks a different question:
> **Which EMA has this stock actually respected the most?**
The indicator then lets the historical data provide the answer.
---
**Equalhigh — EMA Signature v2**
*Adaptive EMA discovery through statistical rebound analysis.*
**Disclaimer:** This indicator is provided for research and educational purposes only. Historical statistical behavior does not guarantee future performance and should not be considered financial advice.
インジケーター
