Balanced Price Range + V-Shape IndicatorBalanced Price Range + V-Shape Indicator
Overview
This is an open-source intraday scalping model built on ICT-derived price-action concepts. It combines Balanced Price Ranges and V-shaped liquidity-driven reversals into a single contextual system. The scalping method is specific: it looks for a sharp reversal (a "V") off a zone of overlapping imbalance (a Balanced Price Range), but only when that zone is confirmed by higher-timeframe imbalance or a recent liquidity sweep — the kind of fast, location-specific entry used on 1–15 minute charts. Rather than printing every BPR or inverted gap (which is unusably noisy live), it cross-filters them so only confirmed locations are highlighted. The source is fully open; everything below describes exactly what the code does.
Building block 1 — Fair Value Gaps and inversions
A Fair Value Gap (FVG) is a three-candle imbalance: a gap between candle 1's extreme and candle 3's extreme left unfilled by candle 2. The script detects each FVG as it forms and stores the displacement (middle) candle's open and close for later momentum checks. When price later closes back through a gap, that gap is latched as inverted (an iFVG) — its expected support/resistance role flips.
Building block 2 — Balanced Price Range
A Balanced Price Range is the price overlap between a fresh FVG and an opposite-direction iFVG. When a new FVG forms and overlaps an opposite inverted gap within a configurable lookback window, the overlapping band is drawn as a BPR. A minimum-size filter (as a percentage of 14-period ATR) discards slivers too thin to matter. BPR zones extend rightward until price closes through them or a max-extension bar limit is reached.
Building block 3 — Liquidity mapping and sweeps
The script independently maps liquidity from four sources, each toggleable: swing-pivot highs/lows, equal highs/lows (two same-side swings within an ATR tolerance), previous-day high/low, and London / NY-AM session highs and lows. For each level it distinguishes a sweep (wick through, close back — liquidity grab) from a clean break (close beyond — level reclaimed), marking sweeps on the chart.
The V-Shape gate — how the pieces work together
A BPR is upgraded to a "V-BPR" and an entry arrow only fires when the location passes a context gate with two independent confirmation paths, either of which validates the setup:
HTF FVG tap (continuation path): Fair Value Gaps are read from a higher timeframe (chart TF × a user multiplier, snapped to the nearest standard resolution). The gate checks whether price recently tapped a still-valid HTF gap of matching direction, and whether the BPR sits inside or within an ATR buffer of it.
Liquidity sweep (reversal path): a correct-side sweep — a low taken for a long, a high taken for a short — within a recent bar window.
Two candle-level filters refine the trigger: a clean-V-tip rule (the inversion candle must be preceded by an opposite-direction candle, enforcing a real reversal at the tip) and a strong-close rule (the inverting candle must reclaim a set percentage of the displacement candle's body, confirming momentum). An optional clear-path filter rejects a setup when un-swept opposite-side liquidity rests within an ATR danger zone in the trade's direction, since that pool is often taken first.
Chart Examples:
Settings reference
Settings: max BPRs shown, iFVG lookback window, min BPR size (% ATR), max zone extension.
Higher-TF FVG: show/hide, timeframe multiplier, max stored, colour.
V-Shape Gate & Entry: master gate toggle, HTF-tap window, zone proximity buffer, sweep-path toggle and window, clean-V-tip, clear-path toggle and danger-zone size, hide-non-V-BPR, entry-marker toggle, strong-close percentage.
Liquidity & Sweeps: toggles for swing / PDH-PDL / session / equal-H-L sources, pivot strength, equal tolerance, session windows (NY time), max levels, sweep marking, colours.
Colors: bull/bear BPR, FVG/iFVG components, liquidity, sweep marks.
How to use it
Apply to 1–15 minute charts. Drawn BPRs show overlapping imbalance; thicker V-BPR zones and ▲/▼ markers show locations that passed the gate. Each entry marker's tooltip audits why it fired (which path confirmed it and the reclaim %). Begin with the gate on to see only confirmed scalps; loosen by disabling individual filters, or enable "Hide BPRs that fail the gate" to declutter. Alerts fire on confirmed long and short V-Shape entries.
Non-repainting
All higher-timeframe and previous-day data is requested with offset historical expressions, so no future data is used on historical bars; entries evaluate only on confirmed bar closes and do not repaint. Indicator

Flops - OrderblocksDescription
The Advanced Flops - Orderblock indicator is a sophisticated, algorithmic supply and demand tracking system. It dynamically identifies trend-following institutional structures by detecting "Flops" (often known as Orderblocks) in real-time, visualizing exact areas where momentum aggressively shifted.
Instead of relying on a rigid, single-candle definition, this engine operates on a multi-timeframe perspective natively. It simultaneously evaluates 1-Candle, 2-Candle, and 3-Candle breakout logic on every single bar to validate structural breaks and paint flawless institutional supply/demand zones on your chart.
🎯 How It Works: The 1, 2, 3 Logic
The engine evaluates the market looking for a sequence of momentum candles that break structure against the previous opposing candle. By running the 1, 2, and 3-candle logic simultaneously, the script guarantees it catches both immediate V-shape reversals (1-candle) and slower, grinding structural breaks (3-candle) without drawing overlapping or duplicated zones.
Bullish ( Flops - Orderblock ): Formed when the price forcefully breaks the high of the last bearish candle. This indicates newly created demand.
Bearish ( Flops - Orderblock ): Formed when the price forcefully breaks the low of the last bullish candle. This indicates newly created supply.
✨ Key Features
Simultaneous Multi-Candle Logic: Runs three independent sequence checkers at the exact same time to ensure no valid Orderblock is ever missed.
Dynamic Mitigation Engine: Active zones project forward indefinitely into future price action until they are touched or closed through (customizable).
Single Mitigated Memory: A sleek visual feature that automatically deletes old, invalidated zones. It keeps only the absolute last mitigated zone on your chart to show you the most recent point of failure, without cluttering your screen with historical noise.
Trend Deactivation: The script understands market structure. If the dominant trend fully flips (e.g., from Bullish to Bearish based on a 3-candle sequence), all opposing active ( Flops - Orderblock ) zones are immediately deactivated and labeled as "Trend Flip", preventing you from taking trades against a confirmed structural shift.
Boundary Customization: Choose exactly how you want your Orderblock zones measured—either wick-to-wick (High/Low) or body-to-body (Open/Close).
⚙️ Settings
Flop Boundary: Define zones using full Wicks or strictly Candle Bodies.
Mitigation Mode: Choose whether a zone is invalidated the moment a wick "Touches" it, or only when a candle "Closes" fully through the zone.
Show Only Last Mitigated Flop: Keep your charts clean by automatically erasing old mitigated lines and only leaving the single most recent mitigated Orderblock on the chart.
Deactivate on Trend Flip: Automatically invalidate all active supply zones if the macro trend shifts bullish (and vice versa).
Full Visual Control: Customize colors, line widths, line styles (solid, dashed, dotted), and label visibility to fit your exact chart aesthetic. Indicator

Indicator

Indicator

Prior Day Dealing Range [M1D]Frames the previous day's range as an ICT dealing range — high, low, equilibrium, quartiles, and premium/discount extreme zones — with a session-selectable day boundary, sweep mitigation, and a live bias table.
WHAT IT DOES
This indicator plots the prior trading day's range and frames it the way an ICT trader reads a dealing range, rather than as three disconnected lines:
• PDH / PDL — previous day high and low
• PDEQ — equilibrium (the 0.5 midpoint of the prior range)
• 0.25 / 0.75 quartiles — the boundaries that split the range into premium, equilibrium and discount
• Premium & discount extreme zones — the top quartile (0.75→1.0) and bottom quartile (0.0→0.25) shaded as the areas where price most often reacts
All levels and zones share a single left anchor at the day's open, so they read as one stacked range projecting into the current session.
WHY A DEALING RANGE INSTEAD OF JUST PDH/PDL
Equilibrium tells you whether price is trading at a premium (above 0.5) or a discount (below 0.5); the quartile zones mark the extremes where reversions and sweeps tend to cluster. The bias table reduces that to a single read.
SESSION-ANCHORED DAY OPEN
The "day" can be anchored to Exchange (the chart's native daily boundary, works on all timeframes), or to NY Midnight / 8:30 NY / 9:30 NY. The NY options reset the range on the open that matters to your model and are intended for intraday charts (roughly 30m and below); Exchange is the safe default for any timeframe.
MITIGATION
When a confirmed bar sweeps PDH or PDL, that line fades to a dotted "mitigated" style and its label updates. This is sweep awareness only, evaluated on bar close (no intrabar repaint).
BIAS TABLE
Shows the PDEQ price, which zone price currently sits in (Premium / Discount, with an "extreme" flag in a quartile zone), and the exact position of price within the prior range as a percentage.
ALERTS
Cross above / below PDEQ, entry into the premium / discount extreme zone, and PDH / PDL swept.
HOW TO USE
1. Pick your day anchor — Exchange for a standard daily range, or an NY session open if your model resets there.
2. Read bias from PDEQ: above = premium (favor shorts), below = discount (favor longs).
3. Watch the extreme zones and PDH/PDL for sweeps; the mitigation styling flags when a level has been run.
4. Toggle any element (zones, quartiles, labels, table) off in settings to suit your chart.
NOTES / LIMITATIONS
• Levels are confirmed on the close of each day and held for the following session; they do not repaint.
• NY-anchored modes assume the session window aligns to a bar boundary, so they are best on intraday timeframes; on higher timeframes use Exchange.
• This is a contextual / discretionary tool — it marks levels and bias, it does not generate buy/sell signals.
The previous-day high/low/equilibrium calculation is standard; this script's contribution is the combination — a session-selectable day boundary, the full quartile dealing-range framing with premium/discount extreme zones, sweep mitigation, and a range-position bias table in one tool. All code is original and written in Pine Script v6. Indicator

OSOK SafePadOSOK SafePad is a lightweight price-level tool for marking a configurable safety buffer above and below the current reference price. It is designed for traders who want a clean visual guide for breakout, stop-entry, or event-driven execution plans without cluttering the historical chart.
Key features
Plots an Upper Pad and Lower Pad around the reference price.
Configurable pad size in points.
Optional freeze mode to lock levels at the start of a chosen session window, defaulting to 8:30 New York time.
Optional take-profit and stop-loss guide levels for both long and short stop-entry scenarios.
TP and SL levels are calculated from account-currency targets using the symbol point value and order size.
Lines extend to the right for easier monitoring without leaving historical marks as new bars print.
Clean, low-saturation colour palette designed to work on both dark and light charts.
How it works
Before the freeze time, SafePad tracks the latest chart price and displays the pad levels from the current candle. When freeze mode is enabled and the chart enters the configured freeze window, the indicator captures that candle’s open as the reference price and locks the pad levels from that point onward.
For example, with a 25-point pad, the Upper Pad is drawn 25 points above the reference price and the Lower Pad is drawn 25 points below it.
Take-profit and stop-loss guides
The optional TP and SL lines are derived from the configured dollar target, order size, and the symbol’s point value. These levels are visual planning aids for a hypothetical buy-stop at the Upper Pad and sell-stop at the Lower Pad.
Notes and limitations
This is a visual planning indicator, not an automated trading system.
TP/SL calculations depend on PulseWire’s syminfo.pointvalue; verify values for the instrument and broker feed you trade.
No trading signals, alerts, or order execution are included.
Indicator

ICT HTF/BIASICT HTF/BIAS — Full Guide
What this indicator does
ICT HTF/BIAS plots multi-timeframe ICT PD Arrays (FVGs + Order Blocks) and provides a compact bias table that helps you quickly determine directional context across your selected timeframes.
It is designed to stay simple, readable, and ICT-based, while avoiding misleading signals.
Key features
1) ICT PD Arrays included
FVG (Fair Value Gap): classic ICT 3-candle imbalance (gap).
Order Blocks (OB): detected via BOS logic + pivot structure, then searching back for the last opposite candle as the OB anchor.
2) HTF confirmed zones (non-misleading behavior)
Zones are added only on the HTF close (confirmed higher timeframe bar).
This avoids “in-progress HTF candle” noise and reduces false/temporary zones.
3) SHOW vs CALC (decoupled by design)
Each TF has two independent depth controls:
Max SHOW = how many zones you want to draw on the chart (keep your chart clean).
Max CALC = how many zones the table/bias is allowed to analyze (keep your bias logic robust).
This prevents a common problem: changing how many boxes you display changes your bias output.
In this script, your bias can remain stable even if you hide most boxes.
4) Compact Bias Table (fast read)
The table shows:
FVG status: IN / OUT / N/A
OB status: IN / OUT / N/A
BIAS: ↑ / ↓ / “-”
GLOBAL bias: weighted across TF1..TF4
How to read the bias
Per-Timeframe Bias rules (ICT-based, simple)
For each timeframe:
If price is IN an OB (within CALC depth) → bias = OB direction
Else if price is IN a FVG (within CALC depth) → bias = FVG direction
Else fallback to the most recent direction (OB preferred, otherwise FVG)
GLOBAL bias (weighted)
The GLOBAL row uses a weighted sum:
TF1 weight = 1
TF2 weight = 2
TF3 weight = 3
TF4 weight = 4
Score > 0 → bullish global bias
Score < 0 → bearish global bias
Score = 0 → neutral
Chart TF “Guard” (prevents false LTF readings)
PulseWire has limitations when requesting very low TF data from a much higher chart timeframe.
To avoid showing incorrect LTF (1m/5m/15m) statuses when you’re on a high chart TF, the script can display a small warning banner and treat certain LTF rows as N/A when appropriate.
Purpose: never show false information.
Recommended usage (most user friendly)
Step 1 — Choose your “Entry TF”
As a rule of thumb (ICT):
The lowest TF in your set should match your entry timeframe, or be close to it.
Examples:
Intraday / Scalping
TF1=1m, TF2=5m, TF3=15m, TF4=1H
(Use chart TF 1m–15m for best LTF accuracy.)
Higher timeframe trading
TF1=1H, TF2=4H, TF3=1D, TF4=1W
(Then you naturally don’t care about 1m/5m.)
Step 2 — Keep your chart clean with SHOW vs CALC
A practical approach:
Max SHOW: 1–2 (clean chart)
Max CALC: 3–10 (more stable bias/table logic)
Main settings (quick explanation)
Timeframes (Rows)
Enable TFx: enable/disable each row timeframe
Show Boxes TFx: show/hide zones for that timeframe
Max SHOW / Max CALC
Max SHOW FVG / OB: visual draw limit
Max CALC FVG / OB: depth used by table and bias
Box Width (Per TF)
HTF bars: width scales by HTF size
Chart bars: fixed width in chart bars
OB Logic
Pivot length (BOS): higher = stricter / fewer OBs
OB lookback: how many HTF bars to search for the OB anchor candle
Notes / limitations
This is a context + confluence tool, not a “signal generator.”
LTF accuracy depends on chart TF; the Guard exists specifically to prevent misleading outputs.
One-line summary
ICT HTF/BIAS: multi-TF ICT PD Arrays + a clean bias table with SHOW vs CALC separation, so you can keep charts minimal while keeping bias logic consistent.
Indicator

