Round Number Levels - Response and ControlRound Number Levels - Response and Control
Round Number Levels - Response and Control draws a fixed round-number grid and examines what confirmed closes do after price contacts its levels. Two shifted reference grids provide a comparison, using contacts matched by time, approach direction and pre-contact market context.
Use it to keep price levels visible and investigate whether their observed response differs from nearby, equally spaced references. Negative differences, disagreement between the references and insufficient data are all possible results. The indicator does not assume that round numbers must act as support or resistance.
GETTING STARTED
Use a standard time-based chart and check the Interval value before interpreting any statistics. The default interval is 200 minimum ticks, not 200 pips and not a universal setting for every market. This equals 0.200 when the minimum tick is 0.001, or 0.00200 when the minimum tick is 0.00001. Manual price mode lets you specify the interval directly in price units, rounded to whole minimum ticks.
Keep the Compact panel for the main comparison. Standard adds coverage information; Research exposes the detailed sample, individual references and exact-level history. Hover over panel rows and badges for definitions and counts. A Low N or Partial status is information about the available sample, not an instruction to search for settings that produce a preferred result.
For a repeatable study, set the price interval, date window and observation rules before evaluating the displayed differences. Display-only settings, including badge sizes, colors, marker limits and panel detail, do not change the research.
THE FIXED PRICE GRID
ROUND levels are integer multiples of the chosen interval, measured from price zero. The levels are defined before their reactions are observed; the script does not move them toward historical pivots or keep only levels that previously worked.
By default, cyan marks ordinary levels, yellow emphasizes every fifth interval, green marks the enclosing lower level, and pink marks the enclosing upper level. The enclosing colors take priority when a level also qualifies as a major level. The panel shows the exact enclosing prices, tick distances and position within that interval. Optional half-interval guides appear only when the interval contains an even number of ticks. These subdivisions and visual emphasis do not create additional research cohorts.
The opaque price badges use compact, bold monospace digits: 13 points for ordinary round numbers and 14 points for major or enclosing levels. Their fill follows the level color, with automatically selected black or white text. An opaque dark background is also available. Font sizes remain independently adjustable. The default text contains the price only; L/U and major-level prefixes can be restored.
Badges retain the exact level in their text even when displaced for readability. Optional connectors join them to the corresponding horizontal line. The default position is to the left of the line segment, with an additional twelve-bar horizontal gap and a small vertical offset. Badge placement does not change the line price. Very tight spacing or strong chart compression can still cause visual overlap.
Two automatic preview modes choose a 1-2-5 interval once from the first usable prior range or price context. The panel explicitly identifies PREVIEW because the choice can change with the loaded starting history. Copy its displayed interval into Manual price to fix the interval for a repeatable study.
REFERENCE A AND REFERENCE B
Reference A is shifted by 37% of the interval by default, rounded to minimum ticks. Reference B uses the exact complementary tick offset, normally close to 63%. Both references have the same spacing as ROUND. Their lines are optional and hidden by default, but research continues while they are hidden.
All three contact bands must be separate. Overlapping bands pause the comparison rather than creating indistinguishable cohorts. Shifted prices can still be round numbers at a finer scale. These are observational reference grids, not randomized placebos.
CONTACTS AND CONFIRMED OUTCOMES
A contact occurs when a candle's high-low range intersects the band around one grid level. The default half-width is 4% of the interval, with a one-tick minimum. The preceding close must be outside that band by the required clearance; the default clearance is 12% of the interval, with a minimum of one tick beyond the band.
The same bar-quality exclusion applies to all grids. If the opening gap crosses an entire band in any grid, or the candle touches more than one level band in any grid, none of the three grids admits a new contact on that bar. Already active observations continue. This avoids assigning a precise new contact to ambiguous OHLC data.
Every eligible contact is tracked, including contacts that start while earlier ones are unresolved. There is no outcome-dependent busy state or cooldown. A contact is not discarded merely because an earlier observation is taking longer to resolve.
The response distance is fixed at contact. It can be a fraction of the grid interval or a multiple of the preceding finite mean true range. The default is 20% of the interval. The threshold is at least one tick beyond the contact band and does not move with subsequent volatility.
The contact candle is excluded from outcome testing. Subsequent confirmed closes determine the result:
R, Return: the configured number of consecutive closes is at or beyond the threshold on the side from which price approached.
T, Through: the configured number of consecutive closes is at or beyond the threshold on the opposite side.
U, Unresolved: neither condition has been confirmed by the end of the full observation horizon.
Each consecutive-close counter resets when its own condition is not satisfied. The first confirmed R or T result is fixed. A confirmation on the last allowed bar takes precedence over U. Defaults are two consecutive closes within twelve bars after contact; the effective horizon is never shorter than the confirmation count.
These outcomes are not intrabar first touches, executions or trade returns. No entry, stop, target, spread, fee or position-sizing model is applied.
HOW THE MATCHED COMPARISON IS BUILT
The panel does not compare three independently truncated latest-N lists. Its main sample consists of triplets containing one ROUND contact, one A contact and one B contact.
Time is divided into fixed elapsed-time blocks anchored to the Unix epoch. The default block is 128 chart periods, equivalent to 640 elapsed minutes on a five-minute chart. Blocks are not exchange sessions and do not count only traded bars. Loading more preceding history does not move their boundaries. Weekly and monthly chart periods use the platform's seconds conversion rather than calendar-aligned week or month boundaries.
Within a block, contacts are grouped by approach side and optional prior context. The default Side + range + trend mode uses three range groups and three trend groups, separately for approaches from above and below. Side only and Side + range are also available.
Range grouping uses the preceding finite mean true range divided by the fixed interval, with default boundaries of 0.25 and 0.75. Values below 0.25 enter the low group, values from 0.25 to below 0.75 enter the middle group, and values at or above 0.75 enter the high group.
Trend grouping uses the preceding close minus the close ten bars before it. The default neutral band is plus or minus 0.5 times the preceding mean range; values on either boundary remain neutral. All context inputs come from preceding bars, not subsequent outcomes.
Inside each block and context group, the first eligible ROUND, A and B contacts are assigned together, then the second contacts, and so on. The default matching cap is the first eight contacts per grid, context group and block. Later contacts are still observed and exported, but do not enter matching. Their exclusion is counted separately.
A complete triplet must satisfy a fixed maximum spread between its earliest and latest contact times, defaulting to half a block. Failed triplets are not reassigned to different partners. Neither matching nor this time filter consults R/T/U results or resolution speed.
EVERY CONTACT RECEIVES THE SAME HORIZON
Early confirmation does not produce early inclusion in the comparison. Every observation must receive the full configured horizon before contributing, including results already known after only a few bars.
Only complete time blocks whose contacts have all had that horizon enter the panel. Blocks cut by the study dates or the beginning of usable history are excluded. The default window contains the latest twenty-four mature elapsed-time blocks. The study start is inclusive and the study end is exclusive; already admitted contacts continue to receive their horizon after the end date.
Matching gives the three cohorts identical counts by time block, approach side and context group. It does not make their price paths identical. Context groups remain broad, contact horizons can overlap, and unmeasured conditions can differ. Standard and Research show how much of the full contact population the matched sample covers.
READING THE COMPACT PANEL
The default panel has fourteen rows. The MATCHED section uses the same triplets for every main-sample percentage and difference.
N each grid shows the actual denominator: ROUND on the left and A / B on the right. All three numbers are equal. They are neither storage capacities nor counts of visible markers.
Return, Through and Unresolved show the ROUND share and the arithmetic mean of the A and B shares. U stays in the denominator. Hover over a row to see the separate A and B values and underlying counts.
R delta A / B shows ROUND's return share minus A's on the left, and ROUND's return share minus B's on the right. Values are percentage points, not percentage changes or predicted probabilities.
Mean / A-B shows the arithmetic mean of those two differences and their sign relationship. Both + means both are positive; Both - means both are negative. SPLIT means they have opposite signs. Has zero means one or both differences is exactly zero. A positive mean never hides a SPLIT. These labels describe signs, not statistical significance or confidence.
Early / Late splits the retained clock window into two contiguous halves. Each half has its own smaller matched denominator, shown in the tooltip. This is a historical period comparison, not a held-out test.
Main differences require at least thirty matched triplets, five from each approach side and three contributing blocks by default. Half-window comparisons use their own smaller guards. Below the requirements, counts and outcome shares remain visible while the affected differences are withheld. The guards prevent very small comparisons from looking definitive; they are not significance tests.
Standard has twenty-two rows and adds all mature contacts, matched coverage, over-cap contacts, contributing blocks, time spread and window coverage. Research has thirty-two rows and adds matched history at the exact enclosing levels, side counts, separate A/B outcomes, shared exclusions and reproduction details.
MARKERS, LIVE CONTEXT AND ALERTS
R/T/U markers appear on the confirmed bar when an outcome becomes known. Their time is never moved back to the contact bar. Default placement is outside the outcome candle and two preceding candles, plus a range-based margin. The vertical location is for readability, not the studied price or an execution price.
Several outcomes can resolve on one bar. The displayed badge represents the oldest contact resolving there; a plus sign, such as R+, means additional outcomes exist. The tooltip lists the R/T/U counts for that bar. Marker thinning and the maximum marker count affect drawing only.
Markers describe eligible ROUND outcomes before matching. The panel describes matched, fully mature triplets. Counting the chart markers therefore cannot reproduce the panel denominator. Optional threshold lines show only the latest unresolved ROUND contact to limit clutter; other observations continue independently.
The live reference price, enclosing levels, distances and cell shading can update during an open candle. Observation results are updated only on confirmed bars. The panel's matched sample uses closed, fully mature clock blocks, so it does not necessarily change on every new candle.
Four alert conditions are available: a newly admitted ROUND contact, one or more confirmed Return outcomes, one or more confirmed Through outcomes, and one or more Unresolved outcomes. They describe observation events rather than trade instructions. More than one outcome type can occur on the same bar, independently of which representative marker is visible. Create the required alerts in the alert dialog. Recreate existing alerts after changing research settings so that they use the intended configuration.
REPRODUCIBILITY AND NUMERIC RECORDS
Research uses a finite simple mean of tick-quantized true range rather than recursively seeded Wilder ATR. With manual spacing, the same settings and sufficient identical preceding OHLC, extra earlier history does not shift the later context calculations or epoch-based block boundaries. Data revisions, sessions, price adjustments and missing bars can still change results.
Require full start-date context pauses research unless loaded history crosses the requested start with adequate preceding context. Otherwise, the initial partial block is excluded and incomplete coverage is reported. Fixed / full describes coverage of the displayed window; it does not certify the entire requested history or statistical validity.
The RN6_ Data Window outputs retain research protocol 6001. They expose the settings, reported clock window, actual matched N, A/B differences, their mean, sign status and a non-cryptographic OHLC checksum. Equivalent records are emitted for all three grids: contact time, level in ticks, approach side, fixed threshold, result, first confirmation age, context group and ordinal.
Each record is emitted exactly H bars after contact. This permits at most one complete record per grid per bar, even when several early outcomes resolve together. Unmatched and over-cap contacts are still recorded. A negative ordinal marks a partial or date-cut block excluded from panel statistics. Pending contacts are not presented as completed records.
For recomputation, preserve the source, settings and native OHLC export, including sufficient context before the window and the following horizon. The checksum helps identify differences in included data; it is not a cryptographic signature. The optional Pine Logs recipe is a convenience for personal editor copies, not a requirement for using the published indicator.
DESIGN PURPOSE AND LIMITATIONS
The research layer is designed to test a fixed price reference rather than select levels after seeing their reactions. Its contribution is the combination of concurrent observation, shared admission rules, prior-context ordinal matching, a time-spread limit, uniform maturity, identical displayed denominators, explicit disagreement between two references, and symmetrical records for independent recomputation.
This remains observational analysis. Repeated contacts are not independent trials; matching can retain only part of the full population; the first-K limit and context boundaries affect the subset being studied. Changing the interval, period or rules after inspecting results introduces selection risk. Small, negative or inconsistent differences are legitimate findings.
The indicator is free and open-source. It places no orders, fetches no external data and requires no external service. Research is limited to standard time-based charts. Non-standard and tick charts retain the price grid without the research comparison. Neither a positive difference nor a Both + status proves a causal round-number effect, forecasts a future reversal or establishes a profitable trading strategy. 指標

Smart AVWAPs## Smart AVWAPs
Smart AVWAPs is a multi-anchored VWAP indicator designed for swing traders who want to identify areas where several important volume-weighted price levels converge.
Instead of anchoring VWAPs to every minor swing, the indicator automatically creates AVWAPs from selected high-importance events:
* High relative volume swing highs and lows
* Earnings gaps
* 52-week highs and lows
* Major reversal candles with elevated volume
The indicator keeps the most recent active AVWAPs on the chart, making it easier to visually identify price zones where multiple anchored VWAPs overlap or compress.
### How to Use
AVWAP convergence can highlight areas where participants anchored to different market events have similar volume-weighted cost bases.
For swing trading, these areas can be monitored as potential support, resistance, consolidation, or breakout zones.
A typical workflow is:
1. Look for several AVWAPs converging within a narrow price range.
2. Observe how price behaves around the convergence area.
3. Wait for confirmation such as a strong breakout, reclaim, increased relative volume, or successful retest.
4. Use broader trend, market structure, and risk management before taking a position.
AVWAP convergence itself is not intended to be an automatic buy or sell signal.
### Inputs
**Active AVWAPs**
Controls the maximum number of recent AVWAP anchors displayed.
**Pivot Left / Right**
Controls the sensitivity of swing-high and swing-low detection.
**Minimum RVOL**
Requires a swing or reversal candle to have elevated volume relative to its recent average.
**Earnings Gap %**
Defines the minimum price gap required for an earnings event to create an anchor.
**Reversal ATR**
Controls how large a reversal candle must be relative to ATR before it qualifies as a significant anchor.
### Intended Use
The indicator is primarily designed for daily-chart swing trading, but the settings can be adjusted for other timeframes and trading styles.
It is best used as a visual confluence tool rather than as a standalone trading system.
For research and educational purposes only. This indicator does not provide financial advice or guarantee future mar
指標

