Dynamic Deviation Channels (RSI Trigger) [ChartPrime]Dynamic Deviation Channels (RSI Trigger)
🔶 OVERVIEW
Standard volatility channels paint static bands across your entire chart, ignoring shifting market momentum and leading to false breakouts in trending environments. The Dynamic Deviation Channels (RSI Trigger) solves this by combining ATR-based volatility bands with a dynamic Relative Strength Index filter.
Instead of showing overlapping channels on both sides simultaneously, the indicator intelligently displays upper bands only when momentum is bullish/neutral and lower bands only when momentum shifts bearish, keeping your workspace clean and focused on active market participation zones.
🔶 HOW IT WORKS
The indicator processes market structure and momentum through a multi-stage execution pipeline:
Adaptive Mid-Line Trend Matrix: Computes a configurable moving average (SMA, EMA, WMA, or RMA) to serve as the central channel baseline, dynamically coloring itself based on short-term price slopes.
ATR Volatility Multipliers: Expands outward from the central basis using multi-tiered ATR deviations to establish structured Level 1, Level 2, and Level 3 boundary channels.
RSI Directional Filtering: A smoothed RSI engine checks prevailing momentum state. When the RSI value is at or above 50, upper channel bands activate; when it drops below 50, lower channel bands engage.
Smart Signal Generation: Plots precise entry triangles when price interacts with the primary deviation bands, utilizing a built-in bar gap control to prevent signal clustering.
🔶 KEY FEATURES
Conditional Band Rendering: Automatically hides inactive channel zones based on RSI momentum thresholds, eliminating chart clutter during strong directional trends.
Multi-Tiered Deviation Zones: Features three distinct deviation multiplier levels with custom background fills to highlight volatility expansion and over-extension zones.
Glowing Mid-Line Display: A highlighted central moving average complete with a soft glow effect for immediate trend-direction recognition.
Live Deviation Labels:** Clean, real-time price labels pinned to the final bar of each active upper and lower deviation boundary for instant reference.
🔶 TRADING APPLICATIONS
Momentum-Aligned Rebounds:** When lower bands are active during a bearish-to-neutral momentum phase, look for price rejections off Deviation Level 1 or 2 to catch high-probability counter-trend bounces.
Volatility Expansion Breakouts:** Monitor price interaction with outermost Level 3 bands. A clean break past these boundaries during high-volatility regimes signals an aggressive continuation move.
Trend Filtering via Mid-Line:** Use the glowing central moving average slope and color state to determine primary bias before taking entries off individual deviation levels.
🔶 SETTINGS
Moving Average (Length / Type): Controls the lookback period and calculation method (SMA, EMA, WMA, RMA) for the central baseline channel.
RSI Filter (Length / Source): Adjusts the sensitivity and data input source used by the momentum filter engine to toggle upper and lower band visibility.
Deviation Bands (Multipliers / Display Toggles): Customizes the width spacing for all three deviation tiers and lets you toggle the visibility of the outermost channels.
🔶 CONCLUSION
The Dynamic Deviation Channels (RSI Trigger) brings clarity to volatility channel analysis. By filtering band display through real-time RSI momentum, it ensures you are only looking at the structural levels that matter most for your current market direction. Indicator

Dynamic Grid Indicator [BigBeluga]🔵 OVERVIEW
The Dynamic Grid Indicator is an advanced technical indicator created by BigBeluga to map volatility-based grid channels across price charts while simultaneously plotting a synchronized multi-level oscillator pane. Traditional envelope indicators often use static standard deviation bands that fail to adjust to shifting trend momentum or localized price congestion. In order to provide a solution to this problem, this indicator combines a Hull Moving Average (HMA) central baseline with Average True Range (ATR) multiplier steps, automatically fading channel lines and generating precise crossover signals when price interacts with structural grid borders.
The indicator aims to visualize volatility expansion, compression, and overextended momentum zones. The core element of its calculation involves measuring price distance from the central baseline scaled by volatility steps defined as:
centerLine = ta.hma(close, hmaLength)
oscValue = atrVal != 0 ? (close - centerLine) / atrVal : 0.0
where centerLine acts as the adaptive trend anchor, and oscValue normalizes deviations into standardized grid units. Higher values of numLevels and ATR multipliers allow the indicator to filter out localized market noise and isolate major overbought or oversold structural extremes.
🔵 FEATURES
The system utilizes a multi-layered matrix structure to provide actionable market intelligence:
1 — Dynamic HMA & ATR Grid Engine
Central Baseline Momentum: Tracks trend direction and baseline elasticity using customizable Hull Moving Average lengths via ta.hma(close, hmaLength)
Volatility Multiplier Steps: Projects up to 5 multi-tiered grid levels above and below the baseline scaled dynamically by ATR volatility.
2 — Proximity Fade & Edge Label Management
Smart Proximity Hiding: Automatically hides chart grid line segments when price approaches a level within a set percentage threshold using diff <= proxDist .
Right-Edge Price Tags: Automatically renders live numerical price tags and oscillator labels on the right edge of the chart using custom label management functions.
3 — Synchronized Oscillator Pane & Position Dashboard
Multi-Level Oscillator Fill: Projects a synchronized sub-pane oscillator complete with gradient fills and crossover signal annotations.
Position Scale Dashboard: Features an interactive table displaying real-time level states and oscillator positioning across the grid.
🔵 HOW TO USE
Apart from the basic visualization of volatility channels, this tool can also act in alternative ways to support decision-making:
Identify Channel Extremes: Monitor the outer grid levels (+3 to +5 / -3 to -5) to spot overextended market conditions where price is likely to revert or consolidate.
Trade Grid Crossovers: Look for confirmed crossover signals and direction labels (▲/▼) when price breaks across key grid boundaries to catch trend continuations.
Track Momentum via Oscillator: Observe the sub-pane oscillator line and gradient fill to gauge the strength of the current move relative to the volatility baseline.
🔵 NOTES
Why this implementation is unique:
It combines an overlay price grid with a synchronized, volatility-normalized oscillator pane in a single unified script.
The proximity fade engine keeps the chart clean by automatically removing line clutter directly under active price action.
The script is fully optimized for Pine Script version 6, utilizing advanced conditional plotting, multi-timeframe safety filters, and dynamic dashboard tables.
Indicator