Indicator

Multi-EMA Future Trajectory Projector [20/50/100/200]Multi-EMA Future Trajectory Projector DescriptionThe Multi-EMA Future Trajectory Projector solves a fundamental limitation of traditional moving averages: lag. Because Exponential Moving Averages (EMAs) are backward-looking mathematical averages, traders are often left guessing how long or how far a price must move before a trend crossover occurs.
This script eliminates the guesswork by calculating the exact mathematical decay of the 20, 50, 100, and 200 EMAs into the unprinted, blank future space of your chart. Rather than predicting where the market will go, this tool acts as a "What-If" simulator , plotting the precise trajectory curves the EMAs will take based on your own expected price targets.
Unlike standard indicators, this script gives you complete visual control over the lookahead vectors directly inside the Inputs tab, allowing you to custom-style your future projection lines.
How it Works (The Math)
An EMA weighs the most recent price closing data heavier using a fixed smoothing multiplier: Multiplier = 2 / (Length + 1)
Because future price bars do not exist yet, this indicator runs a recursive loop algorithm starting from the real-time live price bar. It uses a chain-link calculation where every forward step is derived from the previous step’s projected EMA value using your selected price source as the fixed focal target.
Core Features & Settings
Custom Lookahead Depth: Adjust the Number of Extensions to project anywhere from 1 to 500 bars into the future blank space. Simulate Multiple Scenarios: Change the Price Source input to simulate different environments. For example, setting it to Close calculates the path if the price completely flatlines.
Complete Input Styling: PulseWire natively restricts code-generated future lines from appearing in the "Style" tab. This script bypasses that limitation by moving all color, thickness, and line style (Solid, Dashed, Dotted) settings directly into the Inputs panel for individual EMAs.
How to Use This in Your Trading
1. Anticipating Trend Crossovers (EMA Crosses)Instead of waiting hours or days for a 20/50 EMA cross to print historically, look at the projected slopes. If the 20 EMA trajectory curve is bending aggressively toward the 50 EMA, you can visually measure exactly how many bars are required at the current price level for a crossover to trigger.
2. Identifying Extensions & Mean Reversion Shorter moving averages (like the 20 EMA) react rapidly to spot prices and curve sharply, while longer ones (like the 200 EMA) plot flat trajectories. Use the gap between the short-term and long-term future lines to judge if an asset is overextended and likely to experience a mean-reversion pullback.
3. Support & Resistance Confluence Projected curves map out where key historical moving averages will form dynamic support or resistance on upcoming bars. Use the future line coordinates to plan precise, front-run take-profit limits or stop-loss placements.
Indicator