Adaptive Path Efficiency ProfileOVERVIEW
Adaptive Path Efficiency Profile is a price-region analysis tool designed to study how efficiently price has historically traveled through different areas of the chart.
Instead of treating every price level equally, the indicator evaluates completed price paths and organizes their behavior spatially. Its purpose is to distinguish regions associated with relatively efficient directional travel from regions associated with greater rotation or churn.
The central question is:
Where has price historically moved efficiently, and where has movement required more path activity to produce less directional progress?
CORE METHODOLOGY
The framework follows this sequence:
Completed Price Path → Path Distance → Net Displacement → Path Efficiency → Spatial Mapping → Efficiency/Churn Profile → Core Regions
For each completed observation window, the script measures the total distance traveled by price and compares it with the net displacement produced over the same path.
A relatively direct path produces higher efficiency.
A path containing more back-and-forth movement relative to its net displacement produces greater churn.
The observations are then distributed across the price regions traversed by those paths, creating a spatial profile of historical behavior.
PATH EFFICIENCY
Efficiency describes the relationship between net directional displacement and the cumulative distance traveled by price.
Higher readings indicate that, within the analyzed sample, price paths have tended to convert more of their movement into directional progress.
Lower readings indicate that a greater portion of movement has been consumed by rotation or back-and-forth travel.
Efficiency is a behavioral measurement. It is not a probability, win rate, or prediction of future price direction.
CHURN
Churn represents the complementary side of path efficiency.
Higher churn indicates regions where historical paths contained more rotational movement relative to their resulting displacement.
This can help distinguish structurally different price environments without classifying either condition as inherently bullish or bearish.
DISPLACEMENT CONTEXT
The engine also normalizes path displacement relative to ATR.
This prevents raw price movement from being interpreted identically across instruments with different volatility and price scales.
Displacement contributes context to the profile rather than functioning as an independent directional signal.
SPATIAL PROFILE
Historical path observations are mapped into price rows according to the regions they traversed.
The visual profile uses three contextual states:
Teal — efficiency-dominant regions
Rose — churn-dominant regions
Violet — mixed or transitional regions
Profile width represents the relative strength of the corresponding behavioral evidence within the current observation window.
EFFICIENCY CORE
The Efficiency Core identifies the price region containing the strongest combination of path efficiency, displacement context, and accumulated evidence within the analyzed sample.
It should be interpreted as a historical behavioral reference rather than support, resistance, or a price target.
CHURN CORE
The Churn Core identifies the region where rotational behavior is most pronounced relative to the available sample.
Comparing current price with the Efficiency Core and Churn Core provides additional spatial context for the dashboard.
REGIME CLASSIFICATION
The dashboard summarizes the aggregate path environment as:
DIRECTIONAL — efficiency is comparatively dominant.
ROTATIONAL — churn is comparatively dominant.
TRANSITION — neither condition is sufficiently dominant.
The dashboard also reports Efficiency, Churn, normalized Displacement, and the current price position relative to the two core regions.
HOW TO USE
The indicator is designed primarily as a market-context tool.
Users can examine whether current price is interacting with historically efficient or rotational regions, compare behavioral structure across instruments, and observe how the profile changes as new completed paths enter the observation window.
The profile can also provide context alongside independent market-structure, trend, volatility, or risk analysis.
No individual profile region should be interpreted as a standalone entry or exit instruction.
CONFIRMATION AND LIMITATIONS
The indicator uses chart-derived OHLC data and ATR normalization. It does not use exchange order-book liquidity, transaction-level footprint data, or future information.
Its profile describes behavior observed within a rolling historical sample. As that sample changes, profile regions and core locations can also change.
Efficiency does not imply that price will continue moving efficiently through the same region in the future. Churn does not guarantee consolidation or reversal.
The classifications are analytical descriptions of historical path behavior, not probabilities or performance forecasts.
ORIGINALITY
Adaptive Path Efficiency Profile was independently developed as a spatial path-behavior framework.
Rather than displaying conventional volume-at-price or combining common trend indicators, it maps completed price-path efficiency and rotational behavior back into the price regions those paths traversed.
Its distinctive analytical structure is:
Path Geometry → Normalized Displacement → Regional Evidence → Efficiency/Churn Competition → Core Extraction → Market Regime
The resulting profile is intended to provide a different representation of how efficiently price has historically moved through market structure. 指標

Fisher Transform of Williams %R - DivergenceFisher Transform of Williams %R — Divergence
Overview
This indicator applies John Ehlers' Fisher Transform to Larry Williams' %R oscillator, then layers a pivot-based regular/hidden divergence engine and a Fisher/Trigger crossover signal on top of it. The goal is to combine the sharp, well-defined turning points that the Fisher Transform produces with the momentum context of Williams %R, so that reversals show up as cleaner, more clearly separated peaks and troughs than the raw oscillator gives you — and then to automatically flag price/oscillator divergences at those points.
Credits
The Fisher Transform is a statistical technique introduced to trading by John F. Ehlers (see his paper "Using The Fisher Transform," Stocks & Commodities magazine). It converts an oscillator's probability distribution into a roughly Gaussian (bell-curve) distribution, which sharpens turning points and reduces the ambiguity that flat, range-bound oscillator readings normally produce.
Williams %R is a momentum oscillator developed by Larry Williams, measuring the current close relative to the high-low range over a lookback period.
This script normalizes Williams %R to a 0–1 range and runs that normalized value through Ehlers' Fisher Transform formula, rather than applying the transform to raw price or to a different oscillator. The divergence engine, cross-signal logic, zone filtering, and signal-spacing controls are original additions built for this script.
How it works
Williams %R is calculated over Williams %R Length bars: 100 × (source − highest high) / (highest high − lowest low).
That value is normalized to a 0–1 range using the highest/lowest %R over Fisher Transform Length bars, then rescaled to −1…+1.
The normalized value is smoothed (0.66 × normalized + 0.67 × previous) and clamped to ±0.999 to keep the Fisher formula well-defined.
The Fisher Transform is applied: 0.5 × ln((1+x)/(1−x)) + 0.5 × previous Fisher value. This is the plotted "Fisher %R" line.
A one-bar-delayed copy of the Fisher line acts as the Trigger line, used for crossover signals.
Divergence detection: the script finds confirmed pivot highs/lows on the Fisher line (using Pivot Left/Right Lookback), then looks back within a Min/Max Lookback Range window for a prior pivot of the same type to compare against price:
Regular Bullish: price makes a lower low while Fisher makes a higher low (potential reversal up).
Hidden Bullish: price makes a higher low while Fisher makes a lower low (trend continuation up).
Regular Bearish / Hidden Bearish: mirror logic on pivot highs.
Cross signals: independent triangle markers plot whenever the Fisher line crosses above/below its own Trigger line — a faster, divergence-independent momentum confirmation.
Parameters
Williams %R Length — lookback for the base %R calculation; shorter = more responsive, noisier.
Fisher Transform Length — lookback used to normalize %R before the transform; controls how "stretched" the Fisher output is.
Source — price input for %R (default close).
Overbought / Oversold Level — Fisher levels used for the background zone and, optionally, to filter divergence signals.
Pivot Left/Right Lookback — bars required on each side to confirm a swing high/low on the Fisher line; larger values = fewer but more reliable pivots.
Max/Min Lookback Range — bar-distance window searched for a comparable prior pivot when checking divergence.
Min Bars Between Same-Type Signals — cooldown to suppress rapid repeat signals of the same type.
Show Regular/Hidden Divergence — toggle each divergence class independently.
Require OB/OS Zone for Divergence — when on, only fires divergence signals when the relevant pivot is inside the overbought/oversold zone, cutting down low-quality mid-range signals.
Show Fisher/Trigger Cross Signals — toggle the crossover triangles.
Color inputs — purely visual, no effect on signal logic.
How to use it
Watch the Fisher line relative to the Trigger line and the OB/OS zone the way you would any oscillator, but expect sharper, more decisive turns than plain Williams %R.
Solid divergence lines/labels ("Reg Bull," "Reg Bear") mark classic reversal-warning divergences; dashed ones ("Hdn Bull," "Hdn Bear") mark continuation divergences, useful for adding to an existing trend rather than fading it.
Triangle cross signals can be used as a faster, standalone trigger, or as confirmation once a divergence has printed.
All four divergence types and both cross directions have built-in alertcondition() calls, so alerts can be set directly from the "Create Alert" dialog without any manual configuration.
What it solves / how it differs from other tools
Plain Williams %R divergence detection is noisy because %R saturates near ±100 across a wide range of price action, blurring pivots. Running it through the Fisher Transform first compresses that noise into sharper, more Gaussian-shaped peaks, giving divergence detection a cleaner signal to work from than a raw-oscillator approach.
Unlike many public Fisher Transform scripts (which typically transform price directly, or transform RSI/Stochastic), this one is specifically built on Williams %R, giving a different — often earlier — read on exhaustion at range extremes.
The zone filter and same-type signal cooldown are both configurable, letting users trade off signal frequency against signal quality, which many divergence scripts don't expose.
Notes / Disclaimer
This indicator is a technical analysis tool and does not constitute financial advice. It repaints only in the sense that divergence lines/labels are drawn after pivot confirmation (lbR bars after the pivot bar), which is standard for any pivot-based divergence tool and is by design — the underlying Fisher/Trigger plot values themselves do not repaint. As with any oscillator, past signals do not guarantee future performance; test and combine with your own risk management before live use.
指標

指標