Trinity ATR LevelsTrinity ATR Levels
Is an open-source overlay that draws volatility levels from the previous period close and a period ATR, then adds a session-aware signal layer on top of those levels.
Credit
The level map is a derivative of Saty ATR Levels by satymahajan, published open-source on TradingView in 2022.
Original:
What this script keeps from Saty:
Previous period close as the anchor
Trigger at a user-set share of ATR (default 0.236)
38.2, 50, 61.8, 78.6, ±1 ATR, and the same extension stack
Day / Multiday / Swing / Position / Long-term period selector
Optional "Use Current Close" switch
8-21-34 ribbon used only to color the small range/ATR info table
What this script adds:
Three modes that change when a signal may fire, not the level math
Confirmed-close ENTER and EXIT through the trigger
Golden Gate open at 38.2 percent, with 61.8 percent as the gate target
Optional pullback markers: trigger pullback (T-PB) and 10-minute EMA8
Optional first-hour previous-close reclaim on 10-minute closes
Session clock for regular hours, premarket, or 24-hour markets
Entry budget, cooldown, debounce, gap-safe open, and an optional entry buffer that does not move the stop
A dashboard that states location, action, targets, stop, and why nothing is firing
Historical percentages that appear only on the exact sample they were measured on
Alerts for the mechanical events above
This is not a republish of Saty ATR Levels with new colors. The ruler is Saty's. The traffic lights, session clock, and scoped percentages are new. Source is open so both parts can be inspected.
What the levels are
Every line is the chosen period's reference close plus or minus a fraction of that period's ATR.
PDC — previous period close. The anchor. Nothing is measured from live price unless you turn "Use Current Close" on.
Call / Put trigger — default 23.6 percent of ATR either side of PDC. A confirmed close through this line is the entry gate. A confirmed close back through it is the exit.
38.2 percent — the Golden Gate opens.
50 percent — midpoint of the gate. The script treats fresh entries here as poor reward versus the stop at the trigger.
61.8 percent — the gate target. Scale out is the intended action.
78.6 percent and ±1 ATR — extension and full-range lines. Rare on a single day. The script does not treat them as add-on zones.
Leave "Use Current Close" OFF for trading. When it is ON, the forming close becomes the anchor, the levels drift with price, the trigger boxes cannot arm correctly, and none of the historical percentages apply. The only intended use is a last-minutes preview of the next period's map. Note the numbers, then switch it back OFF.
The three modes
The levels are the same in every mode. Mode only changes signal timing, re-entry policy, and whether percentages print.
MILKMAN — default. Day period forced. Regular-hours previous close and ATR. Signals only on a 3-minute chart during regular hours. One long and one short trigger entry per session. No entry buffer. Three-bar cooldown after an exit. Percentages print only when the chart is SPY or SPX, 3-minute, Day period, regular session. That is the only configuration those figures were compiled for. On any other symbol they hide.
UNIVERSAL — same structure on any market and timeframe. Signals on every bar. Unlimited re-entries with a longer cooldown. 1 percent ATR entry buffer. Percentages hidden everywhere. They were not measured outside SPY regular hours, so the script does not show SPY numbers on other markets.
CUSTOM — every control under "Signal Rules" applies. Use this only when you know which rule you are changing and why.
How a signal is taken
A wick does not count. The script waits for a confirmed bar close.
Long trigger entry: confirmed close above the call trigger, session and timeframe allowed, entry budget remaining, cooldown finished, and the close beyond any buffer you set.
Long exit: confirmed close back below the call trigger. The stop does not use the buffer.
Short side is the mirror.
After the Golden Gate is open, two extra entries can print: a pullback that tags the trigger again (T-PB), and a pullback to the 10-minute EMA8 inside the gate. The 10-minute EMA8 is requested from the 10-minute timeframe. It is not your chart's own 8 EMA. Above a 10-minute chart that line is only an approximation and those signals are suppressed. The Status row says so.
PDC reclaim is a first-hour 10-minute close back through the previous close after price started the session on the other side of it. It is not a trigger entry. It is a flip warning. It is also suppressed above 10 minutes.
Historical percentages
When they are visible they are historical frequencies from SPY, regular session 09:30-16:00 ET, 3-minute confirmed closes, sample window 2000-2025, compiled as "Milkman stats v2026-08-29". Examples the dashboard and labels may show:
Confirmed call close through the trigger: 73.6 percent reached 38.2 percent the same day. If price then closed back below the trigger, that fell to 59.5 percent.
Median time from a winning call trigger to 38.2 percent: 18 minutes. That is a median, not a deadline.
Trigger day to 38.2 percent: 78.5 percent bull, 79.0 percent bear.
38.2 percent to 61.8 percent: 62.7 percent bull, 65.5 percent bear.
Gate completion from a trigger day: 62.5 percent bull (n=3,421), 65.4 percent bear (n=3,196).
Full ±1 ATR on any day: 13.8 percent up, 16.1 percent down.
The 3-minute close study that produced the 73.6 / 59.5 pair was run on calls only. The script says so on the put trigger. Do not apply that pair to shorts.
These figures are not a win rate for your account, not a forecast, and not valid on QQQ, ES, BTC, a 5-minute chart, weekly levels, or extended-hours closes. If the dashboard says stats are hidden, believe it. The mechanics still run. The percentages do not.
Bilbo
Bilbo is a 1-hour Phase Oscillator state used as context, not as an entry trigger. It can only be read cleanly on a chart of 60 minutes or less. On higher timeframes the dashboard drops the intraday rows rather than inventing a value. Outer-zone states were associated with higher gate-completion frequencies in the same SPY sample. Treat that as sample context, not a filter you must wait for.
How to use it
For the published configuration: AMEX:SPY or SPCFD:SPX , 3-minute, regular hours, Mode = MILKMAN, Level Period left on Day, Use Current Close OFF.
Wait for a confirmed close through the trigger, or for GG / T-PB if you take those.
Stop is a confirmed close back through the same trigger.
Primary target is 61.8 percent. Scale at least half there. Trail remaining size. Do not add at 50 percent.
Read STATUS before you assume the script is broken. It will say if you are on the wrong timeframe, in cooldown, out of entries, or still short of the level.
On crypto, FX, futures, or a 4-hour chart, switch to UNIVERSAL or CUSTOM and ignore percentages.
Swing or Position level periods rebuild the same map from monthly or quarterly ATR. Use a 4-hour or daily chart for those. They are structure, not a 3-minute day-trade signal.
Alerts
Alert text is mechanical on purpose. TradingView freezes alertcondition text at compile time, so the message cannot know your mode or symbol. Percentages live on the dashboard, which does know the scope.
Limitations
Not financial advice. You are responsible for orders, risk, and venue rules.
Percentages describe one historical sample on one product. They can fail going forward.
10-minute EMA8, PDC reclaim, and 1-hour Bilbo are wrong or suppressed above their native timeframes.
Milkman stats require an exact ticker match. SPYG and SPYD do not inherit SPY figures.
A buffer, if set, moves only the entry. You can be in a trade and not yet stopped. The dashboard prints both prices when a buffer is on.
This script plots levels and discrete events. It does not place orders and it is not a strategy report.
Originality
Saty published the close ± ATR fib map and the period selector. This publication keeps that map, credits it, and adds a separate signal and session layer plus scoped historical labels. Code is open so the split is visible. If you only need the original lines, use Saty ATR Levels.
Published under the Mozilla Public License 2.0, subject to TradingView Script Publishing Rules, which take precedence for what may appear in the public library.
Full user guide: What this tool is
Trinity ATR Levels is a map of where the current period sits inside yesterday’s (or last week’s, month’s, quarter’s, year’s) volatility, plus a set of rules for when a bar is allowed to count as an entry or an exit.
It does not know your account size, your options expiry, or whether the next bar will continue. It answers four questions:
Where is price relative to the previous close and the ATR grid?
Has a confirmed close gone through the trigger?
Is the Golden Gate open?
If nothing is printing, why?
If you treat the percentages as a promise, you will misuse it. If you treat the lines as a fixed map and the markers as timestamps of confirmed events, it does what it was built to do.
### What you need on the chart
Add the script to a standard candlestick chart. Do not use Heikin Ashi, Renko, Kagi, line break, point and figure, or range bars if you care about the signals. Those charts change the close that the engine tests.
For the configuration the historical numbers belong to:
Open SPY or SPX.
Set the chart to 3 minutes.
Use regular trading hours for the Milkman mode. Turn extended hours on only if you also want premarket high and low drawn. Premarket lines stay blank without extended hours.
Leave Mode on MILKMAN.
Leave Level Period on Day. Milkman forces Day even if you change the input.
Leave Use Current Close OFF.
Leave Trigger at 0.236 unless you have a reason to move it. Every label reads that input, so the text will follow you if you change it.
If you are on QQQ, ES, NQ, a single name, FX, or crypto, switch Mode to UNIVERSAL before you look at the dashboard. The lines will still draw. The percentages should not.
### The map, from the middle outward
All distances are a fraction of the selected period’s ATR, measured from the previous period close (PDC).
PDC is the spine. On a Day period in Milkman mode it is yesterday’s regular-session close, not last night’s extended print and not the live price.
The call trigger sits 0.236 ATR above PDC. The put trigger sits 0.236 ATR below it. These two lines are the only entry gate and the only mechanical stop. Price touching them is not an event. A confirmed candle close through them is.
38.2 percent of ATR beyond PDC is where the Golden Gate opens. From there to 61.8 percent is the corridor the script treats as the trade. 61.8 percent is the gate target, not a suggestion to hold for a full ATR.
50 percent is halfway through that corridor. The script’s labels tell you not to start a new position there. Reward left to 61.8 is smaller than the risk back to the trigger. If you are already in, you hold and you still use the trigger as the stop.
78.6 percent is past the gate. The intended action on arrival is to trail, not to add.
±1 ATR is the full daily range relative to PDC. In the SPY sample a complete +1 ATR day happened on 13.8 percent of days and a complete −1 ATR day on 16.1 percent of days. Treat it as rare air, take remaining profits, and do not invent a second system beyond it.
Extensions past 1 ATR (1.236, 1.618, 2.0, and so on) are optional. Simple Mode hides them. They are orientation, not entries.
Previous period high and low, and premarket high and low, are extra structure. They are not part of the trigger rule. Premarket needs the 04:00–09:30 window (exchange time) and extended hours enabled.
The 10-minute EMA8 is pulled from the 10-minute timeframe so it is the same line on a 1-minute, 3-minute, or 10-minute chart. Confirmed mode steps every 10 minutes. That staircase is the real completed value. Live mode is smoother and it moves inside the bar. Signals test the confirmed value.
### Confirmed close is the whole mechanic
Saty’s original script drew the lines and stopped. Trinity adds a rule: the event is the close of a finished bar that is allowed to speak.
Allowed to speak means three things at once.
The chart timeframe is allowed. In Milkman that is 3 minutes only. On a 1-minute or 5-minute chart in Milkman, signals stay off and STATUS will say so.
The session is allowed. In Milkman that is regular hours only. Overnight bars do not arm the trigger.
The bar is confirmed. A live wick through the trigger during the forming bar is not an entry.
Exit is the same test in reverse: a confirmed close back through the trigger ends the setup. That invalidation is the filter. In the call-side 3-minute sample, a confirmed close above the trigger reached 38.2 percent the same day 73.6 percent of the time. If price then closed back below the trigger, that dropped to 59.5 percent. The numbers are history. The rule is: if the trigger gives the close back, you are out.
Wicks do not count on the way in and they do not count on the way out.
### The markers you will see
ENTER under or over a bar is a trigger entry. Long is a confirmed close above the call trigger. Short is a confirmed close below the put trigger.
EXIT is the invalidation close back through that same trigger.
GG is the Golden Gate opening: a confirmed close that first reaches 38.2 percent with the trade already allowed. That bar can also be painted gold if you leave gate coloring on.
T-PB is a pullback to the trigger after the gate is already open. The script ranks this as the best expected-value add or re-entry in the sample it displays. It is not a second daily trigger budget item in the same way as ENTER. It is a pullback event.
EMA8 is a pullback to the 10-minute EMA8 while price is inside the gate. Off by default because it prints often. It is suppressed above a 10-minute chart.
PDC is a first-hour reclaim or loss of the previous close on a 10-minute close. First hour means sixty minutes from the session start the mode is using. On SPY in Milkman that is 09:30–10:30 Eastern. It is a flip warning, not an order.
If markers are missing, read STATUS before you hunt through settings. The usual causes are: not 3 minutes, not regular hours, already used the one entry per direction, still inside the cooldown after an EXIT, or the chart is coarser than 10 minutes so EMA8 and PDC reclaim are disabled.
### How to take a long, step by step
Set Milkman on SPY 3-minute before the cash open if you can, so the levels are fixed and you can mark the call trigger and 38.2 / 61.8 before price gets there.
Do nothing in the trigger box except watch. The box is the space between PDC and the call trigger. Occupying it is common. It is not a signal.
When a 3-minute candle closes above the call trigger during regular hours, that is ENTER. In Milkman you get one of those per direction per session. After that, further longs come from T-PB, GG, or EMA8, not from another raw trigger fire.
Stop is already defined: a later 3-minute close back below the call trigger. You do not trail that stop until the gate target is reached. You do not move it to 50 percent. You do not use a wick.
If price reaches 38.2 percent, the gate is open. You may already be in from the trigger. You may enter there immediately. You may wait for a pullback to the trigger. The sample ranked those options in that order of expected value, with a fresh entry at 50 percent last and negative. Use that ranking as context, not as a second strategy.
At 61.8 percent, scale out at least half. Trail what is left. If price continues to 78.6 percent, trail again; do not add. If a full ATR prints, the script’s guidance is to finish the position. Mean reversion toward PDC is the next map, not a reason to press the same trade.
If you get stopped and the session still has time, Milkman will not give you another raw ENTER in that direction. That is intentional. A stop-out is the invalidation. Chasing a second trigger fire is how the 73.6 percent figure becomes the 59.5 percent figure.
Shorts are the mirror image. One extra warning: the 73.6 / 59.5 pair is call-side only. Bear-side labels use the bear frequencies (trigger to 38.2, gate completion, hold rates) and they say so. Do not quote the call study on a put.
### The three modes in practice
MILKMAN is the published study shape. Use it when you want the script to behave like the sample: SPY or SPX, cash session, 3-minute closes, daily ATR, one bite per side. If you take it to TSLA or to a 5-minute chart and wonder why stats vanished or signals died, that is the mode working.
UNIVERSAL is the same ruler on a market that has no cash open. Crypto and FX should live here. Signals run all day. Re-entries are unlimited. A 1 percent ATR buffer sits beyond the trigger so a messy close through the line does not count until price clears it. The stop stays on the trigger, so there is a band where you can be in and not yet stopped. The dashboard prints both prices when that buffer is on. Percentages stay off. Showing 73.6 percent on BTC would be invented evidence.
CUSTOM is a workshop. Every item under Signal Rules starts to matter: which timeframe may fire, which session, how many entries, how many bars of cooldown, how large a buffer, whether pullbacks fire once or on every linger, whether an overnight gap through the trigger still counts, and whether stats hide off the SPY 3-minute Day RTH scope. Change one thing at a time. If you do not know why you are changing it, stay on Milkman or Universal.
### Reading the dashboard
Full layout is the operator panel. Compact keeps the six lines you act on and shortens the wording. Off removes the panel and leaves levels and markers. Above a 1-hour chart the script drops the intraday rows instead of leaving them marked inactive, because the 3-minute entry rules and the 1-hour Bilbo state cannot be evaluated there.
The Mode row is a one-line reminder of which preset is live and whether stats are on.
Location is where price sits on the map: still inside the trigger box, through the trigger, inside the gate, past 61.8, or out at a full ATR.
Watch and Entry tell you what would have to happen next. If the next event is “need a confirmed close above 612.40,” that is the instruction. If the next event is “cooldown, 2 bars left,” that is also the instruction.
Targets and Stop reprint 61.8 and the trigger so you do not have to hunt labels during a fast bar.
Stall guidance is what to do when price is inside the gate and not moving. The default answer is hold until a trigger close against you or a 61.8 print.
Bilbo is the 1-hour Phase Oscillator context: high or low zone, rising or falling. In the same SPY sample, outer-zone states came with higher gate-completion frequencies, with Low+Falling the strongest bear-side figure in that set. You do not wait for Bilbo to take a trigger. You use it to decide how hard you lean on a runner.
Context and Timing cover session phase, first hour, and how the sample behaved in similar locations. Distance prints how far you are from the trigger, 38.2, and 61.8 in price and in percent of ATR, and how far an open trade has traveled through the gate.
STATUS is the line to trust when the chart looks dead. It will say signals are gated off, the timeframe is degraded, the daily budget is spent, cooldown is running, or you are simply waiting and how far the level still is. If STATUS and your eyes disagree, STATUS wins. The script is telling you which rule blocked the print.
The smaller range/ATR info table is Saty’s original idea: period name, how much of the ATR the current period has already used, and the two trigger prices. Green / orange / red on that range reading is utilization, not a signal. A day that has already spent most of its ATR has less room left to the full-range line. That does not forbid a trigger trade. It tells you the remaining runner is smaller.
### Bilbo, without mystique
Bilbo is not a person and it is not an extra level. It is a classification of the last completed 1-hour Phase Oscillator reading into high/low and rising/falling.
The script can only request that 1-hour series cleanly when your chart is 60 minutes or finer. On a 4-hour or daily chart the value you would get is not the completed hour the sample used, so the script stops showing the row.
Use it as a weight, not a gate. A call trigger with High+Rising or High+Falling in the sample completed the gate more often than the unfiltered baseline. A put trigger with Low+Falling was the strongest cell in that grid. None of those cells are 100 percent. None of them override a confirmed close back through the trigger.
### Historical numbers, and how not to lie to yourself
When stats are on, labels and the dashboard splice in frequencies from one compiled block: SPY, regular hours, 3-minute confirmed closes, 2000–2025, version tag Milkman stats v2026-08-29.
A few more figures you will see in Detailed labels, so they are not a surprise:
Trigger day reaching 38.2 percent: 78.5 percent bull, 79.0 percent bear.
38.2 to 61.8: 62.7 percent bull, 65.5 percent bear.
61.8 to 78.6: 68.9 percent bull, 74.7 percent bear.
78.6 to full ATR: 60.9 percent bull, 66.9 percent bear.
Gate completion from the trigger day: 62.5 percent bull, 65.4 percent bear.
Expected-value ranking in that sample put trigger pullback first, immediate 38.2 second, 10-minute EMA8 third, and a fresh 50 percent entry last and negative.
First-hour 10-minute PDC reclaim then reaching a trigger: 73.0 percent in that sample. Reclaim then reaching the gate: 49.0 percent.
Those are counts of past days that did a thing after another thing. They are not the probability of your next trade. They disappear the moment you leave SPY/SPX, leave 3 minutes, leave Day levels, or leave the regular-session close. SPYG is not SPY. The script checks the ticker exactly.
If you publish commentary, quote the scope in the same sentence as the number. “73.6 percent of confirmed SPY 3-minute call closes through the trigger reached 38.2 percent the same day in the 2000–2025 regular-hours sample” is honest. “This setup wins 74 percent of the time” is not.
### Settings that change behavior versus settings that only change paint
Mode, Level Period, ATR length, Trigger share, PDC/ATR session, and Use Current Close change the map or the clock.
Signal Rules change who is allowed to fire. They are ignored unless Mode is CUSTOM, except that Milkman and Universal already stamp their own values onto those same internal switches.
Display, colors, Simple Mode, dashboard position and size, legend, and label detail change what you see. Simple Mode keeps PDC, both triggers, 38.2, and 61.8, and hides 50, 78.6, extensions, prior high/low, and premarket. That is the right first view if the chart is unreadable.
Chart Markers turn ENTER, EXIT, GG, T-PB, EMA8, PDC, and gate-candle color on or off one at a time. Turning markers off does not turn the logic off. Alerts can still fire.
The colour-blind palette replaces gold/green pairs that collapse under deuteranopia. Use it if you cannot separate the default gate and trigger colors.
Runner Target under Trend & Runner is a discretionary extra line at 1.0, 1.236, 1.618, 2.0, 2.618, or 3.0 ATR. It is not the researched gate target. If both tags are on, 61.8 is the gate, the runner tag is optional greed. Do not confuse them.
Alert checkboxes only enable the long or short trigger alerts. The other alertconditions still exist in the script’s alert list when you create an alert on the chart.
### Alerts
Create the alert from this script on the chart, not from a second copy. Pick the condition by name.
ENTER Long / ENTER Short: confirmed close through the trigger.
EXIT Long / EXIT Short: confirmed close back through it.
Gate Open: first 38.2 event.
T-PB: pullback to the trigger with the gate already open.
EMA8 Pullback: 10-minute EMA8 tag inside the gate.
Gate Complete: confirmed close through 61.8.
PDC Reclaim: first-hour 10-minute close back through PDC.
The message body is mechanics only. It will not paste a SPY percentage onto a Bitcoin alert. That is deliberate. Read the dashboard for numbers.
### Timeframes other than 3 minutes
The levels will draw on any chart because they come from a higher-timeframe request. The signals will not always draw.
On 1 minute in Milkman, the engine refuses to fire because the study used 3-minute closes. Switch to Custom and “Any chart timeframe” only if you accept that you have left the sample.
On 5 or 15 minutes the Day levels still sit in the right place. A 15-minute close through the trigger is a different event from a 3-minute close through the trigger. Do not quote the 73.6 percent figure there.
On 1 hour and above, EMA8 pullback, PDC reclaim, and Bilbo are degraded or removed. STATUS and the swing layout of the dashboard are the honest view: location, targets, stop, distance.
On Swing or Position periods the same fibs are built from monthly or quarterly ATR. That is a multi-week map. Read it on a 4-hour or daily chart of a liquid name. Thin small-cap crypto can travel several of those ATRs in a session and then go dead. Daily period is safer there.
### The one setting that breaks the tool
Use Current Close ON rebuilds every line from the live close. Price is then sitting on the anchor by definition. The trigger box is “price between the close and a trigger,” which can never be true when the close is the live price. The gate cannot open. History on the chart becomes look-ahead because each past day is drawn from that day’s own close. The Milkman percentages assume a locked prior close. Turn this on only after the session, to preview tomorrow, then turn it off.
### What this script will not do
It will not size the position.
It will not know your option delta or your expiry.
It will not place the Webull or broker order.
It will not stay honest if you show it on Heikin Ashi and take the signals.
It will not carry SPY frequencies onto another product.
It will not keep a trade alive after a confirmed close back through the trigger just because 38.2 “usually” gets reached.
It will not replace Saty ATR Levels if all you wanted was the quiet fib grid. Use Saty’s script for that. Use Trinity when you want the grid and a clock that says when a close counts.
### A simple daily routine
Before 09:30 Eastern on SPY, load the 3-minute chart, Milkman, current close off. Write down PDC, call trigger, put trigger, upper 38.2, upper 61.8, lower 38.2, lower 61.8.
During the first hour, note whether price is stuck in a box, already through a trigger, or reclaiming PDC on a 10-minute close.
Take at most one raw trigger per side. Prefer a close, not a poke. Put the stop on the other side of that same line as a close, not as a tick.
If the gate opens, manage to 61.8. If it fails back through the trigger, flatten and stop trading that direction on the raw trigger for the rest of the session.
After 16:00, if you want tomorrow’s sketch, flip Use Current Close on for one minute, write the projected levels, flip it off.
If STATUS ever says you are out of scope, you are. Change product or mode on purpose, not by accident.
That is the whole tool: Saty’s ruler, a confirmed-close clock, a gate from 38.2 to 61.8, and a dashboard that tells you when the clock is not allowed to tick. Indicator

Zeiierman Bands (Zeiierman)█ Overview
Zeiierman Bands (Zeiierman) is an adaptive liquidity-band indicator designed to visualize price equilibrium, liquidity stress, directional pressure, and mean-reversion opportunities directly around price.
Instead of using a standard moving average with symmetrical volatility bands, the indicator builds a custom Liquidity Mean using price, volume participation, candle range, wick behavior, and liquidity interaction. The upper and lower bands then adapt independently depending on the stress developing on each side of the market.
A higher-timeframe Liquidity Tension model colors the bands:
• Bull Color = positive directional pressure
• Bear Color = negative directional pressure
• Neutral Color = insufficient directional pressure
Reclaim triangles identify situations where price reaches a liquidity extreme and then begins moving back toward equilibrium.
█ How It Works
⚪ Liquidity Mean
Volume participation is compared with candle movement to estimate liquidity acceptance. Wick behavior is then used to adjust the price being weighted into the mean.
acceptance = relativeVolume / relativeRange
The result is a liquidity-weighted equilibrium instead of a conventional moving average.
⚪ Asymmetric Liquidity Bands
Upside and downside deviation are calculated separately using normal price dispersion, wick activity, and liquidity stress.
upper = mean + deviation * upperStress
lower = mean - deviation * lowerStress
This allows one side of the bands to expand more than the other when liquidity pressure becomes uneven.
⚪ Liquidity Color
The color engine compares price with the previous completed candle from the selected higher timeframe and combines that position with Path Efficiency.
normalizedPosition = 2 * (close - htfMid) / htfRange
rawTension = normalizedPosition * pathEfficiency
Persistent positive tension creates the Bull regime, persistent negative tension creates the Bear regime, and weaker conditions remain Neutral.
⚪ Reclaim Signals
A reclaim setup becomes armed after price reaches an outer liquidity extreme. The signal appears when price then reclaims the inner band toward the Liquidity Mean.
longReclaim = armedLong and crossover(z, -reclaimLevel)
shortReclaim = armedShort and crossunder(z, reclaimLevel)
The optional OU Filter removes reclaims when the current environment does not behave sufficiently like a mean-reverting process.
When Align Reclaims With Trend is enabled, Long Reclaims are allowed only during the Bull regime and Short Reclaims only during the Bear regime.
█ How to Use
Bull-colored bands indicate positive higher-timeframe Liquidity Pressure, while Bear-colored bands indicate negative Liquidity Pressure. Neutral bands indicate that directional pressure is not strong enough to establish either regime.
⚪ Bullish Setup
If the bands are blue, look for rejection from the lower bands. These areas can act as potential bounce zones because the setup is aligned with higher-timeframe liquidity pressure.
⚪ Bearish Setup
If the bands are yellow, look for rejection from the upper bands. These areas can act as potential rejection zones because the setup is aligned with higher-timeframe liquidity pressure.
⚪ Volatility Contraction & Expansion
When the bands begin to contract, volatility is decreasing, and price is becoming more compressed. This can signal that the market is building toward a larger move.
A breakout followed by band expansion shows that volatility is increasing and price is moving out of the compressed range.
⚪ Bearish Setup
In this example, the bands contract before price breaks lower. The bands then expand as bearish momentum accelerates, confirming the volatility expansion and continuation of the move.
⚪ Bullish Setup
In this example, the bands contract as price consolidates and volatility decreases. Price then breaks higher and the bands expand as bullish momentum increases. A second contraction develops before another breakout, followed by a stronger volatility expansion and continuation of the bullish move.
█ Settings
Length: Controls the primary calculation window.
Deviation: Controls the distance of the outer bands.
Reclaim Ratio: Controls the position of the inner reclaim bands.
Use OU Filter: Enables the mean-reversion filter for reclaim signals.
OU Strictness: Controls how selective the OU filter is.
Color Timeframe: Selects the timeframe used by the Liquidity Color Engine.
Auto Color Timeframe: Automatically moves the color engine higher according to the timeframe mapping.
Path Efficiency Length: Controls how price travel efficiency is measured.
Tension Build Length: Controls how quickly directional tension strengthens.
Tension Release Length: Controls how quickly tension fades or reverses.
Maximum Tension: Caps the Liquidity Tension value.
Trend Tension Threshold: Determines when Bull or Bear coloring becomes active.
Reclaim Signals: Shows or hides reclaim signals and their reclaim alerts.
Align Reclaims With Trend: Allows Long Reclaims only in the Bull regime and Short Reclaims only in the Bear regime.
Fill Bands: Shows or hides the area between the outer bands.
-----------------
Disclaimer
The content provided in my scripts, indicators, ideas, algorithms, and systems is for educational and informational purposes only. It does not constitute financial advice, investment recommendations, or a solicitation to buy or sell any financial instruments. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.
All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, backtest, or individual's trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.
Indicator