Indicator

Indicator

Indicator

Indicator

Indicator

Indicator

Copper vs Cu/Au DecompositionCopper vs Cu/Au Decomposition
The copper-to-gold ratio is one of the most widely watched macro signals in markets, used as a proxy for global growth, risk appetite, and the direction of long-end yields. The framework is intuitive. Copper demand rises with industrial activity. Gold demand rises with monetary and geopolitical stress. The ratio encodes the balance between growth-on and defense-on regimes.
It has a structural blind spot. Because Cu/Au is a quotient of two independently moving series, the ratio alone cannot tell you which leg is doing the work. A rising Cu/Au might mean copper is rallying on real industrial demand. It might also mean gold is selling off on a hawkish surprise while copper does nothing. A falling Cu/Au might mean genuine growth weakness, or it might mean copper is strong but gold is even stronger and is masking the signal. Same number, very different stories, very different trades.
This indicator decomposes the ratio into its components so you can see which side is actually driving it. It plots copper, gold, and the ratio as z-score normalized series on a shared monthly timeframe, then adds a derived line that quantifies the gap between copper's absolute strength and what the ratio is reporting. That derived line is the diagnostic.
WHAT IT PLOTS
- Four lines, all sampled on the monthly timeframe regardless of the chart timeframe.
Copper z-score (orange)
- HG1! monthly close, normalized over a rolling 60-month lookback, lightly EMA-smoothed.
Gold z-score (yellow)
- TVC:GOLD monthly close, same treatment.
Cu/Au ratio z-score (aqua)
- The headline series with heavier linewidth.
The ratio is built by sampling both legs on the same monthly bar via nested request security before forming the quotient. This matters. If you compute the ratio at chart level using forward-filled monthly values, a 60-bar rolling window on a daily chart averages roughly three months of stepped data rather than 60 actual monthly observations. The nested approach preserves true monthly resolution in the rolling window.
Copper minus Ratio spread (magenta)
- The diagnostic line. Optional, off by default to keep the panel clean on first load.
Supporting elements include a dashed zero line, light green and red background tints keyed to the ratio's sign, and a status table top-right confirming each symbol loaded. All four lines have independent toggles.
HOW TO READ IT
- The three primary lines tell you what each leg is doing. The magenta spread tells you whether the ratio is being honest about copper.
Spread near zero
The ratio is faithfully reporting copper. Read Cu/Au at face value.
Spread positive and rising
Copper is stronger than the ratio shows. Gold strength is masking it. Lean long copper but do not trust ratio-based signals to size the trade.
Spread negative and falling
The ratio is overstating copper. The move is really a short-gold story misrepresented as a copper bid. Fade ratio-based copper longs in this regime.
THE FOUR CHARACTERISTIC SCENARIOS
Clean cyclical turn - Copper rises, gold flat, ratio rises, spread near zero. All signals agree. The ratio is honest. High-confidence growth-on tape.
Masked copper strength - Copper rises, gold rises harder, ratio flat or falling, spread sharply positive. The ratio is hiding real copper strength behind a stronger gold leg. This is the regime the indicator exists to flag.
Fake copper signal from gold weakness - Copper flat, gold collapses, ratio rises, spread sharply negative. The ratio looks bullish on copper but it is really a short-gold story. Fade.
Confirmed risk-off - Copper falls, gold rises, ratio falls hard, spread roughly flat. Both legs agree on defense. The ratio is honest.
WHAT THE SPREAD REVEALS
The Cu/Au ratio loses information whenever gold moves independently of copper. The spread quantifies that lost information as a single readable number. When it sits near zero, no information is being lost. Copper and the ratio are saying the same thing. When it deviates, the ratio is failing as a copper proxy and you need to step around it to the underlying components.
The decomposition can be done mentally by watching the three primary lines, but doing it in real time while reading a chart is error-prone. The spread does that subtraction explicitly and renders the answer as a single line whose distance from zero is the magnitude of the distortion. Z-scoring the ratio as its own series, rather than computing the spread as copper z minus gold z arithmetically, is the design choice that makes the spread responsive to what the ratio is actually doing as a series, not just what its components are doing in isolation.
INPUTS AND DEFAULTS
Z-Score Lookback (default 60 )
- The rolling window for mean and standard deviation, in monthly bars. Five years captures roughly one full commodity and business cycle, long enough to represent a regime-neutral baseline but short enough to update when the macro environment shifts.
EMA Smoothing Length (default 3)
- Light smoothing on each z-score after normalization. Three monthly bars dampens single-month noise without introducing meaningful lag.
Source Timeframe (default M)
- The timeframe at which all symbols are sampled. See Suggested settings below for pairings with different lookbacks.
Display toggles
- Independent show/hide for each line, the background tint, and the status table.
Suggested settings
The two calibration inputs, lookback and source timeframe, are not really independent. They multiply to give you one number, the regime window the z-score measures against. Lookback × bar length = regime window. The default monthly × 60 produces a 5-year window because that's the natural horizon for Cu/Au as a multi-year cycle signal. Other source timeframes can preserve the same horizon at finer visual resolution.
Macro regime (~5 years)
- The indicator's original design horizon. Best for reading Cu/Au as a structural cycle tool. Monthly × 60, weekly × 260, daily × 1260, or 3D × 420.
Cycle phase (~2 years)
- Intermediate, captures one full phase of a business or commodity cycle. Useful when the broader regime is well established and the question is where within it you currently sit. Monthly × 24, weekly × 104, daily × 504, or 3D × 168.
Tactical (~6 months)
- Short horizon, asks where copper sits relative to recent trading. The masking dynamic operates more weakly at this scale, so the spread's diagnostic power is reduced. Weekly × 26, daily × 126, or 3D × 42.
A few practical notes on choosing among these
The higher the source timeframe, the more it filters intra-period noise before the z-score is calculated. Monthly source gives the cleanest macro read but updates only when a new month closes, producing a stepped visual on lower chart timeframes. Setting source equal to your chart timeframe gives a smoother line but mixes regime drift with intra-period noise.
A useful middle ground on multi-day charts is setting source one or two steps above your chart timeframe. On a 3D chart, weekly source smooths daily volatility without going all the way to monthly's stepped behavior.
Z-score magnitudes do not transfer perfectly across sources. Higher-frequency series carry more variance, which inflates the rolling standard deviation and compresses z-scores. The same 5-year window will print spikier readings on monthly than on daily because monthly closes filter noise before the calculation begins. The shape of moves matches across sources, but the amplitudes do not.
The most informative use is running multiple instances of the indicator simultaneously at different horizons. The slow spread tells you whether the macro Cu/Au framework is currently honest. The fast spread tells you about near-term distortions worth trading around.
Notes
Data is fetched with gaps=barmerge.gaps_off and ignore_invalid_symbol=true, so missing bars are forward-filled and the indicator does not break if a symbol fails to load. Calculations are non-repainting.
Best used on weekly or daily charts at the default settings. The monthly resampling gives meaningful resolution there. Below daily, monthly values will appear as long flat segments, in which case the suggested settings above for tactical or cycle-phase calibrations are worth considering.
Originality
The underlying mechanics, z-score normalization, forward-filling, and ratio construction, are standard. The original contributions are three: the integrated four-line decomposition; the construction of the ratio from same-bar monthly samples via nested request security to preserve true monthly window resolution; and the Copper-minus-Ratio spread as an explicit measure of when the Cu/Au ratio is being distorted by gold-side moves. No published PulseWire indicator I am aware of combines these elements as a single diagnostic for Cu/Au signal quality. Indicator