CQ_(9)_Phases Counter + Adaptive Projection v2================================================================================
CQ_(9)_Phases Counter + Adaptive Projection v2
FUNCTIONALITY DESCRIPTION AND USER MANUAL
Pine Script v6 | TradingView | Overlay indicator
================================================================================
TABLE OF CONTENTS
PART 1 - FUNCTIONALITY DESCRIPTION
1. Purpose and overview
2. Feature summary
3. How the script works (engine walkthrough)
3.1 ZigZag engine
3.2 ZigZag drawing (confirmed / unconfirmed / active legs)
3.3 Adaptive Projection engine
3.4 Leg (phase) numbering engine
3.5 Phase Statistics table engine
3.6 Table padding frame
4. Data model (internal arrays and state)
5. Repainting, timing and performance notes
PART 2 - USER MANUAL
6. Quick start
7. Setting up the phase counter (anchors) step by step
8. Settings reference (every input, by group)
9. Reading the chart
10. Reading the Phase Statistics table (every metric explained)
11. Recommended workflows
12. Troubleshooting and FAQ
13. Known limitations and behaviors worth knowing
14. Glossary
################################################################################
# PART 1 - FUNCTIONALITY DESCRIPTION
################################################################################
--------------------------------------------------------------------------------
1. PURPOSE AND OVERVIEW
--------------------------------------------------------------------------------
This indicator turns raw price action into a structured "phase" map. It:
a) Builds a ZigZag of alternating swing highs and swing lows using a single
lookback period.
b) Draws the ZigZag legs on the chart, with the two most recent legs styled
differently from the settled history.
c) Numbers each leg 1-2-3-4-5 in a repeating cycle, anchored to a pivot whose
phase number YOU verify manually (one saved anchor per timeframe).
d) Projects a two-segment "adaptive" path forward from the current price,
based on the average size, slope and direction of all past legs on the
chart.
e) Displays a Phase Statistics table with per-leg metrics: direction,
high/low, growth, bars, retracement, velocity, comparison to averages,
ATR-normalized size, ratio to the prior leg, plus Fibonacci-style
retracement and extension price targets.
Everything is driven by ONE structural setting, the ZigZag Period. Changing it
changes the pivots, the numbering, the averages behind the projection, and every
number in the table.
The indicator is an analysis/visualization tool. It does not place orders, does
not generate alerts, and does not plot any series (the script ends with
plot(na), which only satisfies TradingView's requirement of having a plot).
--------------------------------------------------------------------------------
2. FEATURE SUMMARY
--------------------------------------------------------------------------------
- ZigZag with adjustable period (10-100, default 45)
- Three leg states, each with its own line style:
Confirmed (older, settled legs)
Unconfirmed (most recent completed pivot-to-pivot leg)
Active (live leg from the latest pivot to the current price)
- Optional circle markers at both ends of the Active and Unconfirmed legs
- Adaptive Projection: 2 dotted segments (continue current leg, then reverse)
- Phase numbering 1-5, repeating, forward and backward from a user anchor
- Separate saved anchors for 1H, 4H, 1D, 1W and 1M charts
- Manual or Automatic anchor-timeframe selection
- Six numbering glyph styles
- Label placement on the pivot or at the leg midpoint
- Anchor marker (anchor symbol) showing which pivot was snapped to
- Phase Statistics table, vertical or horizontal, 1-10 legs
- 40/50/60% retracement targets and 127.2/161.8/200% extension targets, with
"reached" markers
- Three cell coloring styles for the table
- Invisible padding frame to fine-tune table position on screen
--------------------------------------------------------------------------------
3. HOW THE SCRIPT WORKS (ENGINE WALKTHROUGH)
--------------------------------------------------------------------------------
3.1 ZIGZAG ENGINE
----------------------------------------------------------------------
Pivot detection uses the ZigZag Period (N):
A bar is a pivot HIGH candidate if its high is the highest high of the
last N bars.
A bar is a pivot LOW candidate if its low is the lowest low of the last
N bars.
The current direction (dir) is +1 (up) or -1 (down). Direction flips when a bar
is a pivot high but not a pivot low (dir becomes +1) or a pivot low but not a
pivot high (dir becomes -1). If a bar is both or neither, direction is kept.
Pivot storage:
- On a direction change, a NEW pivot is added at the front of the pivot list.
- If direction has not changed and a more extreme candidate appears (a higher
high in an up move, or a lower low in a down move), the CURRENT (front)
pivot is UPDATED in place (its price, time and bar index are replaced).
- The ATR(20) value at the moment a pivot is created or updated is stored
alongside it (used later for the xATR metric).
The pivot list is stored newest-first. Index 0 is the most recent pivot (the
start of the currently forming leg), index 1 the one before it, and so on.
Because the newest pivot can keep moving while price makes new extremes, the
most recent leg is not final until a new opposite pivot forms.
3.2 ZIGZAG DRAWING
----------------------------------------------------------------------
Whenever at least two legs' worth of data exists (4+ stored values), all
ZigZag lines are deleted and redrawn from the stored pivots:
- The most recent completed leg (pivot 1 -> pivot 0 pair) uses the
"Unconfirmed Leg Style".
- All older legs use the "Confirmed Style".
- Leg color: bullish color if the leg ended higher than it started,
bearish color otherwise.
- If "Mark Unconfirmed Leg Start/End" is on, two circle markers are placed at
that leg's endpoints, in the leg's color.
The ACTIVE leg is drawn on the last bar only: a line from the latest pivot to
the current close, using the "Active Leg Style". Its color is bullish when
close is above the latest pivot's price, otherwise bearish. If "Mark Active
Leg Start/End" is on, circle markers are drawn at both ends.
All lines are positioned by bar TIME (xloc.bar_time), so they align to the
chart regardless of scrolling.
3.3 ADAPTIVE PROJECTION ENGINE
----------------------------------------------------------------------
Step 1 - Collect statistics from EVERY leg in the stored pivot history:
For each leg the script records: length ($), slope ($ per unit time), and
duration (bars). Legs are separated into bullish and bearish groups.
It then computes: average bullish/bearish length, slope and bars.
Step 2 - Describe the live leg:
current_direction : +1 if close > latest pivot price, otherwise -1
current_length : |close - latest pivot price|
current_slope : (close - latest pivot price) / time elapsed
Step 3 - Build the projection from the current price:
Segment 1 ("finish the leg"):
If the current leg is shorter than the average leg length in the same
direction, draw a line continuing at the CURRENT leg's slope until the
leg would reach the average length. Color follows the current
direction.
Segment 2 ("reversal"):
Draw a line in the OPPOSITE direction using the average length and
average slope of past legs in that opposite direction. It starts where
Segment 1 ends.
If the current leg is ALREADY as long as or longer than the average,
Segment 1 is skipped and only Segment 2 is drawn, starting at the current
price.
Safety cap: the projection never extends more than 500 bars (of the chart's
timeframe) into the future, in total.
Only the projection lines from the latest bar are kept; earlier copies are
deleted each time the script recalculates.
3.4 LEG (PHASE) NUMBERING ENGINE
----------------------------------------------------------------------
Goal: label every pivot with a phase number 1-5 in a repeating cycle that
matches a numbering YOU have verified.
Inputs: for each supported timeframe (1h, 4h, 1d, 1w, 1m) there is an anchor
date/time and a phase number (1-5).
Selecting the active anchor:
- Manual mode: the "Anchor Timeframe (Manual)" dropdown decides which saved
anchor is used.
- Automatic mode: the script detects the chart's timeframe (must be exactly
60m, 240m, 1D, 1W or 1M) and uses that timeframe's saved anchor. On any
other timeframe there is no saved anchor and the counter stays silent.
The counter DISPLAYS only when the chart timeframe actually matches the active
anchor timeframe (tf_matches). Otherwise labels and anchor marker are hidden,
keeping other timeframes uncluttered.
Seeding (runs once, on the last bar, when at least 4 pivot values exist):
1. The script finds the stored pivot whose timestamp is closest to the anchor
date/time you entered ("snap to nearest pivot"). The newest pivot (the one
still forming) is excluded from this search.
2. That pivot receives the phase number you entered.
3. Pivots NEWER than the anchor count up (…, n, n+1, …, wrapping 5 -> 1).
Pivots OLDER than the anchor count down (…, n-1, n-2, …, wrapping 1 -> 5).
4. The result is stored in three parallel lists: bar time, price, number.
Auto-extension: after seeding, each time a new pivot becomes frozen (a newer
opposite pivot forms), the next number in the cycle is appended automatically.
You do not need to renumber by hand as the chart advances.
Label placement: each label is drawn on the last bar.
- "Pivot": label sits on the pivot itself.
- "Leg Midpoint": label sits halfway (in time and price) between that pivot
and the next numbered pivot. The newest label uses the live current price
as its far endpoint, so it drifts until the leg is confirmed.
Label colors: with Auto-Color on, the label text uses bullish or bearish color
according to whether the next pivot's price is higher or lower than this
pivot's price; the background is the same color faded by the Fade %. With
Auto-Color off, custom background and text colors are used.
Anchor marker: an anchor-symbol label is placed above (if the anchor pivot was
a high) or below (if a low) the anchor pivot, offset by 2x ATR(20). It shows
the anchor's phase number and timeframe, for example "anchor 5 1d".
3.5 PHASE STATISTICS TABLE ENGINE
----------------------------------------------------------------------
The table is rebuilt on the last bar. Legs shown = Active + Previous
(Unconfirmed) + (Legs Shown - 2) older confirmed legs, up to 10 total.
Each leg is a column (Vertical orientation) or a row (Horizontal). Column order
left to right (Vertical): oldest historical leg ... newest historical leg,
Previous (Unconfirmed), Active (Projected).
Per-leg metric sources:
- Historical legs: computed from fixed pivot-to-pivot data.
- Previous leg: computed from the leg's pivot window through the current
bar, plus live retracement information.
- Active leg: computed from the latest pivot through the current bar.
Full definitions of every metric are in Section 10.
Cell coloring is controlled by "Value Cell Style":
- White: flat background, flat text.
- Tendency Color: text colored by the leg's direction.
- Tendency Background: the cell background colored by direction with a flat
text color on top.
On the Rtd and Ext target rows, the direction color is INVERTED (a bullish leg's
targets are drawn in the bearish color and vice versa), because those targets
are prices price would reach by moving against (retracing) or beyond (extending)
the leg.
3.6 TABLE PADDING FRAME
----------------------------------------------------------------------
The table has an extra outer row above and below, and an extra column left and
right of the real content. Each of these four padding areas is a single merged,
fully transparent cell. Their sizes are user inputs (0-100). Since the table is
anchored to a chart edge or corner, growing a padding cell shifts the visible
content away from that anchor, giving fine position control beyond the nine
presets.
--------------------------------------------------------------------------------
4. DATA MODEL (INTERNAL ARRAYS AND STATE)
--------------------------------------------------------------------------------
z Pivot list, newest first, stored as pairs: . Index 0 = newest pivot price, index 1 = its time.
zbar Pivot bar indices, newest first.
zatr ATR(20) captured at each pivot, newest first.
leg_bar_arr / leg_price_arr / leg_num_arr
Numbered pivots, OLDEST first (opposite order from z). Filled at
seeding and extended as pivots freeze.
seeded true once the counter has been seeded.
last_recorded_bar bar index of the last pivot already numbered.
last_assigned_num the phase number given to that pivot.
anchor_*_saved memory of which pivot was snapped to (for the marker).
avg_bullish_length, avg_bearish_length
avg_bullish_slope, avg_bearish_slope
avg_bullish_bars, avg_bearish_bars
Averages used by both the projection and the table's
"vs Avg" metrics.
Drawing object pools (lines, labels, table) are kept in persistent
variables and deleted/recreated so old objects never pile up.
--------------------------------------------------------------------------------
5. REPAINTING, TIMING AND PERFORMANCE NOTES
--------------------------------------------------------------------------------
- The newest ZigZag pivot repaints by design: it moves as price makes new
extremes in the current direction. The most recent completed leg is
therefore labeled "Unconfirmed".
- Older pivots do not change unless you change the ZigZag Period.
- Labels, the projection, the table, the active leg and the anchor marker are
only (re)drawn on the last bar of the chart, so they update on each new
tick/bar of the latest candle.
- The script is limited to 500 lines and 500 labels. With very small ZigZag
Periods on long histories, the oldest legs may be dropped by TradingView.
- The projection average is calculated over the whole stored pivot history
each time a pivot is added, so it adapts as more legs form.
################################################################################
# PART 2 - USER MANUAL
################################################################################
--------------------------------------------------------------------------------
6. QUICK START
--------------------------------------------------------------------------------
1. Add the indicator to a chart on one of the supported timeframes:
1H, 4H, 1D, 1W or 1M.
2. Open Settings. Leave ZigZag Period at 45 for a first look.
3. Under "Leg Numbering", set "Anchor Timeframe Selection" to Automatic (so
the right saved anchor is used per chart), or leave Manual and pick the
matching timeframe.
4. Set the anchor date/time (Pivot anchor) and phase number for that
timeframe (see Section 7).
5. Look at the chart: ZigZag legs, numbered labels, a dotted projection from
the current price, and the Phase Statistics table at the bottom left.
6. Adjust colors, sizes and table position to taste.
If you see legs and the table but NO numbers, the chart timeframe does not
match the active anchor timeframe (see Troubleshooting, Q1).
--------------------------------------------------------------------------------
7. SETTING UP THE PHASE COUNTER (ANCHORS) STEP BY STEP
--------------------------------------------------------------------------------
The counter needs one reliable reference: "this specific pivot is phase N".
1. Decide which pivot you consider a known phase, based on your own analysis.
2. Note its date and time on that timeframe's chart.
3. In the "Leg Numbering" group, find the row for that timeframe, for
example "Pivot (1D)".
4. Enter the pivot's date/time in the date field.
5. Enter its phase number (1-5) in the small numeric box on the same row.
6. Make sure the active timeframe (Manual pick or Automatic detection) equals
the chart timeframe.
7. Enable "Mark Anchor Pivot". An anchor marker should appear above or below
a pivot. Verify it sits on the pivot you intended.
8. If the marker is on the wrong pivot, adjust the date/time to sit closer to
the intended pivot. The script always snaps to the NEAREST pivot in time.
Tips:
- The anchor only needs to be near the pivot in time, not exact to the bar,
but if two pivots are close together, be precise.
- Re-check the anchor if you change the ZigZag Period: a different Period may
produce different pivots, so the snapped pivot can change.
- Each timeframe keeps its own anchor. Setting the 1D anchor does not affect
the 4H anchor.
- The anchor pivot must exist in the loaded chart history. If you scroll too
little history or use a very large Period, the anchor pivot might not
exist, and the snap will pick the nearest one that does.
--------------------------------------------------------------------------------
8. SETTINGS REFERENCE (EVERY INPUT, BY GROUP)
--------------------------------------------------------------------------------
GROUP: Phases (ZigZag)
----------------------
Period (10-100, default 45)
ZigZag lookback in bars. Higher = fewer, larger, later-confirming legs.
Lower = more, smaller, faster legs. Drives everything else.
Bullish Leg / Bearish Leg (colors)
Colors for upward / downward legs, including the active leg and its
markers.
Confirmed Style (Solid/Dashed/Dotted) and Width (1-8)
Style for settled older legs. Width applies to ALL legs.
Active Leg Style (default Dotted)
Style of the live leg to the current price.
Unconfirmed Leg Style (default Dashed)
Style of the most recent completed leg.
Mark Active Leg Start/End + size (Tiny..Huge)
Circle markers at both ends of the Active leg.
Mark Unconfirmed Leg Start/End + size (Tiny..Huge)
Circle markers at both ends of the Unconfirmed leg.
GROUP: Adaptive Projection
--------------------------
Show Projection
Master switch for the two projection segments.
Bullish Projection / Bearish Projection (colors)
Colors for upward / downward projection segments.
Style and Width (1-5)
Line style and width for both segments (default Dotted, width 1).
GROUP: Leg Numbering
--------------------
Pivot (1H / 4H / 1D / 1W / 1M) - date/time + phase number (1-5)
The five saved anchors. Only the active timeframe's anchor is used.
Anchor Timeframe Selection (Manual / Automatic)
Manual: uses the dropdown below regardless of the chart.
Automatic: uses the chart's own timeframe (1h/4h/1d/1w/1m only).
Anchor Timeframe (Manual)
Which saved anchor to use in Manual mode. The counter displays only when
the chart is on this timeframe.
Mark Anchor Pivot
Shows the anchor marker on the snapped pivot.
Numbering Style
Glyph set for phase numbers: circled, filled circled, Roman numerals,
keycap emoji, subscript parentheses, or parenthesized. Rendering varies
by OS/browser/font.
Label Size (Tiny..Huge, default Huge)
Size of the number labels on the chart (not the table).
Auto-Color by Leg Direction
On: labels use the Bullish/Bearish Label colors below.
Off: labels use the custom colors below.
Bullish Label Color / Bearish Label Color
Also the bullish/bearish colors used throughout the Phase Statistics
table (tendency text, tendency background lookup, inverted target rows).
Custom Label Background Color / Custom Label Text Color
Used only when Auto-Color is off.
Label Background Fade % (0-100, default 90)
0 = opaque background, 100 = fully transparent (only the glyph shows).
Overrides any transparency of the picked colors.
Label Position (Pivot / Leg Midpoint, default Leg Midpoint)
Where each number sits relative to its leg.
GROUP: Phase Statistics Table
-----------------------------
Show Table
Master switch. Table appears once at least two pivots exist.
Orientation (Vertical / Horizontal)
Vertical: legs are columns, metrics are rows.
Horizontal: legs are rows, metrics are columns.
Position (nine presets)
Chart corner/edge anchor. Default Bottom Left.
Text Size (Tiny..Huge)
Table text. Single-line leg headers are always Normal size; the
Unconfirmed/Projected two-line headers follow this setting.
Header Background / Header Text
Colors for title bar, corner cell, leg headers and metric labels.
Cell Background / Cell Text
Value-cell colors for the White style, and the fallback otherwise.
Value Cell Style (White / Tendency Color / Tendency Background)
How value cells are colored (see Section 3.5).
Tendency BG: Bullish / Bearish / Text Color
Used only with the Tendency Background style.
Border Color
Grid line color. Use a transparent color for a borderless table.
Retracement Bar Glyphs
Four filled/empty glyph pairs for the 10-segment retracement bar.
Show Retracement Progress Bar
Adds a "Rtd %" row/column with the 10-segment bar.
Legs Shown (2-10, default 7)
Total legs displayed (Active + Previous + older).
Show Retracement % Targets
Adds Rtd 40%, 50%, 60% price targets per leg.
Mark Reached Retracement Levels + Reached Marker Glyph
Appends a marker (one of four glyphs) to a target price once price has
retraced at least that far.
Show Velocity, Show Size vs Avg, Show Bars vs Avg, Show ATR-Normalized Size
(xATR), Show Ratio to Prior Leg
Toggle the advanced metrics (Section 10).
Show Extension % Targets (127/162/200%)
Adds Ext 127%, 162%, 200% price targets per leg.
GROUP: Table Position Fine Tunning
----------------------------------
Four padding inputs (top, bottom, left, right; 0-100 each, default 0).
Adds invisible, merged, fully transparent space on that side of the
table so the visible content shifts away from its anchor corner.
Example: anchored Bottom Left, raising the bottom padding lifts the
table up; raising the left padding pushes it right.
--------------------------------------------------------------------------------
9. READING THE CHART
--------------------------------------------------------------------------------
ZigZag legs
Teal legs (default) go up; orange legs (default) go down.
Dashed = the most recent completed leg (may still shift).
Dotted = the live leg running to the current price.
Solid = older, settled legs.
Circle markers
Small circles mark the start and end of the Active and Unconfirmed legs.
Number labels
Each pivot/leg carries a 1-5 phase number. When Label Position is "Leg
Midpoint", the number sits mid-leg. The newest number drifts with price
until its leg is confirmed.
Anchor marker
Shows which pivot your anchor snapped to, with its phase number and
timeframe.
Projection
Dotted two-part line from the current price. Segment 1 = expected
continuation of the current leg to the average length; Segment 2 =
expected reversal by the average opposite-leg length and slope. It is a
statistical average of past behavior on this chart, not a forecast.
--------------------------------------------------------------------------------
10. READING THE PHASE STATISTICS TABLE (EVERY METRIC EXPLAINED)
--------------------------------------------------------------------------------
Column headers
- Historical legs: the leg's phase number (or "Leg-N" if not numbered).
- Previous leg: phase number + "Unconfirmed".
- Active leg: phase number + "Projected".
Metrics
Dir
UP or DN: the leg's direction.
High / Low
Highest and lowest price of the leg.
Historical legs: their two pivot prices.
Previous leg: highest/lowest from the older pivot through the latest bar.
Active leg: highest/lowest from the latest pivot through the latest bar.
Growth
Size of the leg in dollars (high minus low, per the definitions above).
Bars
Number of bars the leg lasted (pivot to pivot). For the Active leg, bars
since the latest pivot.
Retraced
Two lines: percent and dollars.
Historical legs: how much of that leg the NEXT (more recent) confirmed
leg gave back.
Previous leg: distance from the current close to that leg's end pivot,
relative to the confirmed leg before it.
Active leg: distance from the current close to the latest pivot, relative
to the previous leg's size.
Rtd %
A 10-segment progress bar of the retracement percentage (one segment per
10%). Optional.
Velocity
Growth divided by Bars, shown as dollars per bar.
vs Avg Size
The leg's Growth compared with the average leg of the same direction on
the chart. Signed percent: +18% means 18% larger than average.
vs Avg Bars
The leg's duration compared with the average duration of same-direction
legs. Signed percent.
xATR
Growth divided by the ATR(20) recorded at the leg's starting pivot.
Makes sizes comparable across volatility regimes (shown as "1.8x ATR").
Ratio to Prior
The leg's size divided by the size of the leg immediately before it.
Tagged with the nearest Fibonacci ratio if within tolerance, for example
"0.62x (~.618)". Recognized tags: .382, .5, .618, .786, 1.0, 1.272,
1.618, 2.0, 2.618.
Rtd 40% / 50% / 60%
Prices at 40/50/60% retracement of that leg's own range, measured from
the leg's more recent pivot back toward its older pivot. A marker is
appended if price has retraced at least that far (see Marker settings).
The Previous leg uses the live Active retracement %.
The Active column shows a dash: its own targets are not yet defined.
Ext 127% / 162% / 200%
Prices at 127.2%, 161.8% and 200% of the leg's range, projected beyond
the leg's older end in the same direction as the leg. Same marker rules;
the Active column shows a dash.
Color inversion
On Rtd and Ext rows, a bullish leg's values use the bearish color (and
vice versa), since they describe where price would go relative to the
leg's direction.
Price formatting
Prices are rounded to whole dollars with thousands separators ($12,345).
This suits high-priced assets. For assets that trade in cents or a few
dollars, the table values will look rounded/coarse (see Section 13).
--------------------------------------------------------------------------------
11. RECOMMENDED WORKFLOWS
--------------------------------------------------------------------------------
A) Multi-timeframe counting
Set Anchor Timeframe Selection to Automatic. Save an anchor for each of
1H/4H/1D/1W/1M once. Then simply switch chart timeframe; the counter
switches anchors automatically. Timeframes such as 15m or 2D show no
numbering.
B) Using the table as a checklist
Keep Legs Shown at 7. Watch the Active column for Retraced % and the Rtd
bar. Compare the Active leg's "vs Avg Size / Bars" to see if the current
move is stretched or young relative to history.
C) Target planning
Use the Previous (Unconfirmed) column for live Rtd 40/50/60 and Ext
127/162/200 prices, and the "reached" marker to see what has already been
touched.
D) Cleaner chart
Turn off marker circles and the projection; set Label Background Fade to
100 so only the glyphs show; or switch the table to Horizontal and reduce
Legs Shown.
E) Tuning the Period
Start with 45. Raise it for macro swings on lower timeframes; lower it for
more responsive legs. Re-verify your anchor afterwards.
--------------------------------------------------------------------------------
12. TROUBLESHOOTING AND FAQ
--------------------------------------------------------------------------------
Q1. I see legs and the table but no number labels or anchor marker.
The chart timeframe does not match the active anchor timeframe. In Manual
mode, set "Anchor Timeframe (Manual)" to the chart's timeframe. In
Automatic mode, use exactly 1h, 4h, 1D, 1W or 1M (60m/240m/D/W/M).
Q2. The anchor marker is on the wrong pivot.
The script snaps to the pivot nearest in time to your date/time. Move the
date/time closer to the intended pivot. If you changed the ZigZag Period,
pivots have changed; re-check.
Q3. Numbers changed after I changed the ZigZag Period.
Expected. Different Period = different pivots = different sequence. Re-set
the anchor.
Q4. The last pivot keeps moving.
Expected. The newest pivot follows price while direction persists; that is
why the latest completed leg is called Unconfirmed.
Q5. The projection has only one segment.
The current leg already meets or exceeds the average same-direction leg, so
only the reversal segment is drawn from the current price.
Q6. No projection at all.
Check "Show Projection", and make sure at least two pivots exist (a longer
history or a smaller Period).
Q7. The table does not appear.
Check "Show Table". It also requires enough pivots to exist. If the table
was moved off-screen with large padding values, reduce them.
Q8. Some legs/labels are missing on long histories.
TradingView limits this script to 500 lines and 500 labels. Increase the
Period so fewer legs are produced.
Q9. Emoji or glyphs render oddly.
Glyph rendering depends on your OS/browser/font. Try another Numbering
Style or Retracement Bar Glyph set.
Q10. Numbers on some older legs are "Leg-N" instead of a glyph.
Those older table legs have no phase number assigned, for instance when
the counter has not seeded yet.
--------------------------------------------------------------------------------
13. KNOWN LIMITATIONS AND BEHAVIORS WORTH KNOWING
--------------------------------------------------------------------------------
1. Seeding happens once, on the first last-bar calculation where enough
pivots exist. Changing a setting recalculates the script and reseeds.
2. Numbering labels are only displayed when the chart timeframe matches the
active anchor timeframe. The table's header glyphs use the numbering data
whenever it has been seeded, even if labels are hidden for a timeframe
mismatch.
3. The newest phase label always uses the bullish label color (there is no
later pivot yet to compare against for direction).
4. The Previous (Unconfirmed) column's High/Low and Growth are measured from
the older pivot through the current bar, so they can include movement
from the Active leg. Historical columns use fixed pivot-to-pivot values.
5. The Adaptive Projection is based on averages, so a few very large or very
small legs can skew it. It is a statistical tool, not a prediction.
6. Table prices are rounded to whole dollars, which suits high-priced assets
(for example Bitcoin) and can look coarse on low-priced instruments.
7. Anchors exist only for 1h, 4h, 1d, 1w and 1m. Other timeframes have no
saved anchor and no numbering.
8. No alerts are provided.
9. Because the pivot direction logic uses one lookback in both directions,
a bar that is simultaneously the highest high and lowest low of the window
(an extreme outside bar) does not change direction.
--------------------------------------------------------------------------------
14. GLOSSARY
--------------------------------------------------------------------------------
Active leg Live line from the latest pivot to the current price.
Anchor A pivot you nominate as having a known phase number.
ATR(20) Average True Range over 20 bars, used for volatility scaling.
Confirmed leg A settled older leg that no longer changes.
Extension A price projected beyond a leg's range in its own direction.
Leg The move between two consecutive ZigZag pivots.
Phase The repeating 1-2-3-4-5 label given to each leg.
Pivot A swing high or low detected by the ZigZag Period.
Retracement The fraction of a leg that the following move gives back.
Snap Choosing the stored pivot closest in time to your anchor
date/time.
Unconfirmed leg The most recent completed leg, whose end pivot may still move.
ZigZag Period The lookback (in bars) that decides what counts as a pivot.
================================================================================
END OF DOCUMENT
================================================================================ 指標