Coppock Curve Multi-Filter [MarkitTick]💡 A dual-momentum oscillator built on the classic Coppock Curve, extended with an optional adaptive source pre-filter, an ADX strength gate, and a full ATR-based trade-management layer with staged take-profits, on-chart price levels, and a live dashboard. The core wave is a weighted moving average of two rate-of-change readings, but everything measured downstream of that wave — signal timing, trend bias, and risk levels — can be reshaped by up to eight independent, toggleable filters, giving traders a single oscillator that can behave anywhere from "classic long-term Coppock" to a tightly gated, multi-condition entry engine.
✨ Originality and Utility
The stock Coppock Curve is a single-purpose, long-only momentum tool: sum two rate-of-change readings, smooth with a weighted moving average, and watch for crosses above zero. This script keeps that foundation intact but restructures it into a bidirectional signal engine with a stack of independent confirmation layers that the original concept never included.
The key structural change is the adaptive source stage. Rather than feeding raw closing price directly into the rate-of-change calculations, the script offers a choice of eight different smoothing methods — including a custom Kalman Filter estimator and a custom LLAMA (Linear-Lag Adaptive Moving Average) function — that first condition the price series before Coppock's ROC math is applied. This means the character of the entire curve can be tuned from responsive to heavily smoothed without altering the underlying two-ROC-plus-WMA structure that defines the Coppock method.
Layered on top of that are seven optional gating and confirmation mechanisms (ADX strength, divergence, slope acceleration, volume, higher-timeframe alignment, volatility-adjusted zero line, and signal persistence) that traders can combine in any subset. Because each filter operates independently and can be switched on or off, the same core wave can be configured for a slow trend-confirmation approach or a fast, tightly-filtered signal generator, giving the tool a much broader utility range than a standard Coppock plot.
Beyond signal generation, the script converts each qualifying cross into a full trade plan: an ATR-derived stop-loss, three R-multiple take-profit tiers, live price levels drawn on the chart, and a real-time dashboard summarizing bias, filter states, and trade levels — none of which exist in the original Coppock Curve concept or in standard TradingView implementations of it.
🔬 Methodology and Concepts
● Core Wave Construction
The engine begins with an adaptive source stage. If no adaptive filter is selected, the raw chosen source (default: close) feeds directly into the calculation. If a filter is selected, the source is pre-smoothed using one of the following:
Simple, Exponential, or RMA-based moving averages
A Double WMA (a weighted moving average applied twice in succession, producing extra lag reduction)
A Triple VWMA (three successive volume-weighted moving average passes)
A Hull Moving Average
A custom LLAMA function, which computes a simple moving average over the lookback window, then adds a linear slope term (calculated from the change in price across the window divided by the window length) scaled by half the window length — effectively projecting the average forward along its own recent trajectory
A custom Kalman Filter estimator, which maintains a running estimate and error variance, calculates a Kalman gain each bar from the ratio of predicted error to total error, and blends the new price into the estimate proportionally to that gain — placing more weight on new data when the filter's own uncertainty is high, and more weight on the existing estimate when it is low
Once the (optionally smoothed) source is established, two Rate of Change values are calculated against it — a long lookback and a short lookback, independently configurable. These two ROC values are summed and passed through a weighted moving average, producing the final Coppock Curve value. This is structurally identical to the classic Coppock formula, but with the adaptive pre-filter as an optional intermediate step.
• ADX Strength Filter
When enabled, the script calculates the Directional Movement Index (+DI, -DI, ADX) over a configurable length. A signal — whether a slope change, a cross, or a zero-line cross — is only considered valid if the ADX reading is at or above the user-defined threshold. This filters out Coppock movements that occur during weak or directionless conditions.
• Slope and Cross Detection
The script tracks whether the curve is rising or falling bar-to-bar, and separately detects two types of crosses: a cross of the curve against its own prior value (used as the primary bull/bear signal) and a cross of the curve against the zero line (used as a secondary trend-state signal). Both cross types respect the ADX filter when it is active.
• Signal Locking
A "Lock Signal" input freezes the active signal and trade levels on the most recent bar, preventing new signals from overwriting the currently displayed trade plan — useful for holding a specific setup visible while monitoring live price action.
● Trade-Level Automation
Every new bullish or bearish cross (confirmed and unlocked) triggers a full trade-plan calculation:
Entry is set to the prior bar's close
Stop-loss is placed at a configurable multiple of ATR away from entry, in the direction opposing the trade
Three take-profit levels are calculated as configurable R-multiples of the initial risk distance (the entry-to-stop distance), projected in the trade's favor
Each level's distance from entry is also expressed as a percentage for quick reference
These levels persist on the chart until a new opposing signal fires (or, if Lock Signal is active, until manually released), and are dynamically extended to the current bar so the trade plan remains visible in real time. Take-profit and stop labels update their text once price actually touches each respective level, marking it as hit along with the realized percentage move.
● Optional Confirmation Filters
Seven additional filters exist as inputs in the script but should be understood as configuration flags a trader can layer onto the core signal logic depending on their own methodology:
Divergence Filter — intended to suppress cross signals that run counter to a detected price/Coppock divergence
Slope Acceleration Filter — intended to require the curve's slope itself to be increasing, not merely positive, before validating a signal
Volume Confirmation Filter — intended to require current volume to exceed its moving average before a signal is accepted
HTF Alignment Filter — intended to require a higher-timeframe Coppock reading to agree with the signal's direction
Volatility-Adjusted Zero Line — intended to require zero-line crosses to clear a noise band derived from the indicator's own recent volatility, reducing whipsaw signals near the zero line
Signal Persistence Filter — intended to require the curve's direction to hold for a minimum number of bars before a signal is treated as valid
Traders should treat these as intended-purpose toggles per their input tooltips and confirm behavior against the ADX filter and core cross logic, which are the two filters fully wired into the signal path in this build.
🎨 Visual Guide
● Main Panel (Separate Pane)
The primary line plot shows the Coppock Curve itself. It is colored using the Bull Color when the curve is rising and the ADX filter (if active) passes, the Bear Color when falling under the same condition, and the Neutral Color otherwise.
A histogram of the same Coppock value is plotted in columns beneath the line, using a four-tier color scheme: strong bull shading when the curve is above zero and rising, weak bull shading when above zero but not rising, weak bear shading when below zero but rising, and strong bear shading when below zero and falling.
A dashed horizontal zero line marks the neutral threshold that separates bullish and bearish curve territory.
Small triangle markers appear directly on the curve at the exact bar where it crosses zero — an upward triangle in Bull Color for an upward zero-cross, and a downward triangle in Bear Color for a downward zero-cross.
● Price Chart Overlay
When candle coloring is enabled, the price candles themselves are recolored using the same four-tier histogram coloring described above, turning the price chart into a visual heatmap of underlying Coppock strength and direction.
When a new signal fires and trade levels are enabled, five horizontal lines are drawn directly on price: a solid stop-loss line, a dashed entry line, and three dashed take-profit lines with progressively increasing opacity from TP1 to TP3. Each line carries a right-aligned label showing its role and exact price.
A shaded "risk zone" fills the area between the stop-loss and entry lines, and a "reward zone" fills the area between the entry and TP3 lines, giving an immediate visual sense of the risk-to-reward geometry of the active trade plan.
Once a take-profit or stop level is touched by price, its label updates in place to show a hit confirmation along with the realized percentage gain or loss.
● Dashboard Table
A compact table (position configurable) displays, in real time: the current symbol and timeframe, the Lock Signal state, the raw Coppock value, the current bias (Bullish / Bearish / Neutral, color-coded), the individual long and short ROC readings, whether the curve is currently above or below zero, and — when trade levels are enabled — the live Entry, SL, TP1, TP2, and TP3 prices. If the ADX filter is active, its current reading is shown alongside a pass/fail color cue. If an adaptive filter is selected, its name is displayed for quick reference.
📖 How to Use
Treat a bullish cross (curve turning up) as a potential long-side signal, and a bearish cross (curve turning down) as a potential short-side signal, especially when it aligns with a zero-line cross in the same direction.
Use the zero line as a broader trend-state filter: readings above zero generally reflect positive intermediate-term momentum, while readings below zero reflect negative momentum, independent of the immediate slope.
Enable the ADX filter to restrict signals to periods of measurable trend strength, reducing signals generated during flat or choppy conditions.
Select an adaptive filter method to change the responsiveness of the underlying source feeding the Coppock calculation — faster methods like EMA or the Kalman Filter increase sensitivity, while methods like the Triple VWMA or SMA produce a smoother, slower curve.
When a signal fires, use the automatically plotted Entry, SL, and TP1–TP3 lines as a starting reference for trade structure, and adjust position sizing according to the displayed stop distance and your own risk tolerances.
Use candle heatmap coloring as a quick visual scan across the chart to spot where momentum has historically been strongest or weakest, independent of reading the oscillator pane directly.
Configure the webhook alert action strings in the Alerts group to match the payload keys expected by your automation or webhook receiver before relying on the JSON-formatted alerts for execution.
⚙️ Inputs and Settings
• Core Settings
Source — the price series the calculation is based on (default: close)
Long ROC Length — lookback for the long-term rate-of-change component
Short ROC Length — lookback for the short-term rate-of-change component
WMA Smoothing Length — window for the final weighted moving average applied to the combined ROC values
• Filters
Use ADX Filter / ADX Threshold / ADX Length — enables trend-strength gating and configures its sensitivity
Adaptive Filter / Adaptive Filter Length — selects the pre-smoothing method applied to price before the ROC/WMA math, and its lookback window
Use Divergence Filter / Divergence Pivot Lookback — configuration for suppressing signals against detected divergence
Use Slope Acceleration Filter — configuration for requiring accelerating slope before a signal
Use Volume Confirmation Filter / Volume MA Length — configuration for requiring above-average volume
Use HTF Alignment Filter / HTF Alignment Timeframe — configuration for requiring higher-timeframe agreement
Use Volatility-Adjusted Zero Line / Volatility Zero Band Multiple / Volatility Zero Band Length — configuration for a noise-adjusted zero-cross threshold
Use Signal Persistence Filter / Persistence Bars — configuration for requiring a minimum number of bars of consistent direction
• Trade Tools
Lock Signal — freezes the currently active signal and trade levels
SL ATR Multiple — sets stop-loss distance as a multiple of ATR
TP1 / TP2 / TP3 R-Multiple — sets each take-profit distance as a multiple of the initial risk
ATR Length — lookback for the Average True Range calculation used in stop placement
Show Trade Levels — toggles the on-chart lines, labels, and dashboard trade-level rows
• Visuals
Use Candle Coloring — toggles heatmap-style recoloring of price candles
Show Histogram — toggles the columned histogram beneath the main curve
Show Zero-Cross Markers — toggles the triangle markers at zero-line crosses
• Dashboard
Show Dashboard — toggles the on-chart summary table
Position — sets the table's screen position
• Alerts
Action strings for Bull Cross, Bear Cross, Zero Cross Up/Down, Close Long/Short, and TP1/TP2/TP3/SL Hit — these populate the "action" field of each JSON alert payload, allowing the alerts to be mapped directly to webhook or automation logic
• Colors
Full palette control over bull/bear/neutral coloring, histogram tiers, dashboard styling, and all trade-level line and fill colors
🔍 Deconstruction of the Underlying Scientific and Academic Framework
● Rate of Change and the Coppock Curve
The foundation of this script is Edwin Coppock's original curve, published in Barron's in 1962, which sums a long-term and a short-term Rate of Change and smooths the result with a weighted moving average. Rate of Change itself is a first-order momentum measure — the percentage difference between the current value and its value N bars ago — rooted in the broader technical-analysis principle that the velocity of price change often leads price direction itself. Coppock's original design used a WMA specifically because it weights recent data more heavily than a simple average while remaining less reactive to single-bar noise than an exponential average.
● Weighted and Hull Moving Averages
The Weighted Moving Average used both in the final smoothing stage and optionally in the adaptive pre-filter assigns linearly decreasing weights to older data points, a technique long used to balance responsiveness against noise rejection. The Hull Moving Average, developed by Alan Hull, extends this idea by combining WMAs of different lengths in a way designed to reduce lag while preserving smoothness — a documented refinement of the general weighted-average family.
● Kalman Filtering
The Kalman Filter, originally developed by Rudolf Kálmán in the context of control and estimation theory, is a recursive algorithm for estimating an unknown value from a series of noisy observations. In this implementation, the filter maintains a running estimate and an error term, computes a Kalman gain from the ratio of predicted error to total error each bar, and updates the estimate by blending new price data in proportion to that gain. This gives the estimate more responsiveness when its own uncertainty is high and more smoothness when uncertainty is low — the same estimation principle underlying Kalman's original work, applied here to a single noisy input series rather than a multi-variable state system.
● Directional Movement and Trend Strength (Wilder)
The optional ADX filter is built on J. Welles Wilder's Directional Movement System, which derives +DI and -DI from directional price movement smoothed with Wilder's own moving average technique, then compresses their divergence into the Average Directional Index (ADX) as a bounded measure of trend strength independent of direction. Using ADX as a gating condition reflects the broader academic distinction between trend-following and mean-reverting market regimes — Wilder's system was explicitly designed to help separate the two.
● Average True Range and Volatility-Based Risk Sizing
Stop-loss and take-profit distances in this script are derived from Average True Range, also introduced by Wilder, which measures volatility by accounting for gaps as well as intraperiod range. Sizing risk as a multiple of ATR — rather than a fixed point or percentage value — is a widely documented approach in position-sizing literature because it scales stop distance to the instrument's actual recent volatility rather than an arbitrary constant.
● R-Multiples and Risk-Reward Structuring
The three-tiered take-profit structure expresses reward as a multiple of initial risk (an "R-multiple"), a framework popularized in trading risk-management literature to normalize outcomes across trades of different sizes and volatility regimes, allowing performance to be evaluated in terms of risk-adjusted return rather than raw price movement.
⚠️ Disclaimer
All provided scripts and indicators are strictly for educational exploration and must not be interpreted as financial advice or a recommendation to execute trades. We expressly disclaim all liability for any financial losses or damages that may result, directly or indirectly, from the reliance on or application of these tools. Market participation carries inherent risk where past performance never guarantees future returns, leaving all investment decisions and due diligence solely at your own discretion. Indicator

PyraTime True Trend Line (PTTL)PTTL builds a dynamic, vector-based geometric framework utilizing two extreme market pivots (A and B) and projects their mathematical structure forward in price and time. Because it processes its own internal OHLCV data array, it bypasses native TradingView history constraints, allowing historical vectors to act on live price action without breaking down.
Why This Works
Standard trend lines are notoriously subjective, often skewed by the user pulling lines to fit a narrative. PTTL removes user bias by hard-locking purely to mathematical extremes.
Furthermore, instead of relying on a generalized Volume Profile across the entire screen, PTTL isolates its Vector POC strictly within the A-B impulse leg. This explicitly traps the liquidity nodes associated only with the trend currently being analyzed, rather than mixing it with unrelated historical chop.
How This Works
The Core Buffer: The indicator continuously records high, low, close, and volume data into a 5,000-bar rolling array. This isolates the calculations from TradingView's visual history and prevents data from dropping out when zooming or scrolling.
Dynamic Geometry: In Auto mode, PTTL perpetually hunts for the most significant A and B pivots. Because this window is dynamic, historical structure migrates as stronger dominant highs/lows appear.
Harmonic Divisions: By treating the maximum price deviation from the true A-B line as a 100% boundary, the tool mathematically slices the resulting channel into exact geometric fractions (1/8, 1/3, 1/2, etc.) to highlight internal support/resistance nodes.
Time & Price Squaring (AB=CD): PTTL measures the span of the A-B impulse and demands that the Point C retracement validates within a strict time window. Once validated, it targets an identical price/time expansion (Target D), actively grading the setup as Pending, Success, or Failed based on real-time price intersection.
Settings Guide
Mode Selection: Choose between Auto (dynamically scanning) and Manual (locking Point A to a user-defined timestamp).
Manual — One-Click Anchor: Anchor Point A to a specific timestamp and price. Pivot B Search Window dictates how many bars forward the tool should scan before permanently locking Point B into place.
Auto Mode Settings: Adjust the Scan Window to define how many bars back the tool searches for major swings, and set a Minimum AB Span to ensure it doesn't anchor to microscopic, noisy swings.
Features & Visibility: Toggle overlays like the True Trend Line, Vector POC, Parallel Channel, and Reflection angle.
AB=CD Settings: Configure the time allowance for Point C to form. If Hide Failed Patterns is on, invalidated geometries clear immediately to keep the chart clean.
Projection Settings: Decide whether Time Cycles scale against the duration of the A-B leg (× AB duration) or project forward uniformly (Fixed bars).
Alert Triggers: Fire native TradingView alerts the moment price crosses the True Trend Line, the maximum-deviation Channel rail, or the isolated Vector POC. Indicator