BreakoutBreakout is an overlay indicator for identifying pre-breakout trade context using supply/demand zones, higher-timeframe alignment, moving-average structure, and confluence scoring.
This script is for analysis and planning only. It does not place orders or guarantee results.
What it does
Breakout helps visualize potential long and short setups before price breaks out of a key zone. It combines:
- Key magnet supply/demand zones (strongest reaction levels only)
- HTF trade zones auto-anchored by chart timeframe
- Pre-trade setup boxes with entry, stop, and target
- Diamond markers for high-confluence turning points
- Liquidity levels for potential sweep/SFP context
- Optional info panel with bias, levels, and active setup details
How it works
Magnet zones: pivot highs/lows cluster into levels. Levels price revisits gain strength. Only the strongest are drawn.
HTF trade regime: each chart timeframe uses two higher anchor timeframes. Long ideas can be filtered to HTF demand zones; shorts to HTF supply zones. Zones use confirmed HTF swing highs/lows with ATR-based width and reach.
Setup engine: setups form when zone context, trend/MA structure, confidence score, and cooldown align. Stops use risk percent, MA support/resistance, swing levels, and a max distance cap. Targets use a configurable minimum risk/reward.
Diamond signals: require structure (SFP, reversal, or MA setup), zone context, and supporting momentum/trend. Optional volume spike and RSI divergence add confluence. Not every pivot prints a diamond.
Volume and divergence: abnormal volume spikes (relative volume and z-score) can combine with RSI divergence in diamonds and setup scoring.
MTF data uses request.security() with barmerge.lookahead_off to avoid lookahead on higher-timeframe context.
How to use
1. Add Breakout to your chart.
2. Choose your execution timeframe.
3. Keep HTF zone filter on for higher-timeframe alignment.
4. Wait for price at HTF zone plus key magnet zone, then diamond or setup box with confidence at or above Min Confidence.
5. Use entry, stop, and target from the active setup box for planning.
6. Manage risk with your own rules.
Main settings
- Risk: risk per trade, min R/R, max hold bars
- Filters: min confidence, approach distance, cooldown, volume, vol spike and divergence
- HTF zones: trade inside HTF S/D only, auto anchors, zone width and reach
- Display: zones, setups, liquidity, labels, info panel, EMAs, diamond spacing
Alerts
- Breakout Long Setup
- Breakout Short Setup
- Breakout Approaching Demand
- Breakout Approaching Supply
Alerts reflect script conditions at alert time. They are not trade recommendations.
Disclaimer
Educational and informational use only. Not financial advice. Trading involves risk, including loss of capital. Past results do not guarantee future performance. Use at your own discretion. Indicator