CleanTradeQuantum_v7.2_OB_FVG_INTEGRATEDCleanTradeQuantum v7.2 is an apex-tier, multi-layered algorithmic architecture engineered for uncompromising market dominance. Transcending traditional static indicators, it operates as a highly responsive state machine, harnessing a hyper-advanced quantum trend analyse engine to continuously map market probabilities and adapt to volatile liquidity regimes with zero latency.
Core Architecture & Precision Targeting
Quantum Probability Matrix: At its core, the quantum trend analyse engine parses up to 4,096 historical data vectors per tick, synthesizing multidimensional bullish and bearish momentum probabilities. This establishes a baseline of mathematical superiority before any capital is deployed.
Institutional SMC Integration: The system aggressively hunts hidden institutional liquidity by pinpointing high-fidelity Order Blocks (OB) and Fair Value Gaps (FVG). These structural zones are routed into an elite Signal Cluster—a consensus-voting nexus that cross-verifies volume profiles, multi-timeframe momentum, and structural validity before authorizing a strike.
Guided Walk Forward Optimization (WFO): To eradicate curve-fitting and ensure maximum adaptability, the framework deploys a deterministic parameter router. It fluidly shifts its internal logic across five distinct tactical profiles (Strict Prop, Balanced, Trend, Chop Defense, and Aggressive) as the chart evolves, neutralizing shifting market conditions.
Risk Mitigation & Autonom Winning
Adaptive Error Guard Circuitry: Designed for relentless autonom winning, the system features a self-healing, localized circuit breaker. If a drawdown occurs within toxic, low-probability chop zones, the engine instantly triggers a spatial, ATR-calculated lockout, shielding capital from adversarial liquidity pockets until the regime normalizes.
Dynamic OCA Scaling & Trailing: Leveraging advanced One-Cancels-All (OCA) brackets, the engine ruthlessly secures initial partial profits at TP1. Post-TP1, it initiates a hyper-responsive, ATR-calibrated trailing stop, autonomously riding explosive trend continuations while entirely eliminating downside risk.
Prop-Firm Safeguard Protocols: Hardcoded with unyielding equity tracking, the engine enforces strict institutional funding constraints. It actively monitors live drawdowns tick-by-tick, instantly locking down execution if the portfolio approaches daily or absolute maximum drawdown thresholds. 策略

SMC Order Block Scorer [Volume Confluence]SMC Order Block Scorer
Finds smart money order blocks and ranks them by volume-profile confluence, so you can see which zones are more likely to hold.
What it does
*Draws market structure (BOS and CHoCH) from major swing pivots
*Creates an order block on every swing break
*Builds a volume profile and marks the POC, Value Area (VAH/VAL) and HVNs
*Scores every order block from 0 to 100 and grades it A+, A, B or C
*Removes order blocks once price revisits them (mitigation)
How it works
*Structure : A close beyond the last swing high or low is a break. A break in the trend direction is a BOS. A break against it is a CHoCH. A CHoCH on a volume spike is tagged "CHoCH Vol".
*Order block: The last opposite candle before the break becomes the zone. It is the last down candle before a bullish break, or the last up candle before a bearish one.
*Volume profile : Volume is spread across price rows over a lookback window.
POC: the row with the most volume.
Value Area: the range holding about 70% of volume.
HVN: a local volume peak well above the average row.
Score : An order block earns more points when it has:
*the POC inside it (biggest credit)
*Value Area overlap
*an HVN inside it (extra credit)
*a large share of the profile's volume
*a strong impulse move and high volume on the break
*a BOS in the trend direction (worth more than a CHoCH)
How to read the chart
*Green boxes: bullish (demand) order blocks
*Red boxes: bearish (supply) order blocks
*Label: direction, grade and score, for example ▲ A+ 84%, with the volume features it touches (POC · VA · HVN) underneath
★ and thicker border: the highest-scoring active order block
*Stronger fill: a higher grade
*Dotted line: the 50% level of the zone
*Histogram on the right: the volume profile, with the POC in red, Value Area in blue and HVNs in gold
*Table: the current swing trend, the top 3 order blocks and the count of active ones
How to use it
*Look for order blocks graded A or A+ that also have POC or HVN in the label.
*Trade in the direction of the swing trend. A bullish block in a bullish trend is a stronger setup than a counter-trend one.
*Wait for price to come back to the zone and confirm on a lower timeframe before entering.
*Use the 50% line as a reference for entries.
*Use the far side of the block as a stop reference.
*If the chart looks busy, raise "Hide OBs below score" to 50 or higher.
Key settings
*Swing Lookback: the default of 50 gives fewer, larger zones. Use 10–20 for more zones on lower timeframes.
*Mitigation trigger:
*Touch: removed when price revisits the zone.
*50%: removed when price reaches the middle of the zone.
*Wick: removed when a wick trades through the far side.
*Close: removed when a candle closes beyond the far side.
*Keep mitigated OBs: shows used zones as faded boxes instead of deleting them.
*Scoring weights: change how much the POC, Value Area and HVN count.
*Market structure toggle: turns BOS and CHoCH drawing on or off. Order blocks still work with it off.
Alerts
*Bullish and bearish BOS
*Bullish and bearish CHoCH, with or without a volume spike
*New bullish or bearish order block
*Order block mitigated 指標