Premium + Discount Ranges (M1D)Premium + Discount Ranges
Measures the range you are trading inside, the way it is read by eye from the newest swing point on a chosen timeframe across to the swing of the opposite kind, split into premium and discount either side of an equilibrium. Three ranges can run at once, each on its own timeframe, so an execution range can be read inside the higher one that frames it.
Two ways to bound a range
Period takes the timeframe's own high and low so far: one month is one range, it starts empty at the open and is gone at the rollover. It answers where price sits in the month.
Swing takes the newest confirmed swing high across to the newest swing low on that same timeframe, which owes nothing to the calendar and can run across many periods. It answers which structural range price is inside right now.
Each range picks its own mode, and the chart says which: "1M High" is this month's high, "1M Swing High" is the monthly swing high.
What counts as a swing
A swing is a level price actually turned at, not merely a high that sits above its neighbours while price kept running the same way. The candle has to hold the extreme against a chosen number of candles either side of it, and by default it also has to mark the change of direction — a swing high on the turn from an up candle to a down one, a swing low on the turn from down to up. That second condition can be switched off to accept any candle holding the extreme, regardless of what it turned into.
Every swing is read from candles already closed on its own timeframe, one bar clear of the newest bar, so nothing on a forming higher-timeframe candle can confirm or unconfirm it.
The raided edge
A confirmed swing is the last level price turned at, which is not always the edge of the range being traded right now — the moment a boundary is taken, the real range is already wider than the swings describe. Each boundary is carried out to the extreme price has actually reached since its swing confirmed, and draws dotted while it is out there: a level price has not yet turned at is a raid in progress, not structure. It settles back to solid the moment a new swing confirms behind it. This can be switched off to pin both boundaries to confirmed swings only, with price free to trade outside the range.
Direction and shading
The range is read from whichever swing formed most recently. A new swing low means price has already turned up away from it, so the leg is bullish and discount is the side being worked from; a new swing high reads the other way. The first range is shaded premium and discount by default; the shading can optionally lean toward the side being worked from, fading the other side back. Ranges two and three draw as bare levels by default so a bias range never muddies the range being traded.
Anchoring and labels
Every boundary starts at the candle that set it, never drawn back across bars that closed before that price existed. The equilibrium and the shading begin at the later of the two swings, because a range has no midpoint until both ends exist.
Each range's names can follow the global label settings or override them: centred over the range's own span, to the left, to the right, at the swing that set the level, or off. Two names landing on the same price are merged into one label rather than left stacked; two that land close together without being the same level are separated by a blank line rather than overlapping.
The readout
One panel, two blocks. The first names each active range's timeframe, whether it fits under the chart's own timeframe, which way it is working, which half of it price is trading in, and how far through it price has travelled. The second is a calendar statistic rather than a swing one: the average daily, weekly and monthly range over a chosen number of completed periods, how much of that average the current period has already used, and a countdown to the period's close.
Alerts
Six. Price crossing into premium, price crossing into discount, price trading the equilibrium, the range high taken, the range low taken, and a new swing redrawing the range. All six read the range being traded — range one.
Method and repainting
Swings on ranges two and three are read on their own timeframe via a higher-timeframe request; range one's swing test is likewise timeframe-bound to whichever timeframe is chosen for it. Every swing reads only candles already closed, one bar back, so nothing about it depends on lookahead revealing an unclosed bar.
A confirmed boundary moves only when a genuinely new swing prints. The one part of the drawing that is live by design is a boundary carried out to a raid in progress, and it draws dotted so that is visible rather than implied.
What it will not do
It places no entries, exits, stops or targets, and it does not size a position. It draws no trend line, no bias score and no target projection beyond the range itself. It does not identify order blocks, fair value gaps or liquidity pools — only the swing highs and lows that bound the range and the equilibrium between them.
Settings
Per range: on/off, timeframe, Period or Swing, label placement override, swing strength, premium/discount shading, boundary width. Swing definition: whether a direction turn is required, whether a raided boundary is carried out to price. Shading: premium and discount colours, transparency, whether the shading leans with direction and by how much. Lines: boundary and equilibrium colour and width, how far boundaries extend past the last bar. Labels: side and nudge for the high, low and equilibrium of each range, whether premium/discount get their own names, the collision distance that separates two close labels, whether price is shown in the label, label size and colour. Readout: show/hide, position, size. Average ranges: show/hide, lookback length for each of daily, weekly and monthly, and whether the close countdown is shown.
Disclaimer
This is a decision-support tool for discretionary ICT trading. It is not financial advice, and no market's past behaviour is indicative of future results. Indicator

cephxs / CISD [base]What this solves
A CISD (Change In State of Delivery) marks the moment one side loses
control: price closes back through the run of candles that made the last
push. This script finds those moments, draws the level , and removes the
level when it fails.
What makes it different
Most CISD tools mark the open of the last opposing candle and stop there.
This one tracks the whole opposing run, not just its last candle. It
records the true extreme of the move and extends the level while the run
continues. It commits only when a candle closes through the level. It also
classifies a special case — the propulsion block — where a new CISD forms
after price holds inside the zone of an earlier CISD. Propulsion blocks get
a thinner line, so you can see the difference between continuation and a
fresh reversal. The trade-off is patience: the script draws nothing as
confirmed until a close of the breaking candle... You will never get the level at the exact turn.
How it works
A swing point forms. The script walks back through the run of
same-direction candle bodies that came before it. The open of the first
candle in that run is the CISD level.
The script draws the level as a dotted line — a pending CISD. If the
opposing move continues, the script moves the pending level with it and
updates the true extreme of the run.
When a candle closes through the level, the script confirms the CISD.
The line becomes solid, and the script places a marker on that bar.
If a pending CISD gets no confirmation close within its timeout, the
script removes it. If price later crosses the swing point that created a
confirmed CISD, the script removes that CISD. A broken level does not stay
on your chart.
A propulsion block is a confirmed CISD whose reversal extreme moved into
the zone of an earlier, still-valid CISD in the same direction and held.
The script draws it with a 1px line and gives it no Fibonacci projections.
Fibonacci projections
Each confirmed CISD can project extension levels from its stretch, in the
direction of the new delivery. Two anchor modes:
Body — projects from the candle bodies of the stretch.
Wick — projects from the true peak or trough of the whole
opposing move, wicks included.
Levels -0.5 through -4.5 have individual toggles and colors. The script
always draws levels 0 and 1 as faint reference lines. The script caps
projections per direction. On charts of less than 1 hour, new projections
in one direction must form at least 2 chart-hours apart. This gap protects
a well-placed recent projection from clustered CISDs.
How to use it
Load the script on your execution timeframe with the default settings.
It works on all symbols and timeframes.
A dotted line is a pending CISD. Do not act on it. A solid line is a
confirmed change in delivery. The level often acts as support or
resistance on a retest.
A thin solid line is a propulsion block. Read it as continuation from
an earlier level, not as a fresh reversal.
If a confirmed level disappears, price broke the swing point that
created it. Treat this removal as the invalidation.
Use the Fibonacci extensions as draw-on-liquidity targets for the move
that follows confirmation.
Settings that matter
CISD Directional Bias — default Auto. When you trade one side
of a higher-timeframe bias, set it to Bullish or Bearish.
CISD Size Filter — default on, Regular. This setting removes
stretches that are small in relation to current volatility. The smallest
preset (Really small) keeps more CISDs. The largest preset (Juicy) keeps
only significant moves.
CISD Sensitivity — default Standard. This setting controls how
many bars a pending CISD waits for its confirmation close (Standard 10,
Max 20).
Show only Macro CISD? — default off. When this setting is on,
confirmation must occur in the macro windows (minutes 00-10, 24-36, 50-59
of each hour).
Filter by Purge — default off. When this setting is on, a CISD
forms only after a sweep of a nearby swing, within your bar tolerance.
Show All Historical CISD? — default off. When this setting is
on, invalidated CISDs stay on the chart as dashed lines. The maximum-count
limit no longer applies.
Calculate From — default Body. Set it to Wick to anchor
Fibonacci projections at the true extreme of the opposing move.
Limitations
Confirmation is close-based. A confirmed CISD does not repaint. But
you get it one closed candle after the turn, never at the turn.
Pending (dotted) levels are provisional by design. They move while the
opposing run extends, and they disappear on timeout. Do not trade a dotted
line as a confirmed level.
The macro time filter uses fixed New York-aligned windows. On
timeframes of more than 1 hour, the filter has little meaning.
The script has no alerts. It is a charting tool.
The script computes levels only over the most recent bars of chart
history, not the full loaded history.
Credits
CISD is a concept from the ICT (Inner Circle Trader) body of work. The
detection engine, filters, propulsion-block classification, and projection
logic are original code. I extracted them from my own larger toolkit and
published them standalone, so traders can read, audit, and reuse the code.
FAQ
Does it repaint?
Confirmed lines and markers do not repaint. Pending dotted lines update
live, and the script can remove them. This behavior is their job, not a
defect.
Why did a confirmed line disappear?
Price traded back through the swing point that created it. The level
failed, so the script removed it. If you want to keep failed levels on the
chart, enable Show All Historical CISD.
Why do some CISDs have no Fibonacci levels?
Propulsion blocks get no projections. Projections have a cap per
direction. On charts of less than 1 hour, a minimum spacing gap applies.
This is a tool for your own analysis, not trading advice. Test it
on your own instruments and timeframes before you even think about risking money on it.
Indicator

VWAP DeltaVWAP Delta is an oscillator that plots each bar's open, high, low and close as their distance from the volume-weighted average price, instead of showing price and VWAP side by side. It's built for anyone who wants to see how far, and how consistently, price is trading away from its volume-weighted average — for example to judge how stretched an intraday move already is, or how a recent push compares to the pace of previous ones — rather than only whether price sits above or below VWAP.
The delta of each bar is measured against an EMA baseline built from the delta close, and both can optionally be smoothed with a Hull moving average before that comparison. Because VWAP accumulates from the start of each session and depends on volume, it is an intraday tool and returns na on symbols or timeframes where volume data isn't available. The indicator can display this relationship as a filled area or as its own set of candles, with colors that adapt automatically to the current bias and, in candle style, to whether momentum is currently building or fading.
Calculation
VWAP Smoothing: applies a Hull moving average to the delta series before plotting, with an adjustable length.
Baseline Length: EMA length of the baseline that the delta is compared against.
Appearance
Graphic Style: visual style for the delta series: Area or Candle.
Bull / Bear Area Color: (Area style) fill color for when the delta line is above its baseline, and for when it's below.
Bull Candle Color: (Candle style) two colors for a bullish candle body — the left one while the body is expanding versus the previous bar, the right one while it's contracting.
Bear Candle Color: (Candle style) the same pair of colors for a bearish candle body.
In Area style, the delta close is plotted as a single line against its EMA baseline, and the space between them is filled — in Bull Area Color while the delta line is above the baseline, in Bear Area Color while it's below. Only the fill is visible; the delta and baseline lines themselves stay hidden. In Candle style, the fill disappears and the delta is drawn instead as its own set of candles, built from the delta's open, high, low and close relative to VWAP; when smoothing is enabled, the high and low are clamped to the smoothed open and close, so the smoothing itself can never invert a candle's body. Each candle is colored by comparing its own delta open and close: a candle whose delta close sits above its delta open takes a bull color, any other candle — including one where open and close are exactly equal — takes a bear color; within each of those two colors, the shade further distinguishes whether the current body is larger than the previous one (expanding) or smaller (contracting). A zero line marks where price and VWAP coincide.
This indicator is intended solely for market analysis and does not constitute investment advice or a guarantee of success. Use it at your own discretion and risk; past results are not indicative of future performance. Indicator

VWAP AI - Statistical Bands & Touch Stats [Dots3Red]⚓ VWAP AI - STATISTICAL BANDS & TOUCH STATS
VWAP's standard deviation bands are treated more or less as reliable support and resistance — on faith. This script checks that faith against the actual chart in front of you: every band touch is graded, every break beyond a band is graded, and the results accumulate into a running, honest record.
✨ WHY THIS MATTERS
VWAP tells you the volume-weighted average price — where the "center of gravity" of trading has actually been. The bands around it are meant to show how far price typically wanders from that center before snapping back. But "typically" varies enormously by instrument, session, and market condition, and no plain VWAP tool tells you what's actually been happening on your chart.
This script tracks it directly:
📊 +1σ | 62% rejected (n=41)
That means 41 touches of the +1σ band have been recorded on this chart, and 62% of them resulted in price genuinely rejecting back toward VWAP. Measured history, not an assumption baked into the tool.
⚙️ HOW IT WORKS
⚓ Anchoring — VWAP resets at the start of each new period. Session is the classic intraday default; Week and Month extend the same logic to longer views. Custom Bar anchors once, permanently, to a specific historical point you choose — useful for anchoring to an earnings date, a gap, or any event you want to measure from, rather than the calendar.
📏 Two-tier statistical bands — Band 1 and Band 2 are both standard-deviation multiples of VWAP, computed from a proper running variance (not an ATR approximation). Defaults are ±1σ and ±2σ, both fully adjustable.
🎯 Touch grading — when price wicks into a band without closing beyond it, that's logged as a touch. Within a configurable window, it resolves as:
• Rejection — price moved back toward VWAP by a meaningful distance
• Break — price closed convincingly through the band
• Timeout — neither happened clearly enough to call
🔄 Break-to-reversion tracking — separately, when price actually closes beyond Band 1, the script watches whether that move reverts back toward VWAP or continues away from it. This answers a different question than touch grading: not "did the band hold," but "once it didn't, did price come back anyway?"
🔒 Non-repainting — all grading happens strictly on confirmed bars.
🧭 HOW TO USE
1️⃣ Check the band stats before treating a level as reliable. "+1σ: 71% rejected (n=38)" and "+1σ: 44% rejected (n=12)" look like the same line on the chart but mean very different things about how much to lean on it.
2️⃣ Use break-reversion stats to judge a breakout beyond VWAP's range. If breaks above Band 1 have reverted back 65% of the time on this chart, that's useful context before assuming a fresh breakout will keep running.
3️⃣ Read Price vs VWAP as the simplest possible bias check. Above VWAP means the average buyer today is in profit; below means the average buyer is underwater. It's a blunt but genuinely useful read on crowd positioning.
4️⃣ Let sample sizes build before trusting the percentages. Every stat shows its N= specifically so you can judge reliability yourself — a handful of touches is not yet a pattern.
5️⃣ Match the anchor mode to what you're actually measuring. Session for pure intraday structure, Week or Month for a longer view, Custom Bar when you want to measure from one specific moment forward.
⏱️ WHICH TIMEFRAMES WORK BEST
Session-anchored VWAP is fundamentally an intraday tool — it was built for, and is most meaningful on, timeframes where a full session contains enough bars to form a real distribution: 1-minute through 1-hour is the classic and most effective range, which is exactly where VWAP sees the heaviest institutional and day-trading use.
On daily or weekly charts, a Session anchor resets so frequently relative to the bar size that it stops being meaningful — you'd see very few bars per session. For higher-timeframe or swing-style use, switch the anchor to Week, Month, or Custom Bar instead, so the accumulation window actually spans enough bars to produce a meaningful VWAP and band structure.
The touch and break statistics also need enough occurrences to mean anything — a fast-moving intraday chart will accumulate a useful sample size in days; a slow higher-timeframe anchor will take considerably longer.
🛠️ SETTINGS
⚓ Anchoring — Session / Week / Month / Custom Bar, source price
📏 Bands — Band 1 and Band 2 standard-deviation multipliers, Band 2 visibility toggle
🎯 Touch Statistics — Touch Tolerance, Rejection Distance, Reversion Distance, Outcome Window
🎨 Visualization — independent Band 1 / Band 2 touch marker toggles, Dot or Triangle marker style, marker size, VWAP and band line widths, independent fill transparency per band tier
🎨 Colors — VWAP line, Band 1 lines, Band 2 lines, upper/lower touch markers, Price Above/Below VWAP indicator, and full dashboard color control (background, border, header, row styling)
🖥️ Dashboard — show/hide, position — current VWAP value, price position, all four band stats, and both break-reversion stats in one place
📝 NOTES
Statistics accumulate from when the indicator is added to the chart and reset only when explicitly cleared by reloading. A Custom Bar anchor never resets on its own, it measures continuously from the point you chose. Band 2 statistics take meaningfully longer to build a useful sample than Band 1, simply because price reaches ±2σ far less often than ±1σ.
⚠️ DISCLAIMER
This is an analytical and visualization tool. It does not generate trade signals and does not constitute financial advice. Historical rejection and reversion rates do not guarantee future performance. Indicator