Financial Conditions Index# Financial Conditions Index — Real Yields + Credit + Dollar + Vol
## What it does
This indicator condenses the four pillars of market financial conditions into a single, readable composite: **are conditions tight or loose right now versus their recent norm — and which factor is driving it?**
It takes four inputs that each tighten or loosen the screws on risk assets — the real yield, high-yield credit spreads, the dollar, and equity volatility — standardizes them onto a common scale, and combines them. A single number tells you the regime; a breakdown table tells you the cause.
## What it plots
The composite plots as **zero-centered columns**:
- **Red, above the band** — conditions TIGHTER than their rolling norm (a risk-off lean).
- **Green, below the band** — conditions LOOSER than normal (a risk-on lean).
- **Faint grey, inside the band** — neutral / near the norm.
Zero is the rolling-window average, so the indicator reads *relative tightness*, not an absolute level. The dotted lines mark the status band.
## The four components
Each is pulled from public data, z-scored over a rolling window, and sign-aligned so that **positive always means tighter**:
- **Real Yield** — the 10-year TIPS real yield (FRED: DFII10). Higher real rates = tighter.
- **Credit (HY)** — the high-yield option-adjusted spread (FRED: BAMLH0A0HYM2). Wider spreads = tighter.
- **Dollar** — the US Dollar Index (TVC: DXY). A stronger dollar = tighter global conditions.
- **Equity Vol** — the VIX (TVC: VIX). Higher vol = tighter.
The composite is an equal-weighted average of these by default, and the weights are inputs you can change.
## The table ("FIN CONDITIONS")
- **FCI** — the headline composite z-score and its status: TIGHT (risk-off), LOOSE (risk-on), or NEUTRAL.
- **Real Yield / Credit (HY) / Dollar / Equity Vol** — each component's own z-score and whether it is currently *tightening*, *easing*, or *neutral*.
This breakdown is the point of the tool. A one-line conditions index can only say "tight" or "loose"; this one shows you *why*. A reading driven by real yields and the dollar is a very different animal from one driven by credit spreads and volatility blowing out — the first is often a benign, rates-led tightening, the second is genuine market stress. Reading the components keeps you from mistaking one for the other.
## How to use it
1. **Read the composite as the regime.** Above the band = a tighter-than-normal backdrop that tends to pressure risk; below = a looser, more supportive one.
2. **Always check the breakdown.** When the composite flags tight, look at which components are carrying it. Rates/dollar tightness while credit and vol stay loose is a different signal than a broad-based tightening across all four.
3. **Watch for divergence within the components.** When one factor pulls hard against the others, that disagreement is information — it often marks transitions and tells you what the market is actually reacting to.
4. **Pair it with your chart.** Add it beneath any asset to gauge the macro backdrop your instrument is trading into.
## Settings
- **Z-Score Window** — rolling lookback for standardizing each component (default 252 ≈ one year). Longer windows (504/756) anchor to a broader norm and better capture persistent regimes, at the cost of responsiveness.
- **Status Band** — how far from zero (in z units) a reading must be to flag TIGHT/LOOSE rather than NEUTRAL (default 0.5).
- **Component Weights** — equal (1.0 each) by default; raise or lower any factor's influence without touching the code.
## Methodology and honest limitations
- **This is a transparent, equal-weight z-score composite — not a regression- or PCA-estimated index** like the Chicago Fed NFCI or the Goldman Sachs FCI. It's an honest "tight vs loose versus the recent norm" read built from public series, not an econometrically weighted institutional index. Treat the equal weighting as a sensible default, not an optimized one.
- **The rolling window has a tradeoff baked in.** A regime that stays tight for a long stretch slowly normalizes toward zero, because it becomes the new "normal." That is the nature of a rolling z-score; lengthen the window if you would rather it keep flagging a persistent regime.
- **It is asset- and timeframe-independent by construction.** Every component is pulled at its own daily resolution and standardized there, so the window is measured in the components' (business-day) bars — not your chart's. It reads the same whether you place it under a 24/7 asset or a regular-hours one; you never need to retune the window per symbol.
- **History is bounded** by the 10-year real-yield series (begins 2003) plus the window's warm-up period; earlier bars read n/a.
## Data
All series are pulled live via `request.security`: FRED DFII10 (10-year TIPS real yield), FRED BAMLH0A0HYM2 (high-yield OAS), TVC DXY (US Dollar Index), and TVC VIX (equity volatility). Nothing is hard-coded — the composite and every table value are computed from these public sources.
## Disclaimer
For educational and informational purposes only. This is not investment advice or a recommendation to buy or sell any asset. Markets involve risk; do your own research. Indicator