JoulTrades - ICT PDH/PDL EighthsOVERVIEW
This indicator marks the previous day's high (PDH) and low (PDL) and grades the range between them in eighths, the way ICT (Inner Circle Trader) teaches traders to grade a range: quadrants, octants and a black equilibrium line. It is a level-marking tool for study and chart preparation. It does not generate signals, entries or bias.
WHAT IT DRAWS
- PDH and PDL, extended to the right with labels and price-axis tags.
- Seven graded levels between them: 0.125, 0.25, 0.375, 0.5, 0.625, 0.75 and 0.875.
- The 0.5 level (equilibrium, also called consequent encroachment or CE) in black. Every other level uses one grey, so the midpoint stands out.
- Optional: the previous week's high and low as dashed lines.
HOW IT WORKS
- The range is always measured from the low to the high, whatever the trend. The levels do not move when the market turns.
- Each level is PDL + fraction x (PDH - PDL).
- No separate 0 and 1 lines are drawn, because PDH and PDL already sit there. A range's own edge is not drawn twice.
- The previous day is final once it has closed, so its levels do not repaint. The lines are redrawn on the latest bar only so they stay attached to the current price area and do not pile up on the chart.
- It works on every intraday timeframe and on the daily. Nothing is drawn on weekly or monthly charts.
WHAT COUNTS AS "PREVIOUS DAY"
Traders use two definitions, and they can give different prices:
- Full day (default): the daily candle. On CME futures that is 18:00 to 17:00 New York time, including the overnight session.
- RTH session only: the regular trading hours set in the settings (default 09:30-16:00 New York). The labels change to "RTH PDH" and "RTH PDL" so a screenshot always shows which one is in use.
On charts above 30 minutes, the RTH range is read from 30-minute data so the session edges are exact.
NUMBERING
- ICT ladder (default): 0 is the low and 1 is the high, so 0.875 is the highest octant, next to PDH.
- TradingView fib: matches the built-in fib retracement tool drawn from low to high, which puts 0 at the high.
The prices are identical in both modes. Only the numbers attached to them change. Pick the one that matches the way you read levels.
LABELS
Labels can show the number, the ICT name, or both:
0.875 highest octant, 0.75 upper quadrant, 0.625 second octant, 0.5 CE, 0.375 lower octant, 0.25 lower quadrant, 0.125 lowest octant.
Hover over any label for a short explanation of that level. This is meant to help newer traders learn the vocabulary while they look at the chart.
HOW TO READ IT
- Above 0.5, price is in the premium half of yesterday's range. Below 0.5, it is in the discount half.
- ICT treats quadrants and octants as reference levels that price can be drawn to, not as decoration.
- PDH and PDL are where resting liquidity is commonly assumed to sit until price trades through them.
- A level carries more information when it lines up with a level from a different range, for example an opening gap or a key open landing on the same price.
Use these levels as a map for your own analysis. They are not trade signals on their own.
SETTINGS
- Range: previous day definition, RTH session and timezone, eighths on or off.
- Labels: numbering, label text, price in labels, label size, label distance from price.
- Style: level colour, equilibrium colour, line widths. The defaults are grey #636363 levels, a black equilibrium, and thicker PDH/PDL lines.
- Previous week: high and low on or off, and their colour.
LIMITATIONS
- The default RTH session fits US index futures and US stocks. For other markets, set the session and timezone to match.
- Full day follows the chart's own daily session. On symbols that trade around the clock, "previous day" is whatever the exchange defines as the daily candle.
- RTH mode on the daily chart depends on the 30-minute history TradingView loads for your plan.
- These are reference levels. The indicator makes no claim about how often price reacts at any of them. Test them on your own market and timeframe before relying on them.
This script is open source and published for educational purposes. It is not financial advice.
指標

Session High / Low Strength **Session High / Low Strength PRO** is a session-based market structure indicator designed to automatically track the High and Low of multiple trading sessions while also calculating how strong each level is.
The indicator can be fully customized for different markets, time zones, and trading styles. Each session can have its own name, trading hours, and color.
### Main Features
• Tracks the **Session High and Session Low** automatically
• Supports up to **4 fully customizable sessions**
• Custom **From / To session times**
• Adjustable **UTC / GMT timezone**
• Works with Asia, London, New York, custom sessions, or any other time window
• Automatically extends completed session levels
• Optional strength labels
• Live dashboard displaying session levels and strength
• Customizable line styles, colors, and widths
### High / Low Strength Score
Each Session High and Session Low receives a **Strength Score from 0 to 100**.
The score combines several different factors instead of relying on only one measurement.
**Level Touches**
The indicator tracks how often price interacts with the Session High or Low. Multiple reactions around the same price can indicate that the level is being respected by the market.
**Wick Rejection**
Long rejection wicks around the Session High or Low can indicate aggressive rejection of that price area.
**Relative Volume**
Volume around each level is compared with average market volume. Higher relative volume during a test can indicate stronger participation around the level.
**Close Away Strength**
The indicator measures how strongly price closes away from the Session High or Low after interacting with it. A stronger move away from the level can indicate stronger rejection.
### Strength Classification
The final score is classified as:
**0–24:** VERY WEAK
**25–39:** WEAK
**40–54:** MODERATE
**55–69:** STRONG
**70–84:** VERY STRONG
**85–100:** EXTREME
The weight of each strength component can be adjusted individually in the settings.
### Session Configuration
Every session can be configured independently.
Example:
**Asia Session**
00:00 – 08:00
**London Session**
07:00 – 16:00
**New York Session**
13:30 – 20:00
**Custom Session**
Any user-defined trading period
These are only example times. All session times can be changed directly in the indicator settings.
### Time Zone Support
The indicator supports customizable time zones, allowing the same session logic to be used regardless of the chart's exchange timezone.
Examples:
GMT+0
GMT+1
GMT+2
GMT-4
GMT-5
You can also use supported timezone names such as:
Europe/London
America/New_York
This makes the indicator useful for traders who work with specific session windows across different global markets.
### Extended Session Levels
When a session finishes, its High and Low can automatically extend to the right side of the chart.
This allows previous session levels to act as potential:
• Support
• Resistance
• Liquidity targets
• Breakout levels
• Reversal areas
• BOS / CHoCH confirmation zones
When the same session starts again, the previous session levels stop extending and the new session begins calculating its own High and Low.
### Dashboard
The built-in dashboard shows:
• Session name
• Session High
• High Strength Score
• Session Low
• Low Strength Score
• Strength classification
This makes it possible to quickly compare the most important session levels without manually checking every line on the chart.
### Trading Applications
The indicator can be used together with:
• BOS / CHoCH
• Market Structure Shift
• Liquidity Sweeps
• Breakout & Retest strategies
• Support and Resistance
• Volume Profile
• Session trading
• Reversal setups
• Trend continuation setups
For example, a Session High with a high strength score may represent a more significant liquidity or resistance area than a Session High that formed with very little volume and no meaningful rejection.
### Important
The Strength Score should not be interpreted as a prediction that a level will definitely hold.
A strong level can still break.
The score is designed to provide additional context about how the level was formed and how strongly the market previously reacted around that area.
It is best used together with price action, market structure, volume, and proper risk management.
指標

AH Analyst v1AH Analyst brings analyst recommendations, price targets and earnings expectations into one report on your chart. The table summarizes the latest available data, while chart markers let you read the same information by hovering over the relevant dates.
AH Analyst is a free, open-source indicator shared as a contribution to the TradingView community. You can explore the source code and adapt it to your own needs.
Reading the report
The heading shows the symbol and currency, followed by the company name and sector. The report has four sections: Analyst ratings, Price targets, Last earnings and Next earnings.
Colors describe individual fields, not an overall company rating. Blue indicates neutral information. A dash and pale square indicate unavailable data; missing values are not replaced with zero.
Analyst ratings
Strong buy, Buy, Hold, Sell and Strong sell show the latest recommendation counts. Recommendations is their total. Buy counts are green, sell counts are red and Hold is blue; zero counts remain blue.
Buy share combines Strong buy and Buy. Sell share combines Strong sell and Sell. Hold share covers Hold alone. Each is expressed as a percentage of the recommendation total. These are shares of the available opinions, not percentile rankings or probabilities.
For example, 25 buy recommendations out of 36 give a Buy share of 69.44%. Shares are displayed only when all five counts are available and agree with the total. Set date identifies the recommendation set.
Price targets
Target low, Target high, Target median and Target average show the provider's latest annual price targets. In the table, targets above the reference price are green, those below it are red, and equal values are blue.
Median gap and Average gap show the percentage difference from the reference price: (target / reference price − 1) × 100. These percentages measure distance, not the likelihood of reaching a target.
Target estimates shows the number of estimates in this set. Its count and Set date can differ from the recommendation set because ratings and price targets are separate datasets.
Reference price is the latest standard-chart close on the selected timeframe. Reference date is that bar's date. The price and percentage gaps can change with the market and chart timeframe.
Last earnings
Reported EPS is compared with its associated Estimated EPS. Green means the reported result exceeded the estimate; red means it fell below. Blue means equality or an unavailable comparison.
EPS surprise is Reported EPS minus Estimated EPS. Surprise % divides that difference by the absolute estimate and multiplies by 100. A zero estimate has no percentage result. Displayed amounts are rounded, so calculations using only the visible figures can differ slightly.
Standardized EPS is shown separately because its accounting basis can differ. Observed date identifies the chart bar where the earnings data was received, rather than a guaranteed exact announcement time.
Next earnings
Expected EPS and Expected revenue show estimates for the next report. Period end is the fiscal period covered; Report date is the expected announcement date. Estimates and dates can change and remain neutral blue in the table.
On the chart
Ratings, Targets, EPS and Next EPS markers remain visible when the report is hidden. Hover over them to read recommendation counts, target prices or earnings figures. The triangles point to the associated bars; they are not buy or sell signals.
Date markers use the available chart bars. A non-trading date may appear on the next trading day, while weekly and monthly charts group dates into larger bars. The tooltip retains the source date for Ratings and Targets.
The optional target box runs from the target-set date to the next earnings report date. High and Low form its dotted outer boundary; Median and Average appear as dashed lines inside. The four price labels identify these levels. The box ends at the earnings date for display purposes; this is not the expiry date of the annual targets.
Chart targets share one adjustable color, with a separate background color. Missing or invalid dates prevent the box from being drawn. Extreme targets and closely spaced levels can affect chart readability.
Inputs
• Show report: Shows or hides the table.
• Position: Places the table at one of nine chart positions; Top Right is the default.
• Text size: Adjusts the report text.
• Label color: Adjusts field labels, company identity and chart-marker text.
• Title color: Adjusts report and section headings.
• Background color: Adjusts table backgrounds. Increase opacity if candles interfere with readability.
• Highlight color: Adjusts heading backgrounds.
• Targets: Shows or hides the target box and its levels; off by default.
• Event text size: Adjusts Ratings, Targets, EPS and Next EPS text; default 12.
• Target text size: Adjusts High, Low, Median and Average labels; default 8.
• Border color: Sets one color for the target-box border, internal lines and price labels; purple by default.
• Background color (Chart): Adjusts the target-box fill; default transparency 97. Set it to 100 for an empty interior.
Company identity and assessment squares are always included in the report. Amounts use the symbol's native currency. Further presentation changes can be made in the source code.
Data and interpretation
Availability depends on the symbol and TradingView's data provider. Some stocks have incomplete analyst coverage or earnings estimates. Missing information stays unavailable.
The indicator displays the latest supplied analyst snapshots, not a history of individual analysts or brokerage decisions. Data and expected report dates may be revised. Chart replay does not establish when the current analyst snapshot first became available.
Use standard daily candlesticks as a reference when comparing data. Other timeframes can change the reference price and the bars associated with earnings observations. Converted price scales may not match the native-currency target drawings.
AH Analyst organizes third-party information for easier reading. Analyst opinions and targets are not recommendations generated by this indicator. This is not investment advice.
指標