The Magnet ModelThe Magnet Model — Opening Range Volume Profile
The Magnet Model ORVP is designed to turn the opening auction into a simple, repeatable map of where volume established value and where those levels may continue to matter throughout the trading session. It will automatically map the key volume-based levels established during New York opening range.
Instead of manually drawing a Fixed Range Volume Profile each morning, the indicator automatically builds the opening profile and identifies the Point of Control (POC), Value Area High (VAH), and Value Area Low (VAL). Once the opening range is complete, these levels extend to the right, allowing traders to monitor how price interacts with them throughout the session.
Key Features
Automatic 9:30–9:46 AM New York Opening Range Volume Profile
Automatically calculates VAH, POC, and VAL
70% Value Area by default
VAH, POC, and VAL automatically extend to the right
Shaded Value Area between VAH and VAL for quick visual reference
Current ORVP is highlighted pink
Previous ORVP zones can use different colors to distinguish sessions
Adjustable number of historical ORVPs displayed
Clean date labels such as 8/31 ORVP
Adjustable profile rows and profile width
Customizable colors, line widths, and line styles
Optional Overlap Detection Deletion to automatically remove older ORVP zones that overlap the newest value area
Designed to maintain a clean chart while preserving important historical opening-range levels
How It Can Be Used
The ORVP provides a structured framework for evaluating the market after the opening range has formed.
VAH, VAL, and POC can serve as important areas to monitor for:
Acceptance and rejection
Support and resistance
Breakouts and failed breakouts
Retests
Potential price magnets
Continuation or reversal opportunities
Historical ORVP levels can also remain on the chart, allowing traders to identify when price returns to areas of value established during previous sessions.
Best Used With Confluence
While The Magnet Model ORVP is powerful on its own, it can become even more effective when combined with other high-quality market references and confirmation tools.
Consider looking for confluence with VWAP, Simple Moving Averages (SMAs), Initial Balance (IB), key session levels, and order flow.
Some of the strongest areas of interest can develop when multiple independent levels or signals align with an ORVP VAH, VAL, or POC, providing additional context for potential support, resistance, acceptance, rejection, and directional movement.
The goal is not to trade an ORVP level blindly, but to use it as part of a broader framework of confluence.
Overlap Detection
When Overlap Detection Deletion is enabled, the indicator compares each newly completed value area with older ORVP zones.
If an older VAH-to-VAL value area overlaps the newest value area, the older profile is automatically removed.
This optional feature helps reduce chart clutter and keeps the focus on distinct opening-range value areas.
Default Configuration
Opening Range: 9:30–9:46 AM New York
Value Area: 70%
Profile Rows: 100
VAH / VAL / POC: Black, 2-width lines
Current Value Area: Pink, 20% opacity
Historical Value Areas: Differentiated by color
Send me a message with any questions or requests.
For educational and informational purposes only. This indicator does not provide financial advice or guarantee future market behavior. Indicator

Unicode Heatmap CandlesUnicode Heatmap Candles
■Overview: Analytical Paradigm & Value Proposition
This indicator introduces a fundamentally new approach to micro-structural market analysis within TradingView. Transcending the visual limitations of standard OHLC (Open, High, Low, Close) candles, it leverages Pine Script v6's dynamic array processing to completely reconstruct price bars into high-resolution liquidity heatmaps. Engineered specifically for active traders and quantitative analysts, it visualizes the true order flow and volume concentrations (Point of Control) hidden beneath superficial price action in real-time.
1. Concept & Analytical Edge
Standard candlestick charts display static geometrical shapes, which inherit a critical flaw: they completely obscure internal transaction dynamics. A long wick or a large body tells you where the price moved, but not where the actual capital was deployed. In institutional quantitative analysis, a candlestick is not a solid bar, but a vertical aggregation of micro-transactions.
By utilizing Unicode block characters with sub-tick precision, this indicator maps the exact distribution of executed lower-timeframe (LTF) volume across price tiers within each individual candle—without relying on external footprint tables. It separates "empty price movements" from "solid liquidity zones.
2. Core Mechanics & Mathematical Logic
A. Dynamic Volatility Slicing (ATR Adaptive)
To maintain consistent visual resolution across varying market conditions (from low-volatility Asian sessions to high-impact news events), the price tier step is dynamically derived from the Average True Range (ATR).
Calculate dynamic price step based on 14-period ATR
float current_atr = global_atr
if na(current_atr) or current_atr == 0
current_atr := close * 0.005
int active_ticks = math.max(1, math.round((current_atr / 30) / syminfo.mintick))
float step = syminfo.mintick * active_ticks
int total_r = math.ceil((bar_h - bar_l) / step) + 1
Why this calculation? Fixing the tier size by a static tick value causes resolution breakdown during volatility spikes. By dividing the 14-period ATR by 30 and rounding to the nearest minimum tick, this mathematical normalization guarantees that each candle is systematically divided into approximately 20 to 30 micro-tiers, outputting a consistent heatmap resolution regardless of the timeframe or asset class.
B. Geometry Detection: Real Body vs. Wick
The script evaluates the exact numerical center of each vertical price tier to identify whether it structurally belongs to the candle body or the wick, rendering distinct Unicode glyphs to preserve the traditional candlestick silhouette.
Determine Body vs Wick geometry
float top_p = price_p + (step / 2)
float bot_p = price_p - (step / 2)
bool is_body = (top_p > body_bot) and (bot_p < body_top)
string current_char = is_body ? body_char : wick_char
Candle Body: Stacks wide block glyphs (███) to represent the high-density range between Open and Close.
Candle Wick: Stacks slender vertical glyphs (┃) to trace extreme price rejections up to the High/Low limits.
3. Scope of Capability & Technical Boundaries
To maintain institutional-grade transparency, the operational boundaries and strict design choices of this tool are detailed below. This is a specialized hyper-local lens, not a historical charting tool.
Intra-Candle Heatmap : Maps LTF volume directly inside the candle shape.
Real-Time POC Tracking : Visualizes highest volume nodes via color saturation.
Multi-Asset Support : Works flawlessly across Equities, Crypto, Forex, and Futures.
Full Historical Backtesting : Restricted by the Pine Script 500-label buffer limit.
High-ATR Max Display : Optimized strictly for real-time, active execution setups.
System Constraint & Design Architecture: Pine Script v6 enforces a hard maximum of 500 label objects (max_labels_count=500). Because each high-resolution candle consumes 20 to 40 individual labels to render the micro-tiers, the simultaneous display limit is mathematically capped around the most recent 5 to 8 bars in high-ATR environments. Older bars are systematically garbage-collected. This is an intentional architectural choice: 100% of the maximum allowed computing and drawing resources are allocated to maximizing the resolution of the current market structure.
Important Note on Higher Timeframes (Daily/Weekly/Monthly): TradingView Data Limits
You may notice that when applied to high timeframes like the Monthly chart, older candles render as gray (Zero Volume). This is not a bug. TradingView imposes a strict limit of 100,000 historical bars for lower-timeframe (request.security_lower_tf) data requests. If your LTF is set to 1-minute, 100,000 bars cover only about 70 days. Therefore, older macro candles cannot retrieve micro-volume data.
Remember: This indicator is a "Microscope" built for active intraday/swing execution. It is fundamentally designed for micro-structure analysis, not macro-historical profiling.
Anti-Crash Fail-Safe (For Non-Premium Users)
TradingView strictly limits access to seconds-based timeframes (e.g., 1S, 15S) to Premium plan subscribers. To prevent runtime crashes for Essential/Plus users, this script features a built-in safety toggle: "Premium Plan (Allow Seconds TF)".
If this box is unchecked (default), any attempt to input a seconds-based LTF will be automatically intercepted and safely downgraded to a 1-minute (1m) resolution, ensuring uninterrupted operation for all user tiers.
4. How to Use
Add the indicator to your chart.
Open Chart Settings (Gear Icon) -> Symbol -> Uncheck Body, Wick, and Borders (hide standard candles).
Observe the internal liquidity distribution:
Red / Orange Nodes: Point of Control (POC) and high-liquidity concentration zones.
Blue / Muted Nodes: Low volume nodes (slippage zones, price vacuums, or liquidity voids).
Disclaimer
This script and its description are published solely for the purpose of learning, researching, and providing technical analysis methodologies. The developer assumes no responsibility for any direct, indirect, incidental, or consequential losses or damages (including trading losses or loss of profits) arising from the use of this tool. Trading in financial markets involves substantial risk. Please conduct thorough verification and implement appropriate risk management at your own risk before using this in a live trading environment. Indicator