Indicator

Indicator

Indicator

Indicator

Macro Risk Regime# Macro Risk Regime — Real-Yield Momentum + Inflation Pulse
## What it does
This indicator answers one question: **is the real-rate backdrop a tailwind or a headwind for risk assets right now?**
It reads the regime off the *direction* of the 10-year real yield — arguably the single most reliable macro driver of risk-asset financial conditions — and surrounds it with a realized-inflation "pulse" that tends to lead the real yield. So you can often see a turn building in inflation before the regime itself flips.
## What it plots
- **Amber line** — the 10-year real yield (FRED: DFII10, the 10Y TIPS yield).
- **White line** — its trend (a moving average over the lookback you set).
- **Shading** — green when the real yield is *below* its trend (real rates falling = easing = **RISK-ON**); red when *above* (rising = tightening = **RISK-OFF**).
The premise: falling real yields ease financial conditions and support risk; rising real yields tighten them and pressure risk. **Direction matters more than level.** This is what captured the deeply negative, falling real yields of 2020–21 (risk-on, even as inflation rose) and the sharp real-yield spike of 2022 (risk-off) — turns that an inflation-level signal alone would have missed.
## The table ("MACRO RISK")
- **Risk Regime** — the headline. The value is the real yield's gap to its trend; the status is RISK-ON (below trend, easing) or RISK-OFF (above trend, tightening).
- **YoY CPI** — trailing headline inflation, for reference. It's the input to the rows below.
- **3m Ann** — realized inflation's last-three-month annualized pace, tagged COOLING / STEADY / HEATING versus the 12-month trend. Your near-term inflation momentum.
- **Surprise\*** — the latest month's annualized pace minus the trailing 3-month pace: UPSIDE (accelerating), DOWNSIDE (decelerating), or IN LINE. See the note below on the asterisk.
- **Real−Priced** — trailing YoY CPI minus the 10-year breakeven (FRED: T10YIE): where realized inflation sits relative to what the market has priced.
- **Trend vs Priced** — realized 3-month pace minus the breakeven: whether the recent inflation run-rate is HOT or COOL versus what's priced. This is the forward-looking tactical read — realized cooling *below* what's priced is the disinflation-confirming signal that tends to pull real yields, and the regime, lower.
## How to use it
1. **Read the shading as the regime.** Green = real-rate tailwind, red = headwind. That's your macro backdrop in one glance.
2. **Use the inflation pulse as the leading tell.** Disinflation showing up first in the pulse (COOLING, DOWNSIDE surprise, COOL vs PRICED) tends to lead real yields lower and flip the regime green; accelerating inflation does the reverse. The pulse often turns before the shading does.
3. **Mind the divergences — they're the point.** When the regime is red but your asset is rising anyway, the move is running on something *other* than real-rate easing — liquidity, flows, an idiosyncratic catalyst — which is a less macro-confirmed, more fragile advance. When the regime and price agree, that's higher conviction. The divergences are the most useful information the tool gives you, not a defect.
4. **Tune the trend length.** Shorter = more responsive and more whipsaw; longer = a smoother, slower regime. The default (100 trading days, ~5 months) is a reasonable middle. The moving average is computed on daily data, so the lookback means the same thing regardless of your chart's timeframe.
Add it to whatever symbol you're analyzing and read your asset against the macro backdrop.
## Settings
- **Risk-Regime Trend Length** — lookback for the real-yield trend (default 100 trading days).
- **Realized-vs-Priced Band** — sensitivity for the HOT / COOL vs PRICED flag (default 0.25%).
- **Surprise Band** — sensitivity for the UPSIDE / DOWNSIDE flag (default 0.5% annualized).
## Methodology and honest limitations
- **It is the real-rate slice of financial conditions plus an inflation pulse — not a full multi-factor financial-conditions index.** It deliberately leaves out credit spreads, the dollar, and equity volatility. It's strongest as the rates/inflation lens; pair it with those other inputs for a complete picture rather than treating it as a standalone everything-gauge.
- **"Surprise" is a momentum proxy, not a consensus surprise.** It compares the latest print to the recent run-rate, because there is no economist-estimate feed available in Pine. So it answers "is inflation accelerating or decelerating off its recent pace," which is related to — but not the same as — "did it beat forecasts." The asterisk in the table marks this.
- **It is a trend/momentum signal, so it can whipsaw** when real yields chop sideways around their average. In those stretches, lean on your other gauges.
- **History starts in 2003.** The real yield and everything referencing breakevens (Real−Priced, Trend vs Priced) begin when TIPS/breakeven data begins; earlier bars read n/a.
## Data
All series are pulled live from FRED via `request.security`: DFII10 (10-year TIPS real yield), T10YIE (10-year breakeven inflation), and CPIAUCSL (CPI). Nothing is hard-coded or hidden — the regime and every table value are computed from these public series.
## Disclaimer
For educational and informational purposes only. This is not investment advice or a recommendation to buy or sell any asset. Markets involve risk; do your own research. Indicator