HD Volatility EngineHeavy Diligence Volatility Engine — HDVE v1.0
HDVE is designed to help identify when momentum may be starting to change. It does not tell you to buy or sell. It gives you another layer of information so you know when something on the chart deserves more attention.
The easiest way to read it is by looking at the arrows. Pot Mom ↑ signals a potential upside momentum change, while Pot Mom ↓ signals a potential downside momentum change. When a second arrow appears — ↑↑ or ↓↓ — HDVE has also detected stronger recent volume participation. That’s all you need to know to start using it.
How to use HDVE
HDVE is not designed to make a trading decision by itself. It is meant to be another layer of information.
Here is how I would use the tool to help me make a decision:
If I am considering Calls and HDCE is showing multiple bullish signals pointing in the same direction, then HDVE produces a green Pot Mom, that supports the idea. If HDCE is showing bullish confluence but HDVE begins producing bearish Pot Moms, that conflict matters too. It may be enough to make me wait rather than force an entry.
The same applies once I am already in a trade. If I am in Calls and a red Pot Mom appears near resistance, that is not an automatic exit signal. It tells me to reassess the position. I may look at structure, VWAP, volume, HDCE, nearby support or resistance, and whether the original trade thesis is still intact.
Sometimes the most useful thing an indicator can tell you is not “take this trade.” Sometimes it is “not yet” or “something may be changing.”
How the Heavy Diligence tools work together
The tools are designed to answer different questions.
HDTL helps identify where important structural decision areas are.
HDCE helps evaluate whether enough signals are pointing in the same direction — directional confluence — to consider a trade.
HDVE helps identify whether momentum may be beginning to change.
In simple terms:
HDTL identifies the levels.
HDCE shows the combined directional signals.
HDVE points to potential changes in momentum.
That is where I believe the real value is. The tools are not meant to replace each other. They are designed to give you different types of information that can be viewed together.
Recent Volume Context
HDVE includes a Recent Volume Context feature because meaningful volume does not always appear on the exact candle where momentum changes.
Sometimes volume enters first, price consolidates, and the momentum shift appears later.
That is why the second arrow matters. It tells you the Pot Mom appeared with stronger recent participation behind it.
Conservative and Aggressive Modes
HDVE includes two modes.
Conservative is the recommended setting, especially for new users. It is designed to be more selective and produce fewer observations.
Aggressive allows earlier and more frequent observations. Before using Aggressive mode, I would strongly recommend going back through previous charts and reviewing how those additional signals behave.
HDVE v1.0 was designed and tested around the 3-minute chart using standard candlesticks.
Other timeframes and alternative candle types may behave differently and should not be assumed to produce the same results.
Final thought
The goal was never to build something that predicts the market.
The goal was:
Better information. Faster. Easier to understand.
Sometimes HDVE may help identify an opportunity. Sometimes it may help you avoid one. Sometimes it may tell you that an existing trade deserves another look.
The indicator provides information.
The trader still makes the decision. 指標

Confirmed Close MTPI TOTALESWHAT THIS IS
This is a trend indicator for the total crypto market cap excluding stablecoins (CRYPTOCAP:TOTALES). It answers one question: is the crypto market in an uptrend or a downtrend right now?
It does that by running twelve separate trend indicators at once and taking a vote. Each of the twelve looks at the chart in its own way and says either "up" or "down". The score you see is simply the average of those twelve votes. All twelve agreeing up gives +1.00. All twelve agreeing down gives -1.00. Six against six gives 0.00.
Because twelve votes average out, the score can only land on thirteen values, one sixth apart: -1.00, -0.83, -0.67 and so on up to +1.00.
This approach is usually called a Trend Probability Indicator, or TPI. The point is that no single indicator is reliable on its own. Any one of them will whipsaw you. A group of twelve disagreeing with each other is information, and the score tells you how much of that group agrees.
WHY "CONFIRMED CLOSE"
A lot of indicators change their mind while the current candle is still forming, then change back before it closes. That is called repainting and it makes an indicator untradeable, because the signal you acted on may not be there an hour later.
This one does not do that. While today's candle is still open, the indicator shows you yesterday's confirmed reading. The state only changes when a daily candle actually closes. What you see is what you could have traded.
HOW TO READ IT
On the price chart:
- Candles are painted green while the score is above zero and red while it is below. This is the state, at a glance.
- A green triangle with the word BULLISH below it marks the candle where the score turned positive. A red triangle with BEARISH above it marks the turn down. These are the moments that matter.
- Two moving averages, a 12 period and a 21 period EMA, are drawn as a reference. They are a crude version of the same question and they are there so you can see how much smoother the twelve indicator version is.
- Bars are tinted amber where the twelve indicator score and the simple 12/21 cross disagree. Those are the bars where the crude version would have put you on the wrong side.
In the separate pane below:
- The stepped line is the score, from -1.00 to +1.00, filled to the zero line and coloured by state.
- Dotted lines at +0.5 and -0.5 give you a sense of how strong the agreement is. A score of +1.00 is twelve out of twelve. A score of +0.17 is seven against five, which is a trend barely holding together.
The dashboard, bottom right by default:
- The big number is the current score, with the state next to it.
- The bar beside it is a gauge. It fills outward from the middle, right and green for bullish, left and red for bearish.
- The twelve indicators are listed in two columns, the six trend-following ones on the left and the six oscillators on the right, each showing its own vote. This is where you see WHY the score is what it is.
- "12/21 agree" is the share of days where the twelve indicator score and the simple EMA cross pointed the same way, measured across all the history your chart has loaded. Read it as a rough measure of how often the crude version would have agreed with the careful one. It is measured against the raw cross with no filtering, so treat it as an indication rather than a precise statistic.
- "Regime" is how many days the current state has lasted. It turns amber below eight days, because a trend that has not lasted eight days has a habit of being noise.
HOW TO USE IT
The simplest use is the one it was built for. When the score is above zero, the crypto market is in an uptrend and you hold risk. When it is below zero, it is not, and you do not. You act on the close, and you execute on the open of the next candle. Anything earlier is acting on a candle that has not finished forming.
Set an alert if you do not want to watch it. The script exposes two alert conditions, one for the turn up and one for the turn down, and both fire only on a confirmed daily close.
Read the twelve rows when the score is near zero. A score of +0.17 that is being held up by two oscillators is a very different situation from a +0.17 where the trend-following group is turning. The individual votes tell you which one you are in.
THE WIDER SYSTEM THIS BELONGS TO
This indicator is one rung of a ladder. The idea is that you are always holding the strongest available thing, and that the decision is made in steps rather than all at once.
Step one. This indicator, on the total crypto market cap. If it is positive, you stay in crypto and you go to step two. If it is negative, you leave crypto and go to step three.
Step two, only when crypto is bullish. An ETH/BTC ratio TPI decides which of the two majors leads. Positive means ether is outperforming and ether is the base holding. Negative means bitcoin is. From there a further layer of ratio TPIs compares mid caps against whichever major won, and the ones that are outperforming get a share of the book.
Step three, when crypto is bearish. A gold TPI. If gold is in an uptrend, that is where the money sits.
Step four, when gold is not working either. An index TPI on the S&P 500. If equities are trending up, that is the holding.
Step five, when nothing is trending. Cash, and a EUR/USD TPI decides whether that cash is better held in euros or in dollars.
Each rung is its own TPI, built the same way: twelve indicators, one vote each, tuned separately for that market. The ladder simply asks them in order.
A SET, NOT A SINGLE SCRIPT
This is the first published piece of that set. The other rungs are built and running and will follow as separate publications, each one an indicator for its own market, all reading the same way so you only have to learn the layout once.
ABOUT THE SETTINGS
The twelve indicators and their periods are visible in the settings and in the source. They were tuned for this specific market against a cleaned 12/21 EMA reference on daily data from January 2023 onward, with regimes shorter than eight days treated as noise and removed before the tuning was scored. The symbol itself has daily history back to March 2014 if you want to look further back.
Those numbers are right for the total crypto market cap. They are not automatically right for anything else. If you put this on another symbol, expect to retune. That is the honest answer, and it is why each market in the set gets its own publication rather than one script with a symbol dropdown.
Two of the twelve are read on a smoothed line rather than the raw one, which is deliberate: the CCI is scored on its EMA 5 smoothing and the RSI on its EMA 9. The Awesome Oscillator is scored on its raw line. Those choices are in the code and commented.
HOW FAITHFUL THE REBUILD IS
Because seven of the twelve are rewritten from other people's published formulas rather than called directly, the obvious question is whether they behave the same. They do. Every one of the twelve votes was compared bar by bar against the original indicator running on the same chart, across the full loaded history. Zero disagreements on any of the twelve, and the combined score matched on every single bar.
That check is worth repeating if you change a setting, and it is why each vote is exposed as a hidden plot in the script rather than kept internal.
CREDIT WHERE IT IS DUE
Seven of the twelve components are reimplementations of open-source community scripts, written from their published formulas so they could all live in one indicator and be scored consistently. Full credit to the original authors:
- Gaussian Channel by DonovanWall
- Optimized Trend Tracker by KivancOzbilgic
- Awesome Oscillator v2 by KivancOzbilgic
- Hull Suite by InSilico
- SSL Channel by ErwinBeckers
- Follow Line Indicator by Dreadblitz
- WaveTrend by LazyBear
The remaining five are standard: ALMA, CCI, RSI, Coppock Curve and the Fisher Transform.
What is added here is the aggregation into a single score, the confirmed close behaviour, the per indicator breakdown, the agreement measurement against the reference, and the ladder logic this is built to serve.
LIMITATIONS AND A PLAIN WARNING
This is a trend indicator. It is late by design. It will not catch the exact top or the exact bottom, and it is not supposed to. It will be wrong in a sideways market, which is what the eight day regime warning is there to tell you.
Nothing here is financial advice. It is a tool for reading a chart. Past behaviour of any indicator tells you nothing reliable about the future. Do your own work and size your positions so that being wrong is survivable.
指標

Unmitigated Gaps by Midniteblade4H Unmitigated Gaps — Build Summary
A Pine Script indicator that finds and draws unmitigated Fair Value Gaps (FVGs) on the 4H timeframe, from any chart timeframe you're viewing.
What it does
An FVG is a three-candle imbalance — a move so fast that price left a gap no two-way auction filled. The script looks for two kinds:
Bullish FVG — candle 3's low is above candle 1's high (l3 > h1). Price skipped up; the gap sits below.
Bearish FVG — candle 3's high is below candle 1's low (h3 < l1). Price skipped down; the gap sits above.
Each gap is drawn as a box and stays on the chart until price trades back through it ("mitigated"). The info table reports live counts, the nearest gap above/below price, and the stored 4H period data.
The three bugs we hit — and why each mattered
1. max_bars_back rejected built-in series. The script needed deep history for dynamic indexing. Pine refused max_bars_back(volume, 5000) because volume, close, open, hlc3 are built-ins — the parameter needs a user-declared series. Fix: assign each to a variable first, then declare.
2. The history buffer was keyed to the wrong variable. This is the subtle one. We declared history on the new variables — but the loop still indexed volume , close directly. Pine sizes its buffer for the exact series you reference, so the declarations did nothing and the runtime error came back. Fix: swap every dynamic index in the loop to the declared variables.
Lesson: declaring max_bars_back on a variable only helps if that variable is what you actually index. The declaration follows the reference, not the value.
3. The live test compared a bar against itself. The ongoing check read candle 3 from the n-1 slot while also treating the live bar as a separate candle — but those were the same bar. It could never detect a new gap. Fix: compare the newest stored period against the two before it, so all three candles are genuinely distinct.
Lesson: when a test returns zero forever, check whether its inputs are actually independent before assuming the market is quiet. A debug row showing the raw stored values is what exposed this.
Debug technique worth stealing
We added a table row printing the last three stored htfH/htfL pairs — . That single row let us verify the array was storing sane values and cross-check them against the table's own "Cur/Prev period" rows. When the numbers matched, the storage was proven correct; when the live test still failed, the bug had to be in the comparison logic.
Print your raw inputs, not just your outputs. An output of 0 tells you nothing. The inputs tell you why.
Takeaway
Three separate bugs, each hidden behind the last. The first fix looked like it worked until the second surfaced; the second looked complete until the third appeared. Debugging in sequence — fix, re-run, read the new error — is what got there. Skipping verification after a fix would have left all three in place. 指標