Split VWAPWhat it does
Split VWAP cuts every bar horizontally at the session VWAP and draws it as two candles at the same position: one spanning the low up to VWAP, one spanning VWAP up to the high. Each partial takes the bar's open and close clamped into its own range, and a share of the bar's volume proportional to its height. Where VWAP sits at or beyond a bar's extreme, one partial collapses to zero height and the other takes the whole bar and all of its volume; the collapsed one is hidden by default.
A single candle gives you four prices and one volume total, but says nothing about how that activity was distributed relative to the session's average price. Splitting the bar at VWAP and attributing volume to each side makes that distribution visible.
How the colouring works
Each partial is coloured from two changes, both measured against the previous bar's partial on the same side of VWAP: the change in attributed volume, and the change in clamped close.
In the default mode, "Volume hue OKLCh", each change gets a channel of its own. The volume change moves the hue along a continuum — red (
#ea6c5c, hue 29) when it fell, green (
#05b28d, hue 171) when it held, blue (
#7b8efa, hue 274) when it rose. The price change moves the lightness: lighter when the close rose, darker when it fell.
All three anchors sit at an OKLCh lightness of 0.680 and hold as much chroma as their hue can carry at that lightness, capped at 0.16 so the ends do not shout over the middle. Green is the quiet one because green simply cannot hold as much. OKLCh is used rather than HSL because HSL treats lightness as a function of the hue you happen to be on, so a fixed magnitude renders brighter on some hues than others; in OKLCh, lightness, chroma and hue move independently.
Bodies are hollow when the partial's clamped close is above its clamped open, and solid otherwise. A dot marks the VWAP level itself, coloured by the same scheme applied to the whole bar.
Three further modes are included — Quadrant intensity, Bilinear blend and Polar OKLCh. These read the two changes as four corner colours instead of two channels, one per sign combination, and use magnitude to drive chroma and opacity. Every corner and anchor colour is an input.
Scaling
Every series is normalised against the dispersion of its own bar-to-bar changes: 2.5x the mean absolute change over a lookback, which is roughly two standard deviations for a well-behaved distribution but far less sensitive to the occasional volume spike.
Measuring each series against itself matters more than it sounds. A partial carries only a fraction of the bar's volume, so normalising its volume change against the whole bar's average volume compresses that axis and leaves the colour field stuck near the middle. In the other direction, half the ATR is smaller than a typical close-to-close move, so the price axis clips on a large share of bars. It also gives the VWAP-pinned partial a usable scale: when a bar closes above VWAP the lower partial's close is pinned to the cut, so its only movement is VWAP drift — small in absolute terms, but perfectly legible against its own dispersion.
The consequence worth holding on to while reading the chart: the colour says how unusual a change is for that partial, not how large it is in absolute terms.
Setup
The script paints over the chart's native candles, but Pine cannot hide the chart symbol itself. For the cleanest result, right-click the chart, open Settings -> Symbol, and uncheck Body, Borders and Wick.
Settings worth knowing
Gradient mode — the four schemes described above.
Price lightness span — how far a full-strength price change moves the lightness off the anchor, in OKLCh lightness. Default 0.16. A wider span reads more decisively but costs colour at both ends, because sRGB is widest in the middle and narrows toward black and toward white. Rather than let the channels clip, the requested chroma is fitted to whatever the lightness and hue can actually carry, so bright bars are pastel and dark bars are saturated.
Response ramp — how quickly the colour responds as a change grows. 1.0 is proportional; the default 0.6 reaches most of the response earlier, so only genuinely quiet bars stay washed out.
Price change scale / Volume change scale — the lookbacks for the two normalisers.
Transparency at no change — how far quiet bars recede. Lower it if the quiet end reads too faint.
Limitations
Volume attribution is proportional to segment height, not measured from intrabar data. It is a shape-preserving approximation, not a true intrabar volume profile.
The VWAP is session-anchored, so the split level resets at each session boundary and the first bars of a session sit close to it.
On a strongly trending session, price can run far enough from the session VWAP that one partial collapses on most bars and the display degrades toward ordinary candles. That is expected behaviour rather than a fault.
The script requires a symbol that reports volume, and raises a runtime error on symbols that report none.
Originality
This is original work. The bar splitting, the volume attribution, the per-partial normalisation, and the OKLCh colour handling — including the OKLab conversions and the chroma fitting, neither of which Pine provides — are implemented from scratch. No third-party code is reused. Indicator

Pattern Atlas : Geometric Indicator [AxeAlgo]Pattern Atlas : Geometric Indicator
A chart-native scanner for 16 classical price-structure ("geometric") chart
patterns. It tracks confirmed swing pivots as they form and, when a run of
pivots satisfies the geometry of a known pattern and its breakout condition, it
marks the pattern on the chart with an outline box, an optional construction
skeleton, a measured-move target, and a labelled pin signal. It also keeps a
live status table of every pattern it knows.
All pattern-recognition logic lives in the companion Pine library
"Pattern Atlas : Geometric ". This script is the visualization and
alerting layer on top of it, so the detection rules stay in one place that can
be maintained and audited on their own.
Patterns detected
Reversal patterns: Head & Shoulders and its Inverse; Double Top and Double
Bottom; Triple Top and Triple Bottom; Rounding Top and Rounding Bottom; Diamond
Top and Diamond Bottom; Broadening Formation; and the V-Top / V-Bottom spike.
Continuation patterns: Ascending Triangle; Descending Triangle; Symmetrical
Triangle; Rising and Falling Wedge; Bull and Bear Flag; Bull and Bear Pennant;
Rectangle; and Cup & Handle with its Inverted form.
Structural patterns: Island Reversal and Bump-and-Run Reversal.
How it works
First, a rolling list of confirmed swing highs and lows is maintained. The
"Pivot left bars" and "Pivot right bars" inputs set how many bars on each side
of a candidate must be less extreme for it to count as a pivot. Higher values
give fewer, more significant pivots and a longer confirmation lag.
Next, each pattern function inspects the recent pivot sequence for its defining
shape together with the price move that confirms it. For example, Head &
Shoulders looks for three peaks with a lower-shoulder relationship and a close
back through the neckline; an Ascending Triangle looks for a flat resistance
base with a rising support line and a close through the base.
Each match reports its direction (bullish or bearish), the exact pivots it was
built from, a text description, a strength score, and a measured-move price
target.
Strength score
The strength score runs from 0 to 100 percent and measures how decisively price
broke through the pattern's confirmation level, relative to the pattern's own
price range. A higher score means a cleaner, more committed break.
Patterns defined by a single point, such as the Spike and the Island Reversal,
have no internal range to measure against and always score a neutral 50 percent.
The "Minimum pattern strength to show" input filters marginal matches off the
chart and out of the alerts.
Measured-move targets
The target is a classical projection: the pattern's own height added to or
subtracted from the breakout point, shown as a small price label. No ray is
drawn out to it.
Targets are not shown for the Spike, the Island Reversal, or the Bump-and-Run
Reversal, because those patterns have no reliable height to project from.
Repainting
Every box, line, target, and pin is drawn only on a closed bar. Each match is
gated so it appears, and alerts, only once, on the bar it is first confirmed.
Swing pivots are only known a number of bars after they occur, equal to
"Pivot right bars". That confirmation lag is structural to pivot-based analysis,
not repainting. Nothing already drawn is moved or removed on later bars.
What you see on the chart
A box outlines the full pivot span of each match, coloured by direction.
Construction lines draw a zig-zag through the exact pivots that built the
pattern. This is off by default.
Construction points place a small circle on each of those pivots. This is also
off by default.
A target label shows the measured-move price.
A pin signal is a thin stem with a glowing gem at its tip, placed below the bar
for a bullish match and above it for a bearish one. Hovering the gem shows the
full list of matches on that bar with their strength and targets.
The scanner table lists every pattern with a live status column. When a pattern
matches on the current bar the row shows its name and strength percent; when it
does not, the row shows a dash. Hovering any row shows that pattern's
description.
Inputs
Pivot Detection controls the left bars, right bars, and the maximum number of
pivots tracked.
The Reversal, Continuation, and Structural groups each have a master enable
switch plus one checkbox per pattern, so a whole category can be turned off in
one click.
Display controls the boxes, construction lines, construction points, targets,
and pin signals; the minimum strength filter; the table on/off, position, and
text size; and the bullish and bearish colours.
Watermark switches between a Dark and a Light theme.
Alerts
There is one alert condition per pattern, plus an "Any Bullish Chart Pattern"
and an "Any Bearish Chart Pattern" condition.
There is also a single dynamic alert() call that fires once per closed bar with
the full list of patterns found on that bar, along with their strength and
targets. Add it using the "Any alert() function call" option when creating the
alert.
Every alert condition is gated to confirmed bars in the code itself, so none of
them can fire from a still-forming bar regardless of the alert frequency chosen.
Notes
Chart-pattern recognition is inherently approximate. Treat matches as structured
context rather than mechanical trade signals, and confirm them with your own
analysis.
The indicator works best on liquid instruments and on timeframes where swings
are well defined. Very low timeframes produce noisy pivots.
This is not financial advice.
Dependency: Pattern Atlas : Geometric , a Pine library.
Indicator

Indicator

Volatility Regime Tracker | NickJoanVolatility Regime Tracker | NickJoan
Core Idea
Volatility Regime Tracker measures the dispersion of price relative to its recent average and classifies the current market environment into distinct volatility states. Instead of just showing raw volatility values, the indicator uses percentile-based thresholds combined with moving average direction to identify three persistent regimes: LOW, NEUTRAL, and HIGH.
The script goes beyond simple volatility measurement by tracking how long each regime has lasted and comparing it to historical averages, giving you a statistical expectation for when the current regime might end.
The indicator can be used in two ways:
• As a volatility gauge, where you monitor the current volatility percentage and its trend.
• As a regime detection tool, where the background colors and duration table help you anticipate volatility state changes.
Calculation Logic
The indicator works through three main stages:
1. Volatility calculation
For the selected price source, the script first calculates the standard deviation over a user-defined lookback window. This absolute volatility is then normalized by the average price to produce a percentage-based measure.
• The script calculates the standard deviation of the source over the lookback period.
• It calculates the simple moving average of the source over the same period.
• It divides standard deviation by average price and multiplies by 100.
• It optionally annualizes the result using √365 for crypto daily charts.
This creates a coefficient of variation measure that shows how much price typically deviates from its recent average as a percentage.
2. Regime classification
The script then determines whether current volatility is high, low, or neutral relative to recent history.
• It calculates the percentile rank of current volatility over a regime lookback window.
• It compares this percentile to user-defined thresholds (default: 30th and 70th percentiles).
• It classifies volatility as HIGH (above upper threshold), LOW (below lower threshold), or NEUTRAL (between thresholds).
3. Dual confirmation
To reduce false signals, the script combines percentile ranking with moving average direction.
• It calculates a moving average of the volatility series.
• It checks whether current volatility is above or below this MA.
• It assigns regime states based on both percentile and MA direction.
This dual-confirmation approach produces five distinct visual states that map to three underlying regimes.
Background Color Logic
The script uses a two-layer color system to show both regime state and confidence level.
Strong signals (darker colors)
• Dark red: High percentile AND above MA (strong high volatility)
• Dark green: Low percentile AND below MA (strong low volatility)
Moderate signals (lighter colors)
• Light red: Neutral percentile but above MA (rising volatility)
• Light green: Neutral percentile but below MA (falling volatility)
Uncertain signals
• Gray: Percentile and MA direction disagree (conflicting signals)
This color structure allows you to distinguish between high-confidence regime readings and transitional or uncertain states.
Regime State Mapping
The indicator consolidates the five color states into three regime categories for duration tracking:
• LOW (0): Any green shade (dark or light) - volatility is low or falling
• NEUTRAL (1): Gray - volatility is in transition or conflicting
• HIGH (2): Any red shade (dark or light) - volatility is high or rising
This mapping ensures the duration statistics reflect the broader regime environment rather than short-term color fluctuations.
Duration Tracking Logic
The script continuously monitors regime changes and builds a historical record of how long each regime typically lasts.
Duration measurement
• When a regime change is detected, the script calculates how many bars the previous regime lasted.
• This duration is stored in an array specific to that regime type (LOW, NEUTRAL, or HIGH).
• The process repeats for each regime change, building a distribution of historical durations.
Statistical analysis
• The script calculates the average duration for each regime type from the stored history.
• It calculates the standard deviation of those durations.
• It computes confidence intervals at ±1 standard deviation (~68% confidence).
Real-time tracking
• The script counts how many bars the current regime has lasted.
• It displays this count alongside the historical average and confidence bounds.
• This allows you to see whether the current regime is typical, unusually short, or unusually long.
Duration Table Output
The table displays four rows of information for each regime type:
• Current bars in regime (if active) or "—" (if inactive)
• Historical average duration for LOW regimes
• Lower bound (average − 1 SD)
• Upper bound (average + 1 SD)
Interpretation
• If current bars < lower bound: regime is unusually short (may extend further)
• If current bars ≈ average: regime is typical (no strong expectation either way)
• If current bars > upper bound: regime is unusually long (may be nearing end)
Chart Output
The indicator displays three visual elements in a separate pane below the price chart:
Volatility line
• Shows the current annualized volatility percentage
• Plotted in blue for clear visibility
Moving average line
• Shows the smoothed volatility trend
• Plotted in gray with thicker linewidth
• Can be toggled off via input
Background color
• Shows the current volatility regime state
• Uses five color states mapped to three regimes
• Can be toggled off via input
Duration table
• Positioned at middle-right of the chart
• Shows current bars, average, and confidence intervals
• Can be toggled off via input
Inputs
The indicator has four main input groups.
CALCULATION
• Volatility Lookback (bars): defines the window used to calculate standard deviation. Default: 50.
• Annualize (√365): toggles annualization of volatility. Recommended for crypto daily charts.
• Source: selects the price series used in the calculation (default: close).
MOVING AVERAGE
• Type: chooses the MA type (SMA, EMA, WMA, RMA). Default: EMA.
• Length: sets the MA lookback period. Default: 30.
• Show Moving Average: toggles MA visibility on the chart.
VOLATILITY REGIME
• Regime Lookback (bars): defines the window used for percentile rank calculation. Default: 100.
• Low Threshold (percentile): sets the lower percentile boundary. Default: 30.
• High Threshold (percentile): sets the upper percentile boundary. Default: 70.
• Show Background Color: toggles regime coloring.
DURATION TABLE
• Show Duration Table: toggles the statistics table visibility.
• History Lookback (days): controls how many bars of history to use for average calculations. Default: 365.
Alerts
The script includes four alert conditions:
Volatility Regime Change
• Triggers on any regime transition (LOW → NEUTRAL, NEUTRAL → HIGH, etc.)
• Useful for monitoring all state changes
Low Volatility Regime
• Triggers when entering LOW regime (green background)
• Useful for breakout preparation or position size increase
Neutral Volatility Regime
• Triggers when entering NEUTRAL regime (gray background)
• Useful for identifying transition periods
High Volatility Regime
• Triggers when entering HIGH regime (red background)
• Useful for risk reduction or heightened awareness
How to Use It
This indicator is best used as a volatility filter and regime-aware positioning tool, not as a standalone entry signal.
Volatility regime filter
Use the regime colors to filter your trading approach:
• LOW regimes (green): Favor breakout strategies, increase position size
• HIGH regimes (red): Reduce position size, exercise caution (volatility can persist or reverse depending on market context)
• NEUTRAL regimes (gray): Wait for clearer signals or reduce exposure
Duration-based anticipation
Use the duration table to anticipate regime changes:
• If current bars approach upper bound: expect potential regime change soon
• If current bars are well below average: expect regime to continue
• If current bars exceed upper bound: regime is extended, watch for reversal
Trend confirmation
Use the volatility trend to confirm price action:
• Rising volatility (light red → dark red): confirms trend expansion or increased uncertainty
• Falling volatility (light green → dark green): confirms consolidation or stabilization
• Conflicting signals (gray): suggests uncertainty or transition
Practical Interpretation
Here is a simple way to read the results:
LOW regime (green)
• Price is tightly clustered around its average
• Volatility is below historical norms
• Often precedes breakout moves
• Good for trend-following entries
HIGH regime (red)
• Price is widely dispersed from its average
• Volatility is above historical norms
• Can indicate trending expansion, shock events, or panic conditions
• Reduce position size; assess whether context suggests continuation or reversion
NEUTRAL regime (gray)
• Volatility is transitioning or conflicting
• No clear regime signal
• Wait for clearer confirmation
Duration statistics
• Average: typical length of this regime type
• Lower/Upper bounds: normal range (~68% of cases)
• Current bars: where you are in the distribution
Best Use Cases
Typical uses include:
• Crypto volatility regime detection
• Position sizing based on volatility state
• Breakout vs. consolidation strategy filter
• Risk management and exposure control
• Multi-asset volatility comparison
• Regime-aware trade timing
It is especially useful when you want to objectively measure whether volatility is high or low relative to recent history, and whether the current regime is typical or extended.
Notes
The indicator is designed for daily crypto charts but works on any timeframe.
• Daily timeframe: "History Lookback (days)" represents calendar days
• Other timeframes: "History Lookback (days)" represents bars, not calendar days
The metric table is only as good as the selected lookback periods and thresholds.
• Shorter volatility lookback: more reactive but noisier
• Longer volatility lookback: smoother but may lag sudden changes
• Shorter regime lookback: faster regime detection but more whipsaws
• Longer regime lookback: more stable but slower to detect changes
• Tighter thresholds (e.g., 25/75): fewer regime changes, higher confidence
• Wider thresholds (e.g., 35/65): more regime changes, earlier detection
The Z-Score-style duration statistics are relative to the selected history window, so their meaning depends on how much data you include. Indicator

Pattern Atlas : Geometric [AxeAlgo]Pattern Atlas : Geometric Patterns
WHAT THIS LIBRARY IS
This is a Pine Script v6 library of 17 classical chart pattern detectors — Head and Shoulders, Double/Triple Tops and Bottoms, triangles, wedges, flags, and the rest of the standard technical-analysis catalog built from swing highs and lows rather than single-candle shape. Unlike candlestick patterns, which read one to a handful of fixed bars, chart patterns span a variable, often large number of bars, so this library carries one small piece of state — a rolling history of confirmed swing pivots — that every pattern function reads from. Beyond that, the same philosophy as Library #1 applies: no plotting, no alerts, and no inputs in this script by design, since a library's job is to hand other scripts a clean, reusable, well-documented API, not to draw on a chart itself (Pine doesn't allow a library to plot anything anyway). If you're looking for a ready-to-use indicator built on top of this library, see the companion "Pattern Atlas : Geometric Indicator " script, which imports every function here and turns it into on-chart signals, measured-move price targets, a live scanner table, and alerts.
Chart pattern analysis is one of the foundational tools of classical technical analysis, going back to Edwards and Magee's original work and refined since by researchers like Thomas Bulkowski, whose statistical studies of pattern behavior are the closest thing this field has to an industry-standard reference. The patterns in this library follow that standard catalog, so anyone who already knows what a Head and Shoulders top or an Ascending Triangle looks like will recognize exactly what each function is checking for.
WHY A LIBRARY INSTEAD OF ONE MONOLITHIC INDICATOR
Splitting detection logic out as an importable library means:
- Any Pine coder building their own strategy, indicator, or screener can pull in exactly the pattern checks they need without copy-pasting swing-pivot and trendline math into every new script.
- The detection logic is tested and maintained in one place. When a threshold gets refined, everything importing this library benefits from the update by bumping one version number.
- It keeps the math separate from presentation — how a pattern gets drawn, colored, or alerted on is a completely separate decision from whether the pattern is actually present, and different users want different presentations.
HOW TO IMPORT AND USE IT
Add this line near the top of your script (adjust the version number to whatever the current published version is):
import AxeAlgo/Pattern_Atlas_Geometric/1 as geo
Unlike Library #1, most of the functions here need a shared pivot history to work from. Call trackPivots() exactly once per bar, then pass its result into every detect*() function that needs it:
pivots = geo.trackPivots()
match = geo.detectDoubleTopBottom(pivots)
if match.found
label.new(bar_index, high, match.patternName)
Four functions — detectSpike(), detectFlag(), detectPennant(), and detectIslandReversal() — read directly off recent price action instead of the shared pivot history, so they're called without a pivots argument: geo.detectSpike().
trackPivots() takes three optional parameters: leftBars and rightBars (how many less-extreme bars must surround a candidate swing point before it confirms as a pivot — higher values mean fewer, more significant pivots, at the cost of a longer confirmation lag), and maxPivots (how much pivot history to retain). All three have sensible defaults.
Every detect*() function returns the same structure, called ChartPatternMatch, so the calling pattern is identical no matter which of the 17 you use. It has nine fields:
- found — true if the pattern matched at the evaluated bar, false otherwise.
- patternName — the specific name of what matched (e.g. "Ascending Triangle"), na when not found.
- direction — "bullish" or "bearish".
- pivotBars — bar_index of each pivot the match was built from, in chronological order.
- pivotPrices — price of each pivot, in the same order as pivotBars.
- breakoutLevel — the support, resistance, or neckline level price broke through to confirm the pattern.
- necklineSlope — slope (price per bar) of the breakout line, na when the pattern's breakout level isn't a sloped line.
- barIndex — the bar_index the pattern completes (breaks out) on.
- description — a full sentence naming the pattern and the actual measured price levels that triggered it — genuinely useful for a tooltip or an alert message, not just a repeat of the pattern name.
Two additional exported functions turn that raw match into something more actionable, and both work on any ChartPatternMatch regardless of which detect*() function produced it:
- patternStrength(match) — a 0-100 score for how decisively the confirmation close broke through breakoutLevel, relative to the pattern's own price range. A breakout that clears the level by a meaningful fraction of the pattern's own size scores higher than a one-tick poke through it.
- patternTarget(match) — a classical measured-move price target, projecting the pattern's own height from the breakout point. Returns na for patterns without a reliable height to project from (V-Top/V-Bottom Spike, Island Reversal, Bump-and-Run Reversal).
Every detect*() function also exposes its own set of tunable threshold parameters — how flat a "flat top" has to be, how much two shoulders can differ and still count as equal, and so on — all with sensible defaults so you don't have to touch them unless you want to tighten or loosen a specific pattern's sensitivity for a particular instrument or timeframe.
THE 17 PATTERNS
Reversal patterns (7) — signal a potential change in the prevailing trend:
- Head and Shoulders / Inverse Head and Shoulders — detectHeadAndShoulders(). Three swing extremes with the middle one more extreme than the two roughly-equal outer ones, confirmed when price breaks the neckline connecting the two points between them.
- Double Top / Double Bottom — detectDoubleTopBottom(). Two roughly equal peaks (or troughs) with a retracement between them, confirmed when price breaks back through that retracement level.
- Triple Top / Triple Bottom — detectTripleTopBottom(). The same idea as a Double Top/Bottom with a third roughly-equal touch, confirmed on the break of the support or resistance formed between the touches.
- Rounding Top / Rounding Bottom — detectRoundingTopBottom(). A gradual, curved advance-and-rollover (or decline-and-recovery) between two similar edge levels. Approximate: read from three swing pivots rather than fitting a true curve.
- Diamond Top / Diamond Bottom — detectDiamondTopBottom(). Swing range that widens and then narrows again, confirmed on a break of the resulting support or resistance. Rare and approximate: read from three pivot pairs rather than a clean diamond outline.
- Broadening Formation — detectBroadeningTopBottom(). Diverging highs and lows forming an increasingly volatile range, confirmed on a break of either edge. Approximate: read from two pivot pairs rather than a hand-fitted diverging channel.
- V-Top / V-Bottom (Spike) — detectSpike(). A single sharp extreme with no rounding — a large move into the pivot and an equally large move away from it, both measured against the recent average bar range, within a handful of bars. Self-contained, no pivots argument needed.
Continuation patterns (8) — typically resolve in the direction of the move that preceded them:
- Ascending Triangle — detectTriangleAscending(). Flat resistance with rising support, confirmed on a break above resistance.
- Descending Triangle — detectTriangleDescending(). Flat support with falling resistance, confirmed on a break below support.
- Symmetrical Triangle — detectTriangleSymmetrical(). Converging highs and rising lows, confirmed (bullish or bearish) whichever side the price actually breaks.
- Rising Wedge / Falling Wedge — detectWedge(). Both trendlines slope the same direction and converge; breaks the opposite way from the slope, since the shared-direction move was already losing momentum.
- Bull Flag / Bear Flag — detectFlag(). A strong directional move (the pole), followed by a tight, roughly parallel pullback, confirmed on a break back out in the pole's direction. Self-contained, no pivots argument needed.
- Bull Pennant / Bear Pennant — detectPennant(). The same pole-and-consolidation structure as a Flag, but the consolidation narrows and converges rather than staying parallel. Self-contained, no pivots argument needed.
- Rectangle — detectRectangle(). Price boxed between flat support and flat resistance, confirmed on a break of either edge.
- Cup and Handle / Inverted Cup and Handle — detectCupAndHandle(). A rounded recovery (or decline) back to its starting rim, then a shallow pullback (the handle), confirmed on a break through the rim.
Structural / gap-based patterns (2):
- Bullish / Bearish Island Reversal — detectIslandReversal(). A bar (or small cluster) isolated by a gap on both sides, then abandoned by a gap the other way — an abrupt reversal. Self-contained, pure gap logic, no pivots argument needed.
- Bump-and-Run Reversal — detectBumpAndRun(). A lead-in trendline, then a "bump" phase accelerating well beyond it, then a "run" breaking back through the lead-in line. Approximate: the lead-in line is read from just two pivots rather than a hand-drawn trendline.
WHAT THIS LIBRARY DELIBERATELY DOES NOT DO
No plotting, no drawing, no alertcondition() calls, and no inputs — Pine doesn't allow any of those inside a library in the first place, since a library can never be added to a chart on its own. If you want signals, price targets, a scanner table, or alerts, import this library into your own script (or use the companion "Pattern Atlas : Chart Pattern Scanner " indicator, which does exactly that) rather than expecting this script to render anything by itself.
This library also does not evaluate multi-timeframe data, volume, or broader market structure — it's swing-pivot and trendline geometry only, on purpose, so its behavior is easy to reason about and easy to reuse as one building block among several.
Four of the seventeen patterns are explicitly noted above as approximate: Rounding Top/Bottom, Diamond Top/Bottom, Broadening Formation, and Bump-and-Run Reversal are read from a small, fixed number of swing pivots rather than fitting a true curve or hand-drawn trendline to the data. They will not catch every textbook-perfect example of these shapes, and they may occasionally flag a looser approximation of one. Treat them as a starting point for further chart review, not a final word.
PART OF A LARGER SERIES
This is Library #2 in the AxeAlgo Pattern Atlas — a planned set of Pine libraries splitting pattern detection by the method actually used to find each kind of pattern: candlestick shape (Library #1, already published), classical chart/geometric patterns (this library), harmonic patterns (Fibonacci-ratio XABCD structures), and market-structure concepts (order blocks, liquidity, Wyckoff-style events). Each library is independent and useful on its own; together they're meant to cover technical pattern analysis without forcing unrelated detection methods into the same function.
A NOTE ON REPAINTING
trackPivots() only confirms a swing pivot once rightBars bars have passed since it happened — the same confirmation lag ta.pivothigh()/ta.pivotlow() use, just written out as plain comparisons so it works safely inside a library's exported functions. That means a pivot never moves or disappears once confirmed; it just takes rightBars bars to become known, which is a normal and unavoidable part of swing-pivot detection, not a defect in this library. On the currently-forming bar, a pattern's found status can still change tick to tick as that bar's own high, low, and close move — that's inherent to reading live price action. If you're building persisted signals, drawings, alerts, or price targets on top of these functions (rather than a live "what's happening right now" readout), gate your usage on barstate.isconfirmed so a signal only fires once the bar it describes has actually closed, exactly like the companion scanner indicator does.
DISCLAIMER
This library is a technical analysis tool for identifying classical chart pattern shapes in historical and live price data. It does not predict future price movement, and a detected pattern — including any projected price target — is a description of past price action, not a signal guaranteed to repeat. Nothing in this script constitutes financial advice. Always combine pattern recognition with your own risk management and broader analysis before making any trading decision.
Library

Macro Regime Dashboard█ OVERVIEW
Macro Regime Dashboard is a market-timing checklist for US equities. It evaluates five regime conditions on every daily bar: elevated volatility, a non-rising Fed policy rate, contracting margin debt, the presence of a leading sector, and earnings confirmation from bellwether stocks. It plots the count of conditions met as a stepline in a separate pane, renders a live checklist table, and marks the bars where all conditions and the enabled fail-safes align. The thesis: durable market bottoms tend to form when fear is high, the Fed is not tightening, leverage has been flushed, and a leading theme keeps delivering earnings through the panic.
█ HISTORY / BACKGROUND
The five-condition checklist and its fail-safes are the market-timing framework described by the YouTuber, Defiant Gatekeeper, who distilled it from his buy decisions around volatility spikes. The framework itself synthesizes established concepts: the VIX as a fear gauge, Federal Reserve policy as the dominant liquidity driver, margin debt as a measure of speculative leverage, sector leadership as the engine that attracts institutional capital, and earnings surprises as confirmation that the leading theme is insulated from the broader panic.
The fail-safes address the framework's known failure modes, which the author identifies from historical episodes: leading-sector fundamentals breaking down, systemic accounting fraud destroying trust in reported earnings, a credit freeze that policy easing cannot offset, and inflation high enough to remove the Fed's ability to support asset prices. Two of these are quantifiable and are implemented here as the high-yield credit spread and CPI fail-safes. The concept is his; this Pine implementation, the data-series selections, and the proxy choices are original to this script.
█ HOW IT WORKS
On each daily bar the script requests six external series and evaluates five boolean conditions plus two fail-safes.
Condition 1: Fear. The CBOE Volatility Index (CBOE:VIX) must exceed the threshold input (default 30).
Condition 2: Fed not on an upward trajectory. The effective federal funds rate (FRED:DFF) today must be at or below its value from the lookback number of trading days earlier, with a 0.01 tolerance. The table also flags when the 2-year Treasury yield (TVC:US02Y) sits below the funds rate, indicating that the bond market is pricing cuts; this flag is informational and does not gate the condition. Because the policy trajectory is partly qualitative (guidance, projections), an override input can force this condition to pass or fail.
Condition 3: Margin debt declining. The reference framework uses the monthly FINRA margin debt statistic, which TradingView does not carry. The script substitutes the Federal Reserve Z.1 series for margin accounts at brokers and dealers (FRED:BOGZ1FL663067003Q), requested at 3-month resolution. The condition passes when the latest quarterly value is below the prior quarterly value.
Condition 4: Leading sector. The script loops over eleven S&P sector ETFs plus a semiconductor ETF, computes each one's return over the lookback window, and subtracts the SPY return over the same window. The strongest relative-strength value must exceed the threshold input (default 3 percentage points over 63 days). The table names the current leader.
Condition 5: Bellwether earnings beats. For up to three user-selected bellwether symbols representing the leading theme, the script pulls reported and estimated earnings per share through the earnings request feed and marks a beat when actual is at or above estimate for the most recent report. The condition passes when a majority of the symbols with available data beat. When no earnings data exists for any bellwether, the condition passes neutrally rather than failing, so that missing history does not veto the count. An override input can force this condition either way.
Fail-safes. The ICE BofA US High Yield Option-Adjusted Spread (FRED:BAMLH0A0HYM2) must sit below its threshold (default 10 percent), and CPI year-over-year, computed from FRED:CPIAUCSL as the ratio of the monthly index to its value twelve months earlier, must sit below its threshold (default 2.5 percent). Each fail-safe passes when its data is unavailable. Two toggle inputs decide whether each fail-safe vetoes the composite signal or only displays as a warning. By default the credit fail-safe gates and the CPI fail-safe warns.
Composite. The buy state is true when all five conditions hold and every enabled gate is clear. The script plots the raw condition count (0 to 5) as a stepline, draws a dotted horizontal reference at 5, shades the pane background green while the buy state is active, and prints a green triangle on the first bar of each signal window. A table in the top right shows each condition's current value and pass state, both fail-safe readings, and a composite verdict row. Two alerts are provided: one on the first bar of a new buy signal, and one when the credit spread crosses above its threshold.
█ HOW TO USE
Apply the indicator to a broad US index such as SPX or SPY on the daily timeframe . All inputs and thresholds are calibrated to daily bars; the conditions describe the whole market, so the chart symbol only supplies the bar grid.
Read the stepline as regime pressure. A count of 3 or 4 during a selloff means the setup is forming; a touch of 5 with the background shading and a triangle means every condition and enabled gate aligned on that bar. A count of 5 without shading means a fail-safe is blocking, which is exactly the bull-trap situation the fail-safes exist to flag. The table gives the per-condition diagnosis at a glance.
Using the dashboard in tandem with the Stock Screener
The dashboard times entry and sizing. It does not select stocks. The reference framework pairs it with a fundamental selection layer keyed to the liquidity regime, and most of that layer maps directly onto TradingView's Stock Screener fields: revenue growth, EPS growth, forward price-to-earnings, and debt to EBITDA. The workflow:
Determine the liquidity quadrant. The dashboard's Fed condition covers the rate trajectory. Check the Fed balance sheet direction separately by charting FRED:WALCL: rising means expansion, falling means contraction.
Rate falling and balance sheet rising (maximum liquidity): screen for revenue growth above 50 percent and ignore valuation and leverage fields. Unprofitable hypergrowth is the target profile in this quadrant.
Mixed quadrants (one lever easing, one tightening): screen for revenue growth in the 10 to 20 percent range, a moderate forward price-to-earnings, and debt to EBITDA below roughly 3 to 5 depending on which lever is easing.
Rate rising and balance sheet falling (minimum liquidity): screen for forward price-to-earnings below 15, debt to EBITDA below 1.5, and positive earnings. Stability over growth.
When the dashboard signals, run the screener preset for the current quadrant, restricted to the leading sector the table names, to surface candidates.
The final validation step in the reference framework, a regression of price-to-earnings against expected EPS growth across roughly ten same-industry peers with an R-squared above 0.8, is not screenable and is performed outside TradingView in a spreadsheet.
█ SETTINGS
VIX threshold (default 30): level the volatility index must exceed for condition 1.
Fed rate lookback (default 63 trading days): comparison window for the funds-rate trajectory in condition 2.
Fed trajectory override (default Auto): forces condition 2 to pass or fail when guidance contradicts the rate proxy.
Sector RS lookback (default 63 days): return window for the relative-strength computation in condition 4.
RS outperformance vs SPY (default 3 percent): margin by which the leading sector must beat SPY.
Bellwether 1, 2, 3 (defaults are three large semiconductor names): symbols whose earnings reports confirm the leading theme. Change these whenever the leading theme rotates.
Earnings override (default Auto): forces condition 5 to pass or fail.
HY OAS max (default 10 percent): credit-spread ceiling for the credit fail-safe.
CPI YoY max (default 2.5 percent): inflation ceiling for the CPI fail-safe.
Credit fail-safe gates signal (default on): when on, an elevated credit spread vetoes the composite signal.
CPI fail-safe gates signal (default off): when on, elevated inflation vetoes the composite signal; when off it displays as a warning only.
█ WHAT MAKES IT ORIGINAL
The script consolidates a cross-asset macro checklist into a single gated, auditable pane: an equity volatility index, the policy rate, the Treasury 2-year, a quarterly flow-of-funds leverage series, sector ETF relative strength, per-symbol earnings surprise data, a credit spread, and a computed inflation rate. Each series exists elsewhere in isolation; the contribution here is the joint evaluation with explicit pass/fail logic, the separation of hard vetoes from soft warnings through the gate toggles, and two implementation choices that make the framework computable on TradingView at all: the Z.1 quarterly margin-account series as a proxy for the unavailable monthly FINRA margin debt statistic, and the earnings-beat condition built from the earnings request feed on user-configurable bellwethers, with missing data treated as neutral rather than as a veto.
█ NOTES / LIMITATIONS
Designed for the daily timeframe on a broad US index. Other resolutions misalign the lookbacks and the higher-timeframe requests; other symbol classes add no information because every condition is market-wide.
The margin-debt proxy is quarterly. Monthly FINRA data can show a deleveraging turn up to one quarter before the Z.1 series reflects it, so condition 3 is the slowest leg and produces a step-shaped response.
Monthly and quarterly requests update when those periods complete. Within a forming month or quarter the CPI and margin readings can change until the period closes.
Earnings history depth varies by symbol and generally thins in earlier years. On older bars condition 5 frequently passes neutrally for lack of data, and the override and bellwether inputs are static across the whole chart, so the plotted historical count is indicative rather than point-in-time. Treat the history as illustration, not as a backtest.
Economic series have distinct start dates, and all external requests ignore invalid symbols. Missing data renders as n/a in the table, fail-safes pass when their series is absent, and a sector whose ticker fails to resolve is silently skipped in the relative-strength scan.
The checklist table reflects the last bar only.
The Fed condition is a proxy for a qualitative judgment. During fast easing cycles the fixed lookback can briefly misread the trajectory, which is what the override input is for.
Indicator

Indicator

Aurora_Channel_V1█ Overview
The Aurora Channel is an adaptive multi-layer volatility and expansion framework that fuses Bollinger Bands, Keltner Channels, volume-sensitive dynamics, and intelligent moving-average selection into a single coherent system.
Instead of treating channels as static statistical boundaries, Aurora continuously evaluates market behavior, selects the most suitable moving-average engine in real time, expands or contracts outer envelopes according to volume and width regimes, and projects dynamic trigger and crossover levels that respond to actual price action.
The result is a hybrid channel system that blends:
• Adaptive MA selection (Auto / Adaptive Scoring)
• Volume-modulated Keltner expansion
• Hybrid Bollinger–Keltner “Aurora” bands
• Multi-layer expansion envelopes
• Peak-aware or dynamically tracking Trigger Channel
• Crossover Multiplier Engine with adaptive overlays
• Regime-aware visuals and a live Dashboard HUD
█ Why is this one unique
Most channel indicators are fixed formulas. Aurora is a full adaptive channel engine built in Pine Script v6.
It does not simply plot Bollinger or Keltner bands. It constructs a hybrid core, surrounds it with volume-aware expansion logic, maintains intelligent outer triggers, and generates dynamic crossover projection lines whose multiplier is itself adaptive.
⚪ What it does
At a high level:
Auto MA Selection Engine
Continuously scores SMA, EMA, RMA (SMMA), WMA, and VWMA candidates using a combined lag-error + jitter penalty. The engine automatically selects the MA with the lowest overall score (or lets the user force a manual choice). This becomes the center line for every subsequent calculation.
Hybrid Aurora Core
Builds classic Bollinger Bands and a volume-sensitive Keltner Channel around the selected midline. The Keltner multiplier dynamically expands between 3.0–4.0 during volume spikes. The difference between the two outer bands is then smoothed and re-applied, creating the final Aurora Upper / Lower bands.
Expansion Envelope
Measures the current Aurora width, smooths it, and projects outer envelope levels that react to both width expansion and tick-volume intensity. Optional “Breakouts Only” mode shows the envelope solely when price is already expanding beyond the Aurora bands.
Trigger Channel
Two memory modes:
• Dynamic Tracking – continuously follows expansion and decays when price returns inside.
• Hold Peak Level – latches the highest/lowest expansion extremes.
A proportional buffer is then added, creating clean outer trigger lines.
Crossover Multiplier Engine
Monitors crosses of a user-selected target (Midline, Aurora Bands, Envelope, or Trigger). On every cross it captures the current Keltner multiplier × volume ratio, latches that value, smooths it with the same adaptive MA engine, and projects symmetric overlay lines around the midline. These act as adaptive reaction / target levels.
Multi-Layer Clouds + Regime Visuals
Soft gradient fills between midline → Aurora and Aurora → Envelope, plus a softer fill toward the Trigger. Candles are colored by regime (above/below midline). A compact Dashboard HUD displays the active MA, cross target, current multiplier, expansion state, and regime.
⚪ Why it is good
The strongest aspect is the combination of adaptive center selection, volume-aware expansion, and quality-aware outer structures in one coherent framework.
Most channel tools are either pure statistical (Bollinger) or pure volatility (Keltner/ATR). Aurora merges both, then adds intelligent memory (Trigger modes) and a live crossover-driven multiplier engine. The visual hierarchy (multi-layer clouds) makes regime and expansion instantly readable, while the Dashboard keeps the key adaptive values visible without cluttering the chart.
⚪ What makes it sophisticated
• Real-time adaptive MA scoring with lag + jitter penalty
• Dynamic Keltner multiplier driven by volume ratio
• Hybrid band construction that re-injects smoothed BB–KC difference
• Dual-mode Trigger memory (peak hold vs continuous tracking + decay)
• Crossover-triggered multiplier latching and adaptive projection
• Multi-layer gradient fills that scale with the actual channel hierarchy
• Non-repainting alerts on confirmed crosses
⚪ Why It’s Marketable
Traders looking for more than a simple Bollinger or Keltner band receive a complete adaptive channel ecosystem. The Auto MA engine removes the endless debate of “which MA is best,” the Expansion Envelope and Trigger Channel give clear breakout and reaction zones, and the Crossover Multiplier Engine turns every significant cross into dynamic, volume-aware target lines. The result is a selective, visually rich, and highly configurable system that adapts to the instrument and timeframe instead of forcing a fixed formula onto every market.
⚪ Main weakness
The system is still rule-based adaptive logic, not deep learning. Performance depends on the chosen lengths, the quality of volume data (especially on tick-volume charts), and the current market regime. Over-optimization of the many parameters can reduce robustness.
█ How It Works
⚪ Auto MA Selection Engine
Scores five classic moving averages on tracking error (squared lag) plus a jitter penalty. The lowest combined score becomes the active center line used by every channel component.
⚪ Aurora Core Construction
• Midline = selected MA
• Bollinger = midline ± StdDev × multiplier
• Keltner = midline ± ATR × volume-modulated multiplier (3.0–4.0)
• Aurora bands = Keltner ± smoothed (BB – KC) difference
⚪ Expansion Envelope
Average Aurora width is multiplied by a base factor and further expanded by excess volume. The resulting offset is added outside the Aurora bands. Optional breakout-only plotting keeps the chart clean until genuine expansion occurs.
⚪ Trigger Channel
On expansion the system either latches the extreme (Hold Peak) or follows and slowly decays the level (Dynamic Tracking). A proportional buffer creates the final trigger lines.
⚪ Crossover Multiplier Engine
Detects crosses of the chosen target, captures kcMult × volRatio, latches the value, smooths it with the adaptive MA engine, and projects midline ± ATR × smoothed multiplier as dotted overlay lines.
█ How To Use
• Use the Aurora bands as the primary dynamic support/resistance zone.
• Watch the Expansion Envelope for genuine volatility breakouts.
• Treat the Trigger Channel as outer reaction / invalidation levels.
• The Crossover Multiplier lines act as adaptive targets or reaction zones after significant crosses.
• Candle color and the Dashboard HUD give instant regime and state information.
• Enable alerts on the crossover condition for automated notifications.
█ Settings
Auto MA Selection Engine
• MA Selection Engine (Auto Adaptive / Manual)
• Manual MA type
• Jitter Penalty strength
Core Channel Engine
• Base Center Length
• Bollinger StdDev multiplier
• Keltner ATR Length
• Tick Volume MA Length & Expansion Factor
• Band Difference MA Length
Expansion Envelope
• Show / Breakouts Only
• Expansion MA Length
• Envelope Base Multiplier & Volume Boost
Trigger Channel
• Show Trigger
• Buffer Multiplier
• Memory Mode (Dynamic Tracking / Hold Peak Level)
Crossover Multiplier Engine
• Show Dynamic Lines
• Cross Monitoring Target
• Multiplier MA Smoothing Length
Visual Settings
• Candle Coloring
• Multi-Layer Cloud
• Dashboard HUD
• Full color customization for every layer
█ Disclaimer
The content provided in this script is for educational and informational purposes only. It does not constitute financial advice, investment recommendations, or a solicitation to buy or sell any financial instruments. Past performance is not indicative of future results. All trading involves risk, and you are solely responsible for your own trading decisions. Indicator

ICT Combined Venom Silver Bullet Displacement LiquidityThirteen switchable ICT modules in one overlay, built to replace several separate scripts on one chart. Nothing here predicts price — every module is a mechanical description of something that already happened.
MODULES
1-3 SESSION MODEL. Three independent instances of one CISD engine: Venom NY plus two Silver Bullet windows (10:00-11:00 and 14:00-15:00 NY, London preset included). Each builds an opening range, waits for a directional raid, locates the change-in-state-of-delivery level at the last opposing candle's open, and confirms when a candle CLOSES back through it — body close, not wick. On confirmation the order block and most recent unmitigated FVG are drawn.
4 DISPLACEMENT. Candles whose range is a standard-deviation outlier and that leave a gap behind. Confirmed bars only.
5 LIQUIDITY. Prior day/week/month, Asia and London highs and lows. A sweep requires raid AND rejection — through the level and closing back within the same candle. A close beyond is acceptance, not a sweep.
6 FIRST PRESENTED FVG. The first gap of the AM and PM sessions with its 50% (consequent encroachment). Always sourced from 1-minute data whatever the chart timeframe, and tested against the middle candle so the opening candle cannot form it. Retained across days.
7 OPENING RANGE GAP. Prior regular-session close to today's open, with 50% and quadrants.
8 PREMARKET DEALING RANGE. The 07:00-09:00 NY range graded into quadrants and octants, locked at 09:00 and carried forward. Premium and discount are measured against THIS range, not the session or daily range.
9 BODY / WICK LAW. A demand zone holds while bodies stay in its upper half, supply while they stay in the lower half. Wicks may cross the 50% freely; only a closed body is a violation. Runs against modules 6, 7 and 8. A filter, not a signal.
10 AM REGIME CLASSIFIER. Scores how likely the morning is to consolidate. READ THIS BEFORE ENABLING: it encodes a claim that is not established fact, ships with untested default thresholds as a measurement instrument, and its gate over other modules' alerts is off by default and should stay off until the calibration record earns it.
12 SUSPENSION BLOCKS. An FVG carrying a volume imbalance at BOTH ends — three stacked spans with no body trade across any of them. Read from the chart timeframe.
13 NDOG / NWOG. Settlement print to the next session's open, drawn as solid blocks and deliberately not retired when filled, because price returns to them for weeks. A settlement window that never prints yields no gap rather than one measured against a stale close.
DASHBOARD. The premarket range and which side of equilibrium price sits on, plus a calibration summary: logged sessions split by premarket classification, reporting median realised morning efficiency per group with sample sizes, flagged when thin.
FVG GEOMETRY. An FVG edge is a wick; where the neighbouring candle's body does not reach it, that space is a volume imbalance belonging to the same inefficiency. Edges widen to include it, never narrow. Extending this to the library-drawn zones in modules 1-3 is a separate switch, off by default, with a diagnostic counter so it can be verified rather than assumed.
USING IT
Switch modules off and add them back one at a time. Modules 5, 8 and 6 together are a complete framework and a reasonable place to stop. Zones mark where a reaction is plausible — they are not entries, and nothing here manages risk or sizes a position.
CREDITS
Reuses open-source work under the Mozilla Public License 2.0.
TFlab, from "ICT Venom Trading Model" and "Silver Bullet ICT Strategy": the CISD detection routine, the opening-range state machine, and the order block and FVG handling. This script also calls TFlab's libraries OrderBlockRefiner_TradingFinder, OrderBlockDrawing_TradingFinder and FVGDetectorLibrary. The engine behind modules 1-3 is substantially TFlab's work.
tradeforopp (TFO): the displacement measure in module 4.
fadizeidan, from "ICT Open Range Gap & 1st FVG": the volume-imbalance FVG geometry, sourcing the first presented gap from one minute, the middle-candle session test, and the opening range gap definition.
Original here: parameterising TFlab's engine so three overlapping windows run independently; the whole liquidity module; multi-day retention and carry rules for the first presented gap; the premarket dealing range and grid; the body/wick test; suspension blocks; NDOG/NWOG; the verified-coordinate approach to unifying FVG geometry; and the regime classifier shipped with the means of checking it. Several source defects are also fixed — the opening range absorbed the first bar of the trading window, a Bar Back Check input was overridden by a hardcoded value, four colour inputs were never referenced, box count was left at the library default, and the displacement module repainted intrabar.
The concepts themselves — fair value gaps, consequent encroachment, displacement, liquidity raids, premium and discount, the first presented gap — are ICT's (Michael J. Huddleston) and are not claimed as original.
LIMITATIONS
Intraday only; session windows cannot resolve on daily and above. Module 6 needs a minute chart and stops populating silently beyond the available one-minute history, so an empty older day may mean missing data rather than no setup. NDOG/NWOG approximate the settlement print on daily and above. Drawings are subject to TradingView's 500-object limits. Signals confirm on bar close, one bar after the move that caused them. Module 10's thresholds are untested defaults.
Published under the Mozilla Public License 2.0, consistent with the sources.
Indicator

Moving Average CandleMoving Average Candle turns up to three moving averages into full OHLC candles instead of plain lines, so you can read a moving average's shape and momentum the way you'd read a price candle. It's built for anyone who wants to see a moving average's open, high, low and close at a glance — for example to judge a moving average's momentum and turning points the way you would judge price action, or to compare several of these MA candles against each other and against the underlying price on the same chart.
Each of the up to three MA candles can independently be calculated as SMA, EMA, WMA, VWMA, HMA, or RMA — standard formulas from TradingView's own library, with no custom modification.
MA Candle (present three times, MA Candle 1–3, each instance identically structured)
Length: number of bars the average is calculated over.
MA Type: calculation method: SMA, EMA, WMA, VWMA, HMA, or RMA.
Candle Style: Wick or Fill.
Bull / Bear: two colors: one for when the moving average's close is above its previous value, the other for the opposite case.
Each enabled MA candle is built from the moving averages of the bar's open, high, low and close, then colored by whether the moving average's close is rising or falling. The high and low are clamped so they never sit inside the body, which keeps the candle intact even for moving average types like HMA whose weighting can otherwise push a value outside a normal high/low range.
In Wick style, the high and low are drawn as a candle wick, just like a regular price candle. In Fill style, the wick is hidden and the high/low range is shown instead as a shaded band; the candle body stays visible in both styles.
This indicator is intended solely for market analysis and does not constitute investment advice or a guarantee of success. Use it at your own discretion and risk; past results are not indicative of future performance. Indicator

BBMA Trend & MomentumBBMA Trend & Momentum
The BBMA structure read as one running sequence rather than a handful of separate signals.
Most tools built on Bollinger Bands and moving averages draw the lines and leave the reading to
you. This one keeps a memory. It knows that momentum came first, that a reversal candle followed it, that the pullback target has already been reached, and it will not report the next step until the ones before it have happened. Each label on the chart is a position in that sequence, not an isolated condition that happened to be true.
Two of those steps are level touches rather than candle patterns, and they are treated
differently from the rest. That distinction is explained below and it matters.
THE LINES
Four families are drawn. Seven individual lines carry every rule in the script.
Bollinger Bands SMA 20 with deviation 2, giving Upper, Mid and Lower
LW MA on the HIGH weighted averages of the candle HIGH, drawn in the upper colour
LW MA on the LOW weighted averages of the candle LOW, drawn in the lower colour
EMA 50 on Close, drawn as a slower reference
The High averages sit above price and the Low averages below it, because of what they are
averaging. That is what forms the two bands the price runs between.
The seven lines every rule is written against are the three Bollinger Bands and the 5 and 10
period LW MAs on each side. Those four averages are drawn SOLID. Periods 6 to 9 are drawn DASHED, exist only to show the shape of the band, and sit on their own switch so you can take them off and see for yourself that nothing is calculated from them. Within each band the 5 sits nearer to price and the 10 further out.
The EMA 50 is drawn and nothing is measured from it either. It is there as background context for your own reading, and it can be switched off without changing a single label.
THE SEQUENCE
Upper and Lower name the band an event belongs to. Every rule below has an exact mirror on the other side, so only the Upper form is spelled out.
CSM - Candlestick Momentum
LW MA 5 High is above the Upper BB, and the candle CLOSES above LW MA 5 High.
The close is therefore beyond the outer band as well, without needing to be tested for it.
EX - Extreme
A CSM has already happened and its Extreme has not been taken yet. LW MA 5 High is still
outside the Upper BB, but a candle now CLOSES back below it. That candle must not reach down to LW MA 5 Low, LW MA 10 Low, or the Mid BB. Touching any one of the three disqualifies it. Exactly one Extreme belongs to one CSM. For another Extreme, a new CSM has to come first.
MTP - Mandatory Take Profit
After an Extreme, the first time price reaches LW MA 5 Low or LW MA 10 Low.
If a new CSM or a new MTM arrives before that touch, the MTP is cancelled and a fresh Extreme
has to form before it can be looked for again.
MLV - Market Volume Lost
After the MTP has been reached, a candle rises to the Upper BB but cannot CLOSE beyond it, and closes at or above the Mid BB. The band was tested and refused.
CSD - Candlestick Direction
A candle that opens on one side of the Mid BB and CLOSES through it, and in the same candle
closes beyond BOTH LW MA 5 and LW MA 10 on the side it broke into. An Upper CSD breaks upward through the Mid BB and both High averages; a Lower CSD breaks downward through the Mid BB and both Low averages. CSD is named by the direction it broke, not by which cycle it interrupted.
MTM - Momentum Push
After a CSM, price falls back below the Upper BB without ever CLOSING below the Mid BB, then
closes above the Upper BB again. That renewed push is the MTM candle. It is not itself a CSM,
which is what separates the two - and because it is not a CSM, it does not open the door to a
new Extreme either. It only clears whatever the previous CSM had left waiting.
RE - Re-Entry
The touch that follows CSM, MTM or CSD. An upper-band sequence looks for LW MA 5 Low or LW MA 10 Low; a lower-band sequence looks for LW MA 5 High or LW MA 10 High. Three kinds are marked separately, because they arrive from three different places:
CSM RE a pullback that was followed by a full CSM
MTM RE a pullback that was followed by an MTM push
CSD RE the pullback after a CSD
WHAT IS READ WHEN
This is the part worth being precise about.
CSM, EX, MLV, CSD and MTM are structure. They are decided on the CLOSE of a candle, and once
decided they never change.
MTP and RE are not patterns, they are level touches. A touch happens at the moment price reaches the level, not when the candle finishes, so both are read on the RUNNING candle. Waiting for the close would report the touch after the level had already been passed, which would describe something other than what happened.
When a running-candle label and a closing label land on the same bar, the running one is
removed and its text is folded into the closing label, so the two never sit on top of each other.
WHAT MAKES THIS DIFFERENT
1. It is a sequence, not a checklist.
An Extreme is not reported unless a CSM came first. An MTP is not looked for until an Extreme has been confirmed, and an MLV not until the MTP has been reached. The same candle shape means different things depending on what came before it, and the script keeps track of that.
2. A step can be cancelled, not only completed.
If momentum resumes with a new CSM or an MTM while an MTP is still waiting for its touch, that MTP is dropped. The market changed its mind, so the sequence restarts rather than reporting a target that no longer belongs to anything.
3. One Extreme per CSM.
An Extreme is the answer to a particular CSM, so it is reported once and then that CSM is spent.
Price can keep closing back inside the band for the next ten candles and none of them will be
called an Extreme. A new CSM has to arrive first. An MTM push does not substitute for one.
4. The Extreme test is deliberately narrow.
Closing back inside the band is not enough. The candle also has to stay clear of the opposite LW
MA 5 and 10 and of the Mid BB. A candle that reaches any of them has done more than fail at the edge, and it is not reported as an Extreme.
5. CSD is named by what it did.
A downward break through the Mid BB and both Low averages is a Lower CSD, wherever it happens to appear. Naming it after the cycle it interrupted would put the wrong word on the chart.
6. Touches are read as touches.
The two events that are levels rather than candle patterns are handled as levels, on the running candle, and the script says so plainly rather than pretending everything is close-based.
READING THE CHART
Each event prints a small label at the candle it belongs to. Upper-band events sit above the
candle, lower-band events below it, and where several land on the same candle they are stacked into one label instead of overlapping.
CSM momentum push beyond the outer band
MTM renewed push after a pullback
EX the reversal candle
MTP first touch of the opposite LW MA 5/10 after an Extreme
MLV the outer band tested and refused
CSD Mid BB and both same-side LW MAs broken together
CSM RE / MTM RE / CSD RE the re-entry touch, named after what preceded it
SETTINGS
Lines
- BB Period and BB Deviations for the Bollinger Bands.
- BB Shift: moves the drawn bands only. The values every rule is measured against are not
moved.
- LW MA 5 to 10 Low and LW MA 5 to 10 High: the twelve weighted average periods. Only 5 and 10 are used by any rule.
- EMA Period.
Pattern Types
- A switch for each of the seven: CSM, MTM, EX, MTP, MLV, CSD and RE.
Line Style
- Show LW MAs: the 5 and 10 period averages, the ones every rule is measured against.
- Show LW MA 6-9 Band: the four decorative periods on each side, on their own switch. Turning
them off is the quickest way to check the claim above - the chart gets simpler and not a single
label moves.
- Show or hide the Bollinger Bands and the EMA.
- Colours for the Bollinger Bands, the LW MA High band, the LW MA Low band and the EMA.
Labels
- Label Size.
ALERTS
Fourteen alert conditions, one for each event on each side:
CSM Upper / CSM Lower
MTM Upper / MTM Lower
EX Upper / EX Lower
MTP Upper / MTP Lower
MLV Upper / MLV Lower
CSD Upper / CSD Lower
Re-Entry Upper / Re-Entry Lower
The structural ones fire once per bar close. MTP and Re-Entry fire once per bar, because they are touches and are read on the running candle.
The same events are also sent through the alert function, so the "Any alert() function call"
alert type can deliver all of them through a single alert. Those messages name the exact
Re-Entry kind - CSM, MTM or CSD - which a fixed alert condition cannot.
REPAINTING
This script does not repaint.
CSM, MTM, EX, MLV and CSD are structure. They are evaluated only after a candle has fully closed and the state memory they drive is updated only on closes, so price moving inside an open candle cannot change the sequence.
MTP and Re-Entry are read on the running candle, and that deserves a straight answer rather than a disclaimer, because a label that can appear mid-candle usually can vanish mid-candle too. Here it cannot, and the reason is in the arithmetic of the level being watched.
A weighted average of the LOW gives the candle still forming a weight of one third at length 5,
and about one fifth at length 10. The running low of that candle falls three to five times faster
than the average it is being compared against. So the moment the low reaches the average, the gap between them can only keep closing. It can never reopen inside that candle. The high side is the exact mirror.
Which means:
- Once an MTP or Re-Entry label is drawn, it stays. It cannot un-touch before the candle closes.
- Reloading the chart gives the same result, because a closed candle is evaluated once using its
final low and high, and those are the most extreme values the candle ever had.
- The only thing that changes at the close is presentation: a running-candle label is folded into
the closing label for that bar so the two do not sit on top of each other. The event itself is
not re-decided.
When you create an alert, TradingView may show a caution banner saying the indicator can repaint.
That banner appears automatically for any script that uses the built in bar state variables, no
matter how they are used, because the platform cannot check the intent behind them. For the
structural alerts, choosing "Once Per Bar Close" is still recommended.
NOTES AND LIMITATIONS
- CSD is the strong form only: the Mid BB and BOTH same-side LW MAs have to be broken by the same candle. A Mid BB break on its own is not reported.
- An Extreme always needs a CSM before it. A reversal candle appearing without that history is
not an Extreme here, whatever it looks like.
- The 6, 7, 8 and 9 period LW MAs and the EMA 50 are drawn but never measured. Changing them, or hiding them, changes the picture and nothing else.
- BB Shift is visual only. Shifting the bands does not shift the rules.
- TradingView caps a script at 500 labels and the oldest are dropped once that cap is reached, so on a long history the earliest labels leave the chart.
- Detection is purely structural. It reports where each step of the sequence occurred and nothing more. It does not rank setups by quality, measure what happened next, or produce entries, targets or stops.
HOW TO USE IT
Read the labels in order rather than one at a time. A CSM on its own says momentum arrived. The same CSM followed by an Extreme says the move ran out of room. That Extreme followed by an MTP and then an MLV says the band was tested again and refused. Each label narrows what the previous one meant.
The two bands are the working area. Price spends most of its time between the LW MA High band and the LW MA Low band, and the Re-Entry marks are where it came back to one of them after a push.
A CSD is the point where the picture changes side. It is the only event in the set that breaks
the Mid BB and both same-side averages in one candle, and everything after it belongs to the new direction.
These are reference points, not entry signals on their own. Use them alongside your own analysis, your own entry method and proper risk management.
DISCLAIMER
This indicator is a pattern detection tool. It is not financial advice and it makes no claim
about profitability. Trading involves risk. Always apply your own analysis and risk management. Indicator