Delta Exchange Lot CalculatorNo more worries about lot size calculations.
================================================================================
Delta Exchange Calculator — Script Description & Publication Guide
================================================================================
Delta Exchange Calculator is an all-in-one position sizing and risk management
script built specifically for crypto derivatives traders on Delta Exchange. It
calculates your exact contract/lot size, required margin buffer, and real-time
liquidation price directly on your chart while fully accounting for maker/taker
fees and Indian GST (18%).
Currently, the indicator supports lot calculations for over 219 pairs, with new
trading pair specifications continuously added in future updates.
--------------------------------------------------------------------------------
1. WHY USE THIS INDICATOR?
--------------------------------------------------------------------------------
Trading crypto futures with static lot sizes or rough mental math often leads to
unexpected losses due to order fees, contract multipliers, and sudden liquidations.
This indicator eliminates manual calculations, ensuring your target dollar risk
remains precise and consistent on every single setup.
--------------------------------------------------------------------------------
2. HOW TO USE (INTERACTIVE LEVEL SELECTION)
--------------------------------------------------------------------------------
Step 1: Add to Chart
• Apply the indicator to your desired Delta Exchange trading pair.
Step 2: Set Trade Levels Directly on the Chart
• When prompted upon loading (or by reopening settings), click 3 points on your chart:
1. 1st Click: Target Entry Price (Blue line)
2. 2nd Click: Invalidation / Stop Loss Price (Red line)
3. 3rd Click: Target Take Profit Price (Green line)
• The script automatically identifies whether the trade is LONG or SHORT based on
the relationship between your Entry and Stop Loss levels.
Step 3: Configure Your Account & Risk
• Account Size ($): Enter your current equity (e.g., $500).
• Risk %: Enter how much of your account you want to risk on the trade (e.g., 1% = $5.00 max loss).
• Margin Mode & Leverage: Select Isolated or Cross Margin and choose your target leverage
(automatically capped to the pair's maximum allowed limit).
• Order Types & GST: Choose Maker/Taker for entry and exit, and toggle the 18% GST fee buffer.
Step 4: Place Your Order
• Look at the on-screen dashboard and enter the calculated Normal Lot Size
(or Scalper Lot Size) directly into the Delta Exchange order form.
--------------------------------------------------------------------------------
3. CORE LOGIC & FEATURES
--------------------------------------------------------------------------------
• 219+ Supported Pairs & Future Updates:
Native support for over 219 Delta Exchange pairs. Newly listed pairs and contract
specification updates are continuously integrated via the shared library.
• Fee & GST-Inclusive Risk Sizing:
Standard calculators only measure price difference. This script factors in:
Total Loss = Price Distance Loss + Entry Fee + Exit Fee + 18% GST
This ensures your actual realized loss matches your exact cash risk when Stop Loss is hit.
• Auto Contract Spec Detection:
Fetches contract multipliers, maintenance margin rates, and pair leverage caps
directly from the contract library.
• Dual Lot Sizing Options:
- Normal Lot Size: Formulated for standard swing positions and default fee tiers.
- Scalper Lot Size: Calibrated for active intraday scalpers using Delta Exchange discounted fee structures.
• Smart Liquidation Warning:
Calculates real-time liquidation for Isolated and Cross margin modes. If high leverage causes
your liquidation price to hit BEFORE your Stop Loss, the dashboard flags the metric in bright
red with an alert tooltip.
• Dynamic Leverage Ceiling:
Automatically caps user leverage to the pair's maximum allowed exchange limit.
--------------------------------------------------------------------------------
4. DASHBOARD METRICS EXPLAINED
--------------------------------------------------------------------------------
• Margin & Leverage : Active margin mode and effective leverage vs. exchange maximum cap.
• Contract Scale : Underlying coin multiplier per 1 exchange contract lot.
• Funds Required : Total initial margin needed plus a buffer for order fees.
• Cash at Risk (SL Hit) : Exact dollar amount lost if Stop Loss triggers (fees included).
• Liquidation Price ⚠️ : Estimated liquidation price (highlighted in red if SL is unprotected).
• Scalper / Normal Lots : Final calculated lot count to enter on the exchange order form.
================================================================================ 指標

Fractional EMA Cross Backtest StrategyFractional EMA Cross Backtest Strategy
This strategy is a configurable EMA crossover backtesting framework designed to evaluate two-EMA and sequential three-EMA crossover structures across different symbols and chart timeframes.
Unlike Pine Script's native ta.ema() function, which requires integer lengths, this script calculates exponential moving averages using the standard smoothing factor:
Alpha = 2 / (Length + 1)
This allows the user to test fractional EMA periods such as 13 / 48.5, as well as conventional integer combinations.
Entry logic
The strategy supports two operating modes.
Two-EMA mode
When EMA 3 is disabled:
Long setup: Fast EMA crosses above the Intermediate EMA.
Short setup: Fast EMA crosses below the Intermediate EMA.
A trade is submitted only when there is no existing open position. Opposite signals do not reverse an active trade.
Three-EMA mode
When EMA 3 is enabled, the strategy uses a sequential crossover structure rather than requiring all three averages to cross on the same bar.
Long sequence:
Fast EMA crosses above Intermediate EMA.
The long sequence becomes armed.
Intermediate EMA subsequently crosses above Slow EMA.
That second crossover becomes the final Long entry trigger.
Short sequence:
Fast EMA crosses below Intermediate EMA.
The short sequence becomes armed.
Intermediate EMA subsequently crosses below Slow EMA.
That second crossover becomes the final Short entry trigger.
If the Fast EMA crosses back through the Intermediate EMA before the second stage occurs, the pending sequence is cancelled.
The chart's Cross 01 marker represents the effective entry signal used by the strategy. With two EMAs, it is plotted at the Fast/Intermediate crossover. With three EMAs, it is plotted at the Intermediate/Slow crossover that completes the sequence.
Order execution
The strategy uses:
Initial capital: USD 3,000
Default position size: 10% of equity
Pyramiding: 0
Fixed commission: USD 0.10 per order
process_orders_on_close = false
calc_on_order_fills = true
calc_on_every_tick = true
Because process_orders_on_close is disabled, a historical market entry generated on a confirmed crossover bar is normally filled on the next available tick, typically the opening price of the following chart bar.
Recalculation after order fills is enabled so that the strategy can initialize its stop, target, risk, TRIM level and trade state from the actual simulated fill price. Tick-by-tick recalculation is enabled for real-time responsiveness. Historical strategy results are still constrained by the price information available in the chart's historical bars.
Risk management
Risk per trade is expressed as a percentage of strategy equity and is configurable up to 2%.
Default:
Risk per trade: 1%
Target: 3.5R
Minimum configurable target: 2R
After an entry is filled, the strategy calculates the initial monetary risk and derives the corresponding stop distance from the simulated position size.
For Long positions:
Stop is placed below the entry.
Target is placed above the entry according to the selected R multiple.
For Short positions:
Stop is placed above the entry.
Target is placed below the entry.
Position sizing and risk percentage are separate concepts in this implementation. The strategy uses 10% of equity as the position allocation, while the selected risk percentage determines the monetary risk used to calculate the stop distance.
TRIM
The script includes a visual TRIM reference.
Default TRIM level:
75% of the distance from Entry to Target
TRIM is informational only and does not reduce the position.
If price gaps beyond the calculated TRIM level, the bar's opening price is used as the visual TRIM execution reference.
Maximum holding time
A configurable maximum holding period is included, with a default of 30 sessions.
Positions that remain open beyond this limit are closed using a TIME EXIT.
Trade classification
Closed trades are classified as:
TARGET
STOP
TIME EXIT
Backtest statistics
The table reports:
Closed trades
Wins
Losses
Win Rate
Profit Factor
Expectancy in R
Net P&L
ROI
Maximum Drawdown
Average Holding Time
Target Exits
Stop Exits
Time Exits
Realized R is calculated as:
Realized R = Trade Profit / Initial Risk Cash
The script also displays an R-distribution table using the following buckets:
<= -1.0R
-0.5R
0.0R
+0.5R
+1.0R
+1.5R
+2.0R
+2.5R
+3.0R
= +3.5R
A statistical summary includes:
Mean R
Sample Standard Deviation
Sample confidence
The script classifies the number of closed trades as:
Below 50: LOW
50 to 99: PRELIM.
100 or more: VALID
These labels refer only to sample size. They are not a statement about the quality, profitability or future reliability of the strategy.
How to use
Start by selecting the EMA lengths you want to test.
Example two-EMA configuration:
13 / 48.5
Example three-EMA configuration:
13 / 48.5 / 200
Then evaluate the strategy across different symbols, market regimes and timeframes. The strategy is not restricted to a specific chart timeframe.
Comparisons should be made using sufficiently large datasets and consistent assumptions for commission, position sizing, risk and holding time.
Originality
The main purpose of this script is not simply to reproduce a standard EMA crossover. It combines fractional EMA calculation, optional sequential three-EMA crossover logic, fixed monetary-risk modeling, visual TRIM tracking, time-based exits, realized-R classification, R-distribution analysis and sample-dispersion statistics within a single modular backtesting framework.
The entry logic is intentionally separated from the fixed strategy engine so that different crossover configurations can be tested without rebuilding the risk-management and statistical framework.
Limitations
Backtest results are hypothetical and depend on the selected symbol, timeframe, available historical data, market liquidity and TradingView's broker emulator.
Historical bars do not contain complete tick-by-tick price paths unless additional lower-timeframe information is available to the broker emulator. Stop, target and gap behavior should therefore be interpreted as simulated historical execution rather than actual fills.
The strategy does not model slippage beyond the configured commission.
A parameter combination that performed well historically may not perform similarly in future market conditions.
This script is intended for research, education and strategy testing. It is not financial advice and does not constitute a recommendation to buy or sell any security. 策略

指標

MACD Momentum StructureMACD Momentum Structure
MACD Momentum Structure transforms the traditional MACD into a visual momentum framework designed to make changes in market momentum easier to interpret.
Instead of relying only on the conventional MACD histogram and signal-line crossover, the script organizes momentum into a dynamic visual structure that highlights how momentum develops, expands, slows, and transitions.
What It Shows
Momentum Wave
A smoothed representation of MACD that makes the underlying momentum structure easier to follow.
Momentum Phases
The indicator identifies different stages of momentum development, including:
* Bullish Acceleration
* Bullish Expansion
* Bullish Deceleration
* Bearish Acceleration
* Bearish Expansion
* Bearish Deceleration
* Transition
These phases help visualize whether momentum is strengthening, continuing, weakening, or transitioning.
Momentum Turning Points
Confirmed swing points are highlighted on the momentum wave to make important changes in momentum structure easier to identify.
Momentum Flow
A visual flow element extends the current momentum direction to illustrate the potential continuation path of the current momentum structure. This is a visual aid, not a prediction or guarantee of future price movement.
Momentum Divergence
The indicator can highlight potential bullish and bearish divergence between price structure and MACD momentum, helping identify situations where price movement and underlying momentum may be developing differently.
MACD Structure
The traditional MACD, signal line, histogram, and zero-line relationship remain visible, while the additional visual structure provides greater context around those familiar signals.
How to Read It
The visual structure can be interpreted as a sequence of momentum development:
Acceleration → Expansion → Deceleration → Transition
Strong acceleration and expansion indicate increasing momentum, while deceleration can indicate that the current momentum is losing strength. A transition phase highlights a change in the relationship between momentum and its signal structure.
The purpose is not to predict the market with certainty, but to make momentum behavior more visible and easier to analyze.
Important Note
This indicator is a visual analytical tool based on MACD calculations and momentum structure. Turning points and divergence signals are confirmed using historical data and may appear with a delay.
It does not provide guaranteed future price predictions, entry signals, or trading results.
Use it together with price action, market structure, volatility, and other forms of technical analysis as part of a broader trading process.
指標

D.vis Swing Engine - RP + RVOL + Trend## English
**D.vis Swing Engine – Relative Performance + Relative Volume + Trend**
D.vis Swing Engine is a swing trading indicator designed to identify stocks that combine positive trend structure, relative strength versus the S&P 500, and above-average trading volume.
The indicator combines several technical components into a single visual framework:
**Relative Performance (RP)** compares the stock's performance with the S&P 500, using SPY as the default benchmark. A positive RP value means the stock has outperformed the benchmark during the selected lookback period. The indicator also measures whether Relative Performance is improving or deteriorating.
**Relative Volume (RVOL)** compares the current trading volume with the stock's average volume over a selected period. An RVOL above 1.0 indicates above-average volume, while values such as 1.5x or 2.0x indicate significantly increased market participation.
The indicator classifies high relative volume on bullish candles as **Money In** and high relative volume on bearish candles as **Money Out**. These readings should be interpreted as proxies for buying and selling pressure rather than literal capital inflows or outflows.
The trend component uses:
- EMA 9
- EMA 21
- SMA 50
- SMA 200
The primary bullish trend condition requires price to trade above EMA 9 while EMA 9 is above EMA 21. SMA 50, SMA 200, and EMA 21 slope filters can optionally be enabled for more restrictive setups.
The indicator also calculates a **Setup Score from 0 to 5** based on five conditions:
1. Price is above EMA 21.
2. EMA 9 is above EMA 21.
3. Relative Performance is positive.
4. Relative Performance is rising.
5. Relative Volume exceeds the selected threshold on a bullish candle.
The dashboard classifies the setup as:
**WAIT** – insufficient conditions are aligned.
**WATCH** – most conditions are aligned and the stock may be approaching a valid setup.
**BUY 5/5** – trend, Relative Performance, and Relative Volume conditions are fully aligned.
A BUY label is displayed only when the complete bullish setup becomes valid for the first time, helping reduce repeated signals during an already established trend.
The indicator also includes a **RISK** condition designed to highlight potential distribution. This occurs when price falls below EMA 21, Relative Performance becomes negative, and strong relative volume appears on a bearish candle.
### Suggested settings for swing trading
- Benchmark: SPY
- Relative Performance Timeframe: Daily
- RP Lookback: 63 trading days
- RP Momentum Period: 5 trading days
- RVOL Average Length: 20
- RVOL Threshold: 1.5x
- SMA 50 Filter: Optional
- SMA 200 Filter: Optional
This indicator is intended as a decision-support tool and should not be used as a standalone trading system. Market structure, support and resistance, earnings, fundamental factors, risk management, and broader market conditions should also be considered.
---
## Română
**D.vis Swing Engine – Performanță Relativă + Volum Relativ + Trend**
D.vis Swing Engine este un indicator pentru swing trading conceput pentru a identifica acțiunile care combină o structură tehnică pozitivă, performanță relativă superioară față de S&P 500 și volum de tranzacționare peste medie.
Indicatorul combină mai multe componente tehnice într-un singur sistem vizual:
**Relative Performance (RP)** compară performanța acțiunii cu S&P 500, folosind implicit SPY drept benchmark. O valoare RP pozitivă înseamnă că acțiunea a performat mai bine decât benchmark-ul în perioada selectată. Indicatorul măsoară și dacă performanța relativă se îmbunătățește sau se deteriorează.
**Relative Volume (RVOL)** compară volumul curent de tranzacționare cu volumul mediu al acțiunii din perioada selectată. Un RVOL peste 1,0 indică un volum peste medie, iar valori precum 1,5x sau 2,0x indică o creștere semnificativă a participării în piață.
Indicatorul clasifică volumul relativ ridicat pe lumânări bullish drept **Money In**, iar volumul relativ ridicat pe lumânări bearish drept **Money Out**. Aceste valori trebuie interpretate ca aproximări ale presiunii de cumpărare sau vânzare, nu ca intrări sau ieșiri literale de capital.
Componenta de trend utilizează:
- EMA 9
- EMA 21
- SMA 50
- SMA 200
Condiția bullish principală cere ca prețul să fie peste EMA 9, iar EMA 9 să fie peste EMA 21. Filtrele SMA 50, SMA 200 și panta EMA 21 pot fi activate opțional pentru setup-uri mai restrictive.
Indicatorul calculează și un **Setup Score de la 0 la 5**, bazat pe cinci condiții:
1. Prețul este peste EMA 21.
2. EMA 9 este peste EMA 21.
3. Relative Performance este pozitiv.
4. Relative Performance este în creștere.
5. Relative Volume depășește pragul selectat pe o lumânare bullish.
Dashboard-ul clasifică setup-ul astfel:
**WAIT** – nu sunt îndeplinite suficiente condiții.
**WATCH** – majoritatea condițiilor sunt îndeplinite, iar acțiunea se poate apropia de un setup valid.
**BUY 5/5** – condițiile de trend, Relative Performance și Relative Volume sunt complet aliniate.
Eticheta BUY este afișată doar în momentul în care setup-ul bullish complet devine valid pentru prima dată, reducând astfel semnalele repetate în timpul unui trend deja confirmat.
Indicatorul include și o condiție **RISK**, concepută pentru a evidenția posibile perioade de distribuție. Aceasta apare atunci când prețul scade sub EMA 21, Relative Performance devine negativ, iar pe o lumânare bearish apare un volum relativ ridicat.
### Setări recomandate pentru swing trading
- Benchmark: SPY
- Timeframe Relative Performance: Daily
- RP Lookback: 63 zile de tranzacționare
- RP Momentum Period: 5 zile
- Media pentru RVOL: 20 perioade
- Prag RVOL: 1,5x
- Filtru SMA 50: Opțional
- Filtru SMA 200: Opțional
Indicatorul este conceput ca instrument de suport pentru luarea deciziilor și nu trebuie utilizat ca sistem de tranzacționare independent. Structura pieței, suporturile și rezistențele, raportările financiare, factorii fundamentali, managementul riscului și condițiile generale ale pieței trebuie analizate separat. 指標

MOMENTUM MATRIXMOMENTUM MATRIX is a single-pane momentum dashboard that combines a zero-lag oscillator, a volume-weighted money flow histogram, automatic divergence detection, a four-factor confluence strip, and a live table that tracks the historical hit rate of every signal the script prints. The goal is to show momentum, participation, and trend agreement in one place, and to let you measure how the signals have actually performed on the chart you are looking at instead of trusting a marketing claim.
█ WHAT IT SHOWS
1. Wave (upper band, 0 to 100)
A stochastic oscillator applied to a zero-lag EMA of price instead of raw price, smoothed once and paired with a short signal line. The zero-lag input reduces turning-point delay by roughly one bar compared with a standard stochastic or RSI while keeping the familiar 0 to 100 scale. Dotted levels mark overbought (default 80), midpoint (50), and oversold (default 20). The wave colours green when rising above its signal line and red when falling below it.
2. Money Flow (lower band, -100 to 0)
A histogram of net buying or selling pressure. Each bar's volume is signed by where the close sits inside the bar's range, then smoothed with an EMA and normalised by average volume so the reading stays between -100 and +100 across any symbol. Columns are drawn from the band midpoint: above it means net inflow, below it means net outflow. Columns become solid when the reading exceeds the overflow level (default 40), which flags unusually one-sided pressure.
3. Divergences
Regular bullish and bearish divergences between price and the Wave are found from pivot highs and lows (default 3-bar pivots, maximum 40 bars apart) and labelled on the pane.
4. Confluence strip (bottom row)
A thin colour strip scoring -4 to +4 from four independent checks: Wave above or below 50, Wave above or below its signal line, Money Flow positive or negative, and price above or below a 21-period zero-lag EMA. Bright green or red means all four agree; grey means they conflict.
5. Signals
Reversal buy: Wave crosses up through the oversold level while Money Flow is positive and the wave is rising.
Reversal sell: mirror of the above at the overbought level.
Momentum buy: Wave crosses up through 50 while Money Flow is positive and volume is at least 1.2 times its average.
Momentum sell: mirror of the above.
Each signal type has its own alert condition, plus alerts for both divergence types.
6. Accuracy table (top right)
Shows the current state and confluence score, live Wave, Money Flow, and trend readings, and the running hit rate of each of the four signal types on this chart. A hit is counted when price moves at least X percent (default 0.5) in the signal direction within N bars (default 6). Both thresholds are inputs, so you can set them to match your own targets. The counters are computed from the loaded history, so they reflect the symbol and timeframe you are viewing.
█ HOW TO USE IT
Treat the pane as context, not as a stand-alone entry system. The most useful reads are:
- Trend continuation: confluence strip at +3 or +4 (or -3 / -4), Money Flow on the same side, and a Momentum signal in that direction.
- Exhaustion: Wave in the overbought or oversold zone while Money Flow overflow fades, or a divergence label appears.
- Filtering: check the hit-rate table before acting on a signal type. If a signal has printed twenty times on your chart with a 40 percent hit rate, that tells you more than any indicator marketing.
On my own tests across BTC, HYPE, and ZEC on the 4-hour chart, simple oversold and overbought reversal signals from any oscillator, including this one, land close to a coin flip. Confluence-gated momentum signals did better on strongly trending symbols and worse on ranging ones. The table exists so you can see this for yourself on every chart.
█ INPUTS
Wave: zero-lag EMA length, stochastic length, smoothing, signal length, overbought and oversold levels.
Money Flow: length and overflow level.
Confluence: trend ZLEMA length.
Divergence: pivot length, maximum bars between pivots, show or hide.
Signals: volume multiplier for momentum signals, show or hide.
Accuracy: evaluation bars and hit threshold percent.
Display: show or hide the table.
█ NOTES
Works on any symbol and timeframe. Signals and divergence labels are confirmed on bar close and do not repaint. Hit-rate counters use only bars available in the chart history, so they will differ between timeframes and between accounts with different history limits. 指標

指標

Relative Volume TiersVolume bars that change colour when volume is unusual: grey is normal, orange is high, magenta is extreme. Each bar is compared with the normal volume for that time of day over the last 20 sessions, so the open and close don't get coloured every day just for being busy. I use it to see whether a move has real volume behind it. It works from 5 second charts up, and the thresholds adjust to the timeframe automatically.
This is a volume indicator that looks like the regular volume bars, but each bar is coloured by how unusual its volume is. I made it to check whether a move on the chart has real participation behind it or is happening on thin volume.
How it works
Every bar is compared to a baseline, which is the volume you would normally expect for that bar. The bar then gets one of three colours (all adjustable):
- Gray: normal volume
- Orange: high volume, above the High multiplier times the baseline
- Magenta: extreme volume, above the Extreme multiplier times the baseline
The baseline
On intraday charts the baseline is based on time of day. A bar at 9:35 is compared with the 9:35 bars of the previous 20 sessions, not with the bars right before it. Without this the open, the close and news times would get coloured every day just because they are always busy, and the quiet midday hours would never get coloured at all. This way a bar is only coloured when its volume is unusual for that time of day.
A 5 second chart only covers a day or so of history, which is not enough for this. So on 5s, 10s, 15s, 30s and 1m charts the time of day profile is built from 5 minute data, which goes back much further, and scaled down to the chart's bar size.
If a time slot does not have enough history yet (5 sessions by default), or on daily and higher charts, the indicator uses the average of the previous 20 bars instead. The current bar is never part of its own baseline.
You can choose Median or SMA for the average. Median is the default, because one news day will not keep the baseline high for weeks afterwards.
Multipliers by timeframe
Volume on small bars jumps around much more than on large ones, so one pair of multipliers does not fit every timeframe. With Auto multipliers on, the indicator picks them based on the chart timeframe (High / Extreme):
- 10s and below: 2.5 / 5.0
- 15s to 30s: 2.0 / 4.0
- 45s to 4m: 1.8 / 3.0
- 5m to 20m: 1.5 / 2.5
- 30m and above: 1.4 / 2.0
All of these can be changed in the settings. Turn Auto off to use one fixed pair on every timeframe.
Other options
- Down bars (close below open) can be drawn fainter, so you still see direction.
- Price candles can be painted in the high and extreme colours.
- The live bar can be coloured by its projected volume, which is the volume so far divided by the part of the bar that has passed. It starts after 35% of the bar by default and can change until the bar closes. The bar height always shows the real volume.
- A baseline line, plus optional High and Extreme threshold lines.
- An info label showing the current relative volume, the multipliers in use and which baseline is active.
- Alerts for high, extreme, and high or extreme volume. They only trigger on closed bars.
Setup tip
The indicator is drawn on the price chart like the built-in volume. TradingView keeps a bottom margin under custom indicators, so the bars will float a little above the bottom edge. To make them sit on the bottom, right-click the chart, go to Settings > Canvas > Margins and set Bottom to 0. The Volume height setting controls how tall the bars are. If you would rather have it in its own pane, move it there and set Volume height to 100.
Notes
- Volume shows how many traders took part in a move, not which way price will go next. A big spike after a long run can mean the move is ending rather than starting.
- On futures, volume moves to the next contract around rollover, so make sure you are looking at the contract that has the volume.
- Time of day is only used on regular time based charts. On Renko, range and tick charts the indicator uses the average of the previous bars. 指標

Kinetic Trend & Momentum Oscillator: Driver Cluster [MantisAlgo]KINETIC TREND & MOMENTUM OSCILLATOR: 🚗DRIVER CLUSTER
Read market momentum like a driver reads the road.
Driver Cluster brings together trend speed, changes in momentum, trading activity, and directional strength in a car-style dashboard. A steering wheel and illuminated pedals show the latest signal, while the instrument cluster helps you follow how the move develops.
The indicator uses an Ehlers SuperSmoother filter to reduce small price fluctuations before measuring movement. Think of it as smoothing out bumps in the road so the overall direction is easier to read.
🟢 THE DRIVER COCKPIT
The cockpit sits at the top right of the main price chart by default. Its name, color, and pedal position work together to show the latest accepted signal.
• DRIVE — Cyan
An upward regime has started. The steering wheel and accelerator light up, and the accelerator appears pressed.
• REVERSE — Coral
A downward regime has started. The steering wheel and accelerator turn coral, with the accelerator pressed.
• BREAK — Violet
A brake event has occurred. The accelerator is released, and the brake pedal lights up in its pressed position.
• NEUTRAL — Gray
The cockpit is waiting for its first accepted signal in the loaded chart history.
DRIVE and REVERSE remain displayed until another qualifying event changes the state. BREAK stays lit until the next DRIVE or REVERSE.
The cockpit remembers the latest signal. The lower dashboard shows current conditions, so the two displays can tell different parts of the same story.
📊 FOUR GAUGES, FOUR QUESTIONS
SPEED — How fast is the trend moving?
SPEED measures the pace and direction of the smoothed price movement.
• Above zero: upward movement.
• Below zero: downward movement.
• Near zero: little directional movement.
It is adjusted for recent volatility, making the reading more useful than a raw change in dollars or points.
TORQUE — Is the trend gaining or losing momentum?
Calculated from changes in trend speed, TORQUE helps you see whether a move is strengthening or easing.
For an upward move, positive torque means upward speed is increasing; negative torque means it is decreasing. For a downward move, negative torque can mean the decline is getting faster, while positive torque can mean it is slowing.
A useful distinction: SPEED can remain high while TORQUE weakens, just as a car can still be moving quickly after it begins to slow down.
BOOST — How active is the market?
BOOST compares reported trading volume with its recent average.
• Around 1.0x: roughly average activity.
• Above 1.0x: higher activity.
• Below 1.0x: lower activity.
POWER — How strong is the overall momentum reading?
POWER combines movement speed with TRACTION, a measure of how consistently price travels in one direction rather than zigzagging. Relative trading activity contributes to the calculation where available.
The gauge shows a percentage of the selected reference level. At 95% or higher, it displays MAX.
POWER measures intensity, not direction. Both a strong rise and a strong decline can produce a high reading.
🟢 SIGNALS & DRIVING STATES
DRIVE and REVERSE combine directional speed, torque, and traction to identify the start of a qualifying move. Trading activity provides additional confirmation where available, and a cooldown helps separate directional launches.
• DRIVE appears as a cyan triangle below the signal bar.
• REVERSE appears as a coral triangle above the signal bar.
• A brake event appears as a violet square labeled BRAKE; the cockpit displays BREAK.
A brake event occurs when an active move meets the deceleration or weakening-speed conditions. A qualifying opposite-direction signal can also switch the regime directly.
The lower dashboard follows the move through states such as LAUNCH DRIVE, STEADY CRUISE, POWER ACCEL, DECELERATING, and REVERSE DRIVE.
OVERHEAT highlights unusually high torque or POWER readings. It draws attention to momentum intensity rather than predicting a reversal.
🛣️ CHART & DASHBOARD VIEW
On the main chart:
• The steering wheel and pedals show the latest accepted signal.
• Optional candle colors reflect the current momentum phase.
• A smoothed price line helps reveal the underlying path.
• Signal markers identify directional launches and brake events.
In the lower pane:
• The main curve shows SPEED.
• The shaded ribbon emphasizes its distance from zero.
• The thin torque curve shows changes in speed on its own scale.
• Dotted boundaries at +0.20 and -0.20 mark the neutral speed band.
• The instrument cluster combines the four gauges, PRND gear selector, and driving status.
⚙️ CUSTOMIZATION
Adjust price smoothing, torque smoothing, volatility measurement, traction, and the volume lookback to suit your analysis.
Launch threshold, brake sensitivity, and cooldown settings control how the indicator responds to changing conditions.
The cockpit and lower dashboard have independent position controls. You can also adjust the cockpit proportions and show or hide chart colors, lines, signals, and the neutral band.
🔔 ALERTS & SIGNAL TIMING
Alert conditions are available for:
• Forward ignition — DRIVE.
• Reverse ignition — REVERSE.
• Brake events.
• Momentum overheat.
Chart signals can change while a candle is still open. Select Once Per Bar Close when creating an alert if you want notifications based on the closing update.
The cockpit's Change pedal state on closed bars only option is enabled by default. It makes the steering wheel and pedals wait for the candle close before accepting a new signal. This option controls the cockpit display, not the timing of all chart signals.
⚠️ DISCLAIMER
Driver Cluster is a technical-analysis and educational tool. It does not execute trades or guarantee future results. Signals describe calculated market conditions and should be evaluated alongside your own analysis and risk management.
指標
