Indicator

Indicator

Market Structure (BOS / CHOCH), Advanced & ImprovedMarket Structure (BOS / CHOCH)
A clean, dual-layer market structure tool that labels Break of Structure and Change of Character from a single, internally consistent trend engine, then projects the resting liquidity those swings leave behind.
The core idea
BOS and CHOCH are the same break. What separates them is direction relative to the current trend, so this script tracks one trend state and derives the label from it:
BOS (Break of Structure) : price breaks a swing level in the direction of the trend. Continuation.
CHOCH (Change of Character) : price breaks a swing level against the trend. Reversal, and it flips the trend state.
Because both signals come from one state machine, you never get contradictory labels: a break with the trend is always BOS, a break against it is always CHOCH.
Dual-layer structure
The engine runs twice at the same time:
Swing structure (longer pivot length) : the major skeleton, drawn bold, with trailing watched-level lines and HH / HL / LH / LL swing labels.
Internal structure (shorter pivot length) : the minor continuation breaks inside each swing leg, drawn thin and faded so they read as secondary.
This lets you see a minor bullish BOS unfolding inside a major downtrend, which is the context most single-length tools miss.
Liquidity pools
Every unbroken swing high (buy-side) and swing low (sell-side) is projected to the right as a resting liquidity line, and removed the moment price wicks through it. What stays on screen is only live, untaken liquidity, the levels most likely to be targeted next.
Features
BOS / CHOCH detection with a single coherent trend state
Dual-layer swing and internal structure
Trailing lines marking the exact levels currently being watched
HH / HL / LH / LL swing labels, color coded by structural meaning
Buy-side and sell-side liquidity pools with auto removal on sweep
Top-right trend table showing the swing and internal trend state
Close or Wick break confirmation
Eight alert conditions: swing and internal, BOS and CHOCH, bullish and bearish
Inputs
Swing length and Internal length : pivot lookback for each layer. Lower values catch more structure, higher values show only major moves.
Break confirmation : Close requires a close beyond the level, Wick accepts any wick beyond it.
Toggles for BOS, CHOCH, active levels, swing labels, liquidity, internal layer and the trend table.
How to use
Trade with the swing trend, use internal CHOCH for early reversal warnings and internal BOS for continuation entries.
Watch the liquidity pools as targets, a sweep of one followed by a CHOCH in the opposite direction is a classic reversal setup.
Tune the swing length to your timeframe so the major structure matches the moves you actually trade.
Notes
Swing pivots confirm a fixed number of bars after they print, which is inherent to all structure tools and not repainting. On the live, unclosed bar a break can update until the bar closes, so set alerts to "Once Per Bar Close" for confirmed signals.
This script is a market analysis tool, not financial advice. Always do your own research and manage risk. Indicator

Indicator

SCALP AIThis script is a collection of various trading concepts and indicators integrated into a single Pine Script file. I would like to express my sincere gratitude to the original authors whose work, ideas, and components made this compilation possible.
Core Functionalities
Dashboard & AI Scoring System:
Features a configurable dashboard showing real-time market data.
Uses a proprietary scoring mechanism based on trend analysis (EMA 20/200), RSI, volume, VWAP, ADX, and Multi-Timeframe (MTF) alignment to output signals ("A+ SETUP" to "NO TRADE").
Trend & Filter Analysis:
Uses Exponential Moving Averages (EMA) to identify trends and simple moving averages (SMA 9, 20, 89, 200) for visual filter support.
Color-coded bar highlights based on short-term EMA 9 trends.
Session Engine:
Tracks specific market sessions (NY, London, Asia, US Pre-market) with visual markers on the chart.
Includes alerts for upcoming session starts.
Levels & Price Action:
Automatically plots Daily Open, High of Day (HOD), and Low of Day (LOD) levels with extendable lines.
Features an advanced Supply & Demand zone detection system that ranks zones based on strength, mitigates broken zones, and visualizes zone strength using bar-based meters.
Multi-Timeframe Data:
Integrates multiple daily EMAs (3, 9, 20, 50, 100, 200) to help gauge long-term momentum alongside the short-term scalping logic.
The script leverages complex array structures to manage active supply and demand zones, ensuring that invalid or "broken" zones are removed from the chart, while keeping the most relevant ones ranked by a calculated score. It also utilizes request.security for multi-timeframe data fetching to provide a broader context for the current chart timeframe. Indicator

Swing Failure Pattern (SFP) - Advanced & ImprovedSwing Failure Pattern (SFP) automatically detects liquidity sweeps on your chart — bars that wick past a prior swing high or low and close back inside it — and marks them with labels, swept level lines, and optional retest tracking.
=================================
WHAT IS AN SFP?
Every significant swing high and low on your chart has a cluster of orders sitting just beyond it. Stop losses from traders who are long, buy stops from traders waiting for a breakout, limit orders placed at round numbers. All of that sitting at one level is called liquidity.
An SFP is what happens when the market reaches that level, triggers all those orders, and then immediately reverses. Price makes a new high or low — just enough to sweep the liquidity — then snaps back and closes on the other side of the level.
Bullish SFP — wick below a prior swing low, close back above it. The sell stops below that level got triggered. The sellers who just got filled are now trapped. Price is labeled below the wick.
Bearish SFP — wick above a prior swing high, close back below it. The buy stops above that level got triggered. The buyers who just got filled are now trapped. Price is labeled above the wick.
SFP+ and SFP++ — the same wick swept 2 or 3 stacked swing levels at once. More liquidity was grabbed in a single move, which tends to produce a stronger and more sustained reversal.
=================================
HOW THE DETECTION WORKS
The indicator tracks the most recent swing highs and lows using pivot detection (configurable lookback, stored up to max_age days). Each closed bar is checked against all stored pivots:
The wick must exceed the pivot level by at least the minimum sweep size (ATR-based) to filter out micro-wicks that barely graze the level.
The close must reject back past the swept level with a minimum close position (top or bottom X% of the bar), filtering weak closes near the middle.
Optionally, the bar must have above-average volume — real stop hunts typically show a volume spike.
=================================
WHEN IT DOES NOT WORK
An SFP is a liquidity event, not a reversal guarantee. Two conditions reduce its reliability significantly:
Trading against a strong trend. A bearish SFP in the middle of a powerful uptrend often produces only a brief pause before the move continues. The stop hunt happened, but the underlying demand is too strong to reverse. The HTF Trend Filter setting exists for this reason — enabling it filters SFPs that go against the higher timeframe EMA direction.
No supporting context at the level. An SFP that fires at a random mid-range price tends to fail more often than one that occurs at a meaningful confluence of levels — a weekly high, a significant VWAP, a well-established volume node, or a clean structural area that multiple timeframes agree on. The signal is the same but the odds are different. Using this indicator alongside tools that measure level significance will separate the high-quality setups from the noise.
=================================
SETTINGS
Pivot Detection
Intraday pivot bars — confirmation bars required on each side for intraday timeframes (1m to 4H). Default 8.
HTF pivot bars — confirmation bars for Daily and above. Default 3. Kept lower because daily swings are structurally significant with less confirmation needed.
Max pivots stored — how many recent swing levels are tracked per side. Default 5.
Max pivot age (days) — levels older than this are expired. Default 20.
Filters
Min sweep size — wick must exceed the level by at least this ATR multiple.
Min close position % — for bullish SFP, close must be in the top X% of the bar. For bearish, the bottom X%.
Volume confirmation — optionally require above-average volume on the SFP bar.
HTF Trend Filter
When enabled, bullish SFPs only show during uptrends and bearish SFPs only during downtrends, defined by price relative to a configurable EMA on a higher timeframe.
Session Filter
Optionally restrict signals to the London open and NY open windows (UTC hours, fully configurable). SFPs during these windows tend to be institutionally driven rather than low-liquidity noise.
Retest Tracking
After an SFP fires, the swept level is stored. If price later returns to that level and holds, a small R label marks the retest candle. The retest is often a cleaner entry than the SFP candle itself.
Display
Draw swept level lines — dashed line from the original pivot bar to the SFP bar, showing which level was grabbed.
Show tracked pivot levels — draws all currently tracked pivots as dashed lines so you can watch levels in real time before an SFP forms.
Remove pivot when swept — cleans up the level from storage once it has been used.
=================================
RECOMMENDED TIMEFRAME
Works on all timeframes. Pivot bars auto-adjust between intraday and HTF values. Most actionable on 1H to 4H for intraday setups and Daily for swing trading.
Indicator

Indicator

Indicator

Indicator

Draw On Liquidity Planner [AGPro Series]Draw On Liquidity Planner
🧠 Core Idea
Of all the liquidity resting around price, which single pool is the dominant draw right now, how strong is that draw, and what level would put it in question?
📌 Overview / What It Does
Draw On Liquidity Planner is a chart-first liquidity decision tool. Instead of drawing every high and low on the screen, it studies the untapped liquidity pools sitting on both sides of price and decides which one is acting as the dominant "draw on liquidity," then frames a complete read around it.
It maps buy-side liquidity above price and sell-side liquidity below price from three sources: clusters of equal highs and equal lows, the prior higher-timeframe high and low, and unmitigated swing points. It tracks which pools are still untapped and which have already been swept. It then scores each side from 0 to 100 and selects the single dominant draw, presenting a clear state, the target pool price, the draw distance in ATR, the pool type, a structural invalidation reference, and a plain next-action read in a clean panel.
The script does not predict price, generate buy or sell signals, or automate trades. It organizes scattered liquidity into one structured draw decision so the chart can be read with intent instead of guesswork.
🎯 Purpose & Design Philosophy
This planner was built to close a specific gap. Many liquidity tools fall into one of two traps: they map every level at once until the chart is unreadable, or they only flag a sweep after it has already happened. Neither answers the first question a liquidity-focused trader actually asks: of everything resting around price, which side is the real magnet, and how convinced should I be?
Draw On Liquidity Planner is designed for patient, context-driven traders who think in terms of where liquidity rests and where price is being pulled. It supports a planning mindset rather than a reflex: identify the dominant draw, note the target and the invalidation, gauge conviction from the score, and then wait for the market to confirm or reject that context. It is a decision-support layer, not a trigger.
⚡ Why This Script Is Different
Most liquidity tools either print a dense map of every swing high and low, or they detect a sweep only once it is complete and leave the interpretation to you.
This script does NOT flood the chart with every level, and it does NOT claim to know the next move.
Instead, it ranks both sides of liquidity into a single dominant draw with a transparent 0-100 score, shows one clean target, one structural invalidation, and a light reference map of the remaining pools, and keeps the detailed read in a premium panel so the price area stays clear. The decision layer — which side, how strong, what would invalidate it — is the product. The raw levels are just the inputs.
⚙️ Methodology
The internal logic runs in clear, rule-based steps:
1. Pool Detection
Swing highs and swing lows are detected with an adjustable swing strength and stored as candidate liquidity pools. The prior higher-timeframe high and low can be included as significant pools, and the period adapts to the chart: prior day on intraday charts, prior week on daily charts, and prior month on higher timeframes.
2. Mitigation Tracking
A buy-side pool is marked as taken once price trades through it, and a sell-side pool once price trades under it. Only untapped liquidity is treated as an active draw, so the read reflects what is still resting rather than what has already been consumed.
3. Cluster Evaluation
Nearby untapped levels are grouped using an ATR-based tolerance to recognize equal highs and equal lows. More touches at a level mean stronger resting liquidity, which contributes a higher draw quality.
4. Draw Scoring
Each side receives a 0-100 score built from four components: pool quality (cluster strength and prior-period status), proximity in ATR, directional context from a trend backbone, and pool freshness. The weighting favors quality and proximity while still respecting trend alignment and how recently the pool formed.
5. Dominant Draw Selection
The higher-scoring side becomes the active draw. When the two sides are close, the context is treated as balanced two-sided liquidity rather than forcing a single direction.
6. Visual Output
The active draw is drawn as a thin highlighted zone with a centered badge, a target line, a structural invalidation line, a light reference map of the remaining pools, a single right-edge target tag, and a complete summary panel.
🗺️ How to Read the Chart
- Draw Zone: the thin highlighted band around the dominant liquidity target, with a centered badge showing the state and the 0-100 score.
- Target Line: the solid line at the active draw pool price.
- Invalidation Line: the dashed line at the opposite-side structural reference (the nearest swing on the other side); losing that level weakens the current draw lean.
- Faint Pool Lines: dotted reference lines marking the other untapped pools on each side, as a light liquidity map.
- Target Tag: a single right-edge tag with the active draw target price.
- Event Labels: compact markers that print when the dominant draw flips side or when a liquidity pool is swept. They alternate by side and stay clear of the candles.
- Panel: state, draw score, target, distance, pool type, invalidation, and action.
Colors follow the AG Pro palette: teal for buy-side draws, pink for sell-side draws, and amber for balanced or lower-conviction context.
🚦 Signals & States
• Buy-Side Draw → untapped liquidity above is the dominant magnet
• Sell-Side Draw → untapped liquidity below is the dominant magnet
• Two-Sided → both sides are roughly balanced, with no single dominant draw
• No Draw → no qualifying untapped pool is currently in range
States describe liquidity context only. They are not trade instructions and carry no guarantee of direction.
🔔 Alerts Logic
Alerts are available for:
- Buy-Side Draw: the dominant draw establishes on the buy side with a qualifying score
- Sell-Side Draw: the dominant draw establishes on the sell side with a qualifying score
- Liquidity Pool Swept: a tracked pool is traded through
Alerts are attention markers that flag a change in liquidity context. They are not signals to enter or exit a position, and each alert should be interpreted within the broader market picture.
🧩 Confluence Logic
The draw score is itself a confluence measure. A high score means pool quality, proximity, directional context, and freshness are aligning on the same side. When the active draw also agrees with your higher-timeframe bias and the prevailing structure, the context is stronger. When they disagree, the read deserves more caution, and the score will usually reflect that with a lower value.
📊 When to Use
• Trending markets, where price tends to reach for liquidity in the direction of the trend
• Range edges, where equal highs or equal lows build obvious resting liquidity
• Charts with a clear prior-period high or low acting as a reference draw
• Planning phases, when defining a target and an invalidation before committing to a view
⚠️ When NOT to Use
• Very low-liquidity symbols or thin sessions, where swing structure is unreliable
• Extreme volatility events, where levels are torn through without reaction
• Very low timeframes dominated by noise, where pools form and break too quickly
• As a standalone entry trigger, with no regard for broader context
🎛️ Key Inputs
• Swing Strength → how strong a swing must be to become a pool
• Pool Memory → how many recent pools are retained
• Equal Level Tolerance → how loosely nearby levels merge into a cluster
• Use Prior-Period Pools → include the prior higher-timeframe high and low (day, week, or month by chart)
• Trend Backbone EMA and Slope → the directional context used in scoring
• Max Draw Distance → distance beyond which a pool is treated as too far to be an active draw
• Active Draw Score → minimum score for an emphasized, alert-eligible draw
• Two-Sided Balance Gap → score gap below which liquidity is treated as balanced
• Visual and panel settings → control zones, lines, labels, density, location, theme, and font size
🖥️ Interface & Visual Design
The interface is intentionally restrained. One dominant draw zone, one target line, one structural invalidation reference, a light pool map, and a single target tag keep the chart readable. Event labels alternate by side and point at the candle that produced them, so the chart reads as a clean sequence rather than a cluster. The panel carries the detailed read, and its first row is a single merged brand header. Panel location, theme, and font size are all adjustable, and the panel is shown by default for clarity.
🧪 Practical Usage Workflow
1. Read the panel: note the state and the draw score.
2. Locate the target: confirm the highlighted draw zone and the target line.
3. Check the invalidation: note the opposite-side structural reference.
4. Confirm context: compare with your higher-timeframe bias and structure before acting on any view.
🔍 Interpretation Guidelines
Treat the draw score as a measure of how clearly liquidity leans to one side, not as a probability of profit. A strong, aligned draw is context to plan around. A balanced or weak read is a reason to wait rather than to force a trade. Every output is meant to be interpreted inside the broader market picture, never in isolation.
🚫 What This Script Is NOT
- It is NOT a prediction engine.
- It is NOT financial advice.
- It is NOT an automated trading system.
- It does NOT generate guaranteed signals or outcomes.
⚠️ Limitations & Transparency
Liquidity context behaves differently across timeframes, symbols, and volatility regimes. Pools can be ignored, swept and reversed, or run through without reaction. Swing detection depends on the chosen settings, and prior-period references behave differently across symbols and session types. This tool organizes context and frames a decision; it does not guarantee how price will respond to any level.
🧠 Market Context Notes
Liquidity tends to rest where many participants place stops: above equal highs, below equal lows, and around prior-period extremes. Price often gravitates toward these areas, but the timing and the reaction are never certain. The structure and volatility around a pool shape how meaningful any reaction near it is likely to be, which is why the score blends proximity and trend context rather than distance alone.
🧾 Use Case Examples
• In an uptrend, the planner highlights a buy-side draw at a cluster of equal highs above price, with a recent swing low as the structural invalidation below and a score that reflects how aligned and how close that draw is.
• In a range, the planner shows two-sided liquidity, signaling that no single side is dominant and that patience is warranted until one side resolves.
• After a deep move, the prior-period high or low can become the dominant draw, giving a clear reference target while the invalidation marks where that lean would weaken.
🧱 System Philosophy
The AG Pro approach favors decision-support tools over raw indicators. Each script is built to answer a specific question, present a clean read, and respect the chart. Draw On Liquidity Planner reflects that philosophy by turning scattered liquidity into one structured draw decision with a transparent score and a defined invalidation.
🔐 Non-Promise Statement
This tool offers no guarantees and no certainty about future price movement. It is a structured way to read liquidity context and frame a plan, nothing more.
📉 Risk Disclosure
Trading involves substantial risk. This script is provided for educational and analytical purposes only and does not constitute financial advice. All trading decisions and their outcomes are solely the responsibility of the user.
📚 Educational Note
Use this planner to study how price interacts with resting liquidity over time. Watching which draws are respected, swept, or ignored on your own market and timeframe is a practical way to build liquidity-reading skill and a more structured trading process. Indicator

Pivot Breakout Retest Signals [algo_aakash]Overview
Pivot Breakout Retest Signals is a price action indicator that helps traders identify potential bullish and bearish retest opportunities around Classic Pivot Point levels.
The indicator calculates pivot levels from a selected higher timeframe (Daily, Weekly, or Monthly) and monitors price for breakout events followed by retests of those levels. When a valid retest is confirmed within the specified window, the script displays a Bullish or Bearish signal on the chart.
Features
• Classic Pivot Point calculation
• Daily, Weekly, or Monthly pivot timeframe selection
• Automatic breakout detection
• Retest confirmation logic
• Bullish and Bearish signal visualization
• Configurable retest window
• Alert support for signal events
How It Works
Bullish Conditions
1. Price breaks above a Pivot, R1, or R2 level.
2. The breakout is recorded.
3. Price retests the broken level within the user-defined retest window.
4. If price closes back above the level after the retest, a Bullish signal is generated.
Bearish Conditions
1. Price breaks below a Pivot, S1, or S2 level.
2. The breakdown is recorded.
3. Price retests the broken level within the user-defined retest window.
4. If price closes back below the level after the retest, a Bearish signal is generated.
Inputs
Pivot Timeframe
Select the timeframe used to calculate pivot levels:
• Daily
• Weekly
• Monthly
Retest Window
Determines how many candles are allowed between the breakout and the retest confirmation.
Alerts
The script includes built-in alert conditions:
• Bullish Alert
• Bearish Alert
Alerts can be used with PulseWire's notification system or connected to external workflows.
Notes
• Pivot levels are calculated using completed higher-timeframe data.
• Signals are generated only after both breakout and retest conditions are satisfied.
• The indicator is intended as an analytical tool and may be combined with other forms of technical analysis.
Limitations
• Signals can occur during ranging or volatile market conditions.
• Not every breakout or retest will lead to sustained price movement.
• Additional confirmation methods may be useful depending on the market and trading style. Indicator

Swellz Capital LevelsA single, uncluttered indicator that plots all the key levels futures and intraday traders actually watch — as clean right-side lines and labels
that never cut back through your candles.
What it plots
Previous Day
- PDH / PDL (previous day high & low)
- PDC — choose RTH cash close (16:00 ET), 24h Globex daily close, or both
Previous Week
- PWH / PWL
Sessions
- Asia / Globex high & low
- NY (RTH) session high & low
- Initial Balance high & low
Volume Profile (POC / VAH / VAL) for:
- NY session
- Current day
- Current week
- Previous week
Key features
- Clean presentation — every line and label is pushed to the right of price action, so nothing draws back across your candles. Adjustable gap,
line length, and width.
- Smart label stacking — when two levels share the same (or nearly the same) price, their labels automatically spread sideways so the text never
overlaps. Tolerance and spacing are adjustable.
- One-click master switches — toggle all key levels or all volume profile levels on/off with a single button, while keeping your individual
per-level choices intact.
- Accurate session resets — day/week boundaries follow the futures session (matching PulseWire's daily/weekly candles), so PDH/PDL etc. line up
with the levels you already see.
- Fully customizable — colors per group, label size, optional price-in-label, value-area %, and profile row size (in ticks).
How to use
- Best on an intraday timeframe (1m–15m). Lower timeframes give a more accurate volume profile.
- Set your timezone and session windows in the settings to match your instrument and trading style.
- Volume Profile is approximated from chart OHLCV (each bar's volume spread evenly across its high-low range) — very close to PulseWire's native
VP, though not identical. The symbol must have volume data.
- High/low levels update live; volume profile updates on each bar close.
Tuned with futures (NQ/MNQ, ES/MES, etc.) in mind, but works on any symbol with volume. Indicator

Indicator

Order Flow Asymmetry [JOAT]Order Flow Asymmetry
Introduction
Order Flow Asymmetry is an open-source synthetic institutional order flow indicator that tracks four independent measures of directional institutional activity — Volume-Weighted Momentum, Liquidity Vacuum detection, Microstructure Imbalance scoring, and a dynamic Information Ratio Band system — and classifies the current market into one of four regime states based on trend direction and volatility level. Smart money signals are generated only when regime, VWM direction, imbalance score, and the absence of a liquidity vacuum all align simultaneously.
The core thesis is that institutional participants leave statistical footprints in price and volume data that can be approximated without access to full order book data. When a large participant is absorbing supply, the result is: above-average volume, below-average price movement, high close-to-range ratio biased toward the institutional direction, and a cumulative imbalance in the bid-side proxy. Order Flow Asymmetry tracks these proxies simultaneously rather than relying on any single measure.
Core Concepts
1. Volume-Weighted Momentum (VWM)
VWM weights each bar's price change by its volume — large-volume bars contribute more to the running total than small-volume bars. The cumulative result is then normalized relative to the 20-bar average volume, producing a -50 to +50 reading:
float vwm = ta.cum(ta.change(close) * volume) / ta.ema(volume, 20)
float vwmNorm = (vwm - ta.lowest(vwm,100)) / math.max(ta.highest(vwm,100) - ta.lowest(vwm,100), 1e-9) * 100 - 50
A crossover of zero in either direction is the primary momentum signal.
2. Liquidity Vacuum Detection
A liquidity vacuum occurs when volume collapses below two standard deviations of its 50-bar mean while price moves more than one ATR in the same bar. This pattern indicates a move through a region with no counterparty liquidity — a potential institutional trap. Vacuum bars are marked with three-layer glow boxes and treated as signal inhibitors.
3. Microstructure Imbalance Score
A bar-level bid/ask proxy is computed from close position within the high-low range. Bars closing in the upper half of their range contribute positive imbalance; bars closing in the lower half contribute negative. A 93% decay factor is applied each bar, producing a running imbalance score that emphasizes recent activity while retaining historical context.
4. Four-State Regime Classification
The regime is determined by two binary conditions: ADX above threshold (trending vs. ranging) and ATR ratio above threshold (high vs. low volatility). This produces four states: Trend Bull, Trend Bear, Range High-Vol, Range Low-Vol. Each state receives a distinct background tint. Smart money signals require a Trend state — signals in Range states are suppressed.
5. Information Ratio Bands
Standard deviation bands are computed from the MIDAS VWAP. The band width multiplier is dynamically set by the rolling Sharpe ratio estimate of recent returns — periods with higher risk-adjusted returns produce narrower bands, while periods with lower Sharpe ratios produce wider bands.
float sharpe = ta.ema(ret20, 20) / math.max(ta.stdev(ret20, 20), 1e-8)
float kFactor = math.max(0.5, math.min(3.0, math.abs(sharpe) * 2))
Features
Volume-Weighted Momentum: Cumulative volume-weighted price change normalized to -50/+50 range
Institutional VWAP center line: Thick reference line showing the cumulative volume-weighted average price anchor — the central institutional value reference
VWM gradient fill zones: Bull zone fills between VWAP and upper VWM level in bull theme color; bear zone fills between VWAP and lower VWM level in bear theme color — intensity reflects VWM magnitude
IR Band gradient fill: Subtle gradient fill between upper and lower Information Ratio bands shows the full Sharpe-adjusted deviation range
Regime transition markers: Every regime change draws a vertical dotted line plus a direction label (▲ TrendBull / ▼ TrendBear / ◆ RngHVol / ◇ RngLVol) — institutional regime context at a glance
Absorption / Distribution labels: "Absorption" label when cumulative microstructure imbalance score exceeds extreme threshold; "Distribution" label when it falls below. Identifies potential institutional accumulation/distribution zones
Smart money signal markers: "▲ SMART LONG" / "▼ SMART SHORT" labels with embedded VWM and Imbalance values, plus a vertical dotted line through each signal bar for visual alignment
Liquidity vacuum detection: Volume collapse + ATR-relative move identifies institutional trap zones with 3-layer glow visualization and "Vacuum" text label
Microstructure imbalance score: Decaying cumulative bid/ask proxy normalized by ATR, displayed in dashboard
Four-state regime classification: Trend Bull / Trend Bear / Range High-Vol / Range Low-Vol from ADX and ATR ratio — distinct background tints for each state
Information Ratio Bands: VWAP deviation bands with width dynamically set by rolling Sharpe estimate
Gradient candle coloring by VWM: Bar colors reflect normalized VWM intensity using color.from_gradient() when VWM exceeds threshold in trend direction
Three-layer glow candles (optional): Institutional-style neon glow candle effect
12-row institutional dashboard: Regime, VWM, vacuum state, imbalance score, Sharpe k-factor, IR band levels, signal, win rate, and performance stats
Four color themes: Phantom, Neon, Classic, Solar
Non-repainting: All signals gated by barstate.isconfirmed; all inputs are historical only
Input Parameters
Volume-Weighted Momentum:
Volume Average Length (default: 20)
VWM Cross Threshold (default: 5.0)
Liquidity Vacuum:
Volume Mean Length, Sigma Below Mean, Vacuum Zone Width, Glow Strength
Microstructure Imbalance:
Imbalance Decay Factor (default: 0.93)
Imbalance Signal Gate (default: 15.0)
Regime Classification:
ADX Trend Threshold (default: 25)
ATR Ratio High-Vol Threshold (default: 1.2)
Information Ratio Bands:
Show IR Bands toggle
Sharpe Window (default: 20)
Signal:
Cooldown Bars, TP ATR Multiple, SL ATR Multiple, Show Trade Block, Block Width
How to Use This Indicator
Step 1: Identify the Regime
Check the dashboard Regime row. Smart money signals only fire in Trend Bull or Trend Bear states. During Range states, no signals are generated regardless of VWM direction.
Step 2: Watch for VWM Zero Cross
The VWM crossing zero in the direction of the trend regime is the primary trigger. Ensure no vacuum is active on the signal bar — vacuum bars inhibit signals because they represent suspect moves without genuine counterparty support.
Step 3: Check Imbalance Score
The imbalance score reflects cumulative directional bias in bid/ask proxy. A score above the gate threshold in the trend direction adds confidence. A score contradicting the trend direction is a warning.
Step 4: Use IR Bands as Dynamic Reference
The Information Ratio bands widen in low-Sharpe environments (price distributing far from VWAP) and narrow in high-Sharpe environments (price efficiently priced near VWAP). These bands serve as dynamic reference levels rather than fixed targets.
Indicator Limitations
VWM uses tick volume as a proxy for institutional participation. On forex spot and some crypto venues, tick volume may not accurately represent actual participation
The microstructure imbalance score uses bar close position as a bid/ask proxy. This is an approximation — actual bid-ask data is not available in standard PulseWire data
Regime classification uses ADX and ATR ratio, both of which lag price. A trend beginning explosively will be classified as ranging for several bars until indicators respond
The Information Ratio Band width is driven by a 20-bar Sharpe estimate, which is an extremely short window for a reliable Sharpe computation. It should be interpreted as a dynamic band-width scaler rather than a statistically significant Sharpe ratio
Smart money signals are rare by design — the four-condition gate produces low-frequency output
Originality Statement
The combination of Volume-Weighted Momentum, Liquidity Vacuum detection as a signal inhibitor, a decaying Microstructure Imbalance score, and Information Ratio Bands with Sharpe-driven width — all gated by a four-state regime classification — is an original analytical architecture not replicated in existing open-source Pine Script v6 publications
Treating liquidity vacuums as signal inhibitors rather than signals themselves — suppressing momentum signals that occur immediately after a volume-collapse move — is a novel application of vacuum detection logic
Dynamic VWAP deviation band width driven by a rolling Sharpe ratio estimate rather than a fixed multiplier provides adaptive band boundaries that reflect the current efficiency of price relative to VWAP
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice. Trading involves substantial risk of loss. Synthetic order flow measures are approximations that use publicly available price and volume data as proxies for actual institutional activity. Past signal performance does not predict future results. The author accepts no responsibility for trading losses resulting from use of this indicator.
Made with passion by jackofalltrades
Indicator

Trade Execution Desk [JOAT]Trade Execution Desk is an open-source trade planning and session management tool designed for futures and structured discretionary traders who operate under daily loss limits, risk tier constraints, and session performance targets. It combines position sizing from account parameters, automatic pivot-based stop detection, three take-profit levels with risk-reward boxes, a 10-trade manual session log, and session status tracking into a single indicator.
The problem this addresses is the gap between an indicator that shows signals and a tool that translates those signals into an actual trade plan. Trade Execution Desk does not generate signals — it helps the trader structure the trade after a signal has been identified, ensuring that position size, stop placement, and profit targets are consistent with the account's defined risk parameters before the order is placed.
Core Concepts
1. Risk-Based Position Sizing
Position size is computed from the daily loss limit, maximum risk percentage, risk tier multiplier, and the calculated stop distance in ticks:
tierMult = tier == "FULL" ? 1.0 : tier == "HALF" ? 0.5 : 0.25
riskAmount = (dailyLossLimit * maxRiskPct / 100.0) * tierMult
contractsAllowed = math.floor(riskAmount / (stopDistTicks * tickValue))
This produces a contracts-allowed figure that respects the current risk tier and the actual stop distance on the current setup.
2. Three Risk Tiers
The FULL tier allows the full calculated position size. The HALF tier reduces it by 50%. The QUARTER tier reduces by 75%. Tier selection reflects the trader's confidence level or account drawdown state.
3. Auto Pivot Stop Detection
When auto stop is enabled, the indicator detects the most recent confirmed pivot high (for short trades) or pivot low (for long trades) and places the stop price at that level plus a configurable tick buffer. This anchors the stop to the nearest structural level automatically.
4. Trade Block Visualization
Entry, stop, and three TP levels are plotted as horizontal lines with right-edge labels. The risk zone (entry to stop) is shown as a translucent red box; the reward zone (entry to TP1) as translucent green. All objects extend rightward in real time.
5. Session Management
Four session-end conditions are tracked: daily target reached, maximum trade count reached, maximum loss count reached, and account rule violation. When any condition triggers, a session lockout overlay is displayed on the chart as a visual reminder that session trading is complete.
6. Manual Trade Log
Ten trade entries can be logged manually with tier type and result. Results are converted to the selected unit (points, ticks, dollars, or percent of account). Sequential processing chains each entry's outcome into running totals for session P&L, trade count, loss count, and violation flag. A promotion threshold tracks whether the session meets the criteria to advance to the next risk tier.
Features
Risk-based position sizing: Contracts calculated from loss limit, risk percent, tier multiplier, and actual stop distance
Three risk tiers: FULL / HALF / QUARTER with independent position size scaling
Auto pivot stop detection: Nearest confirmed pivot placed as stop with configurable tick buffer
Three TP levels with gradient boxes: TP1, TP2, TP3 as horizontal lines with translucent colored boxes
Session status tracking: Target, max trades, max losses, and violation triggers with visual lockout overlay
Ten-entry manual trade log: Each entry processed with tier, result, and unit conversion
Promotion threshold: Tracks whether session performance meets the criteria to advance risk tier
Unit conversion: All results displayable in Points, Ticks, Dollar, or Percent
Session lockout overlay: Full-chart colored overlay when session ends, with reason displayed
17-row institutional dashboard: Account params, tier state, stop/entry/TP levels, session status, trade log summary, promotion progress
Non-repainting: All pivot detections use confirmed pivot functions with symmetric lookback
Input Parameters
Risk Parameters:
Account Size ($), Daily Loss Limit ($), Max Risk % Per Trade
Tick Value ($), Ticks Per Point
Daily Target ($), Max Trades Per Session, Max Losses Per Session
Risk Tier and Carryover:
Current Risk Tier: FULL / HALF / QUARTER
Carryover Deficit ($), Quarter Violation Active toggle, Quarter Extra Deficit ($)
Trade Planning:
Trade Direction: Long / Short
Enable Auto-Pivot Stop toggle, Pivot Left/Right Bars, Stop Buffer (Ticks)
Manual Stop Price (0 = use auto)
RR Levels:
Show TP1, TP2, TP3 toggles with RR multiples and colors
Risk Zone and Reward Zone toggles
Result Unit: Points / Ticks / Dollar / Percent
Trade Log:
10 trade entries: Tier selector + Result value per entry
How to Use This Indicator
Step 1: Configure Account Parameters
Set your account size, daily loss limit, tick value, and ticks per point to match your trading instrument. Set the daily target and maximum trades/losses for your session rules.
Step 2: Select Risk Tier
Choose FULL, HALF, or QUARTER based on your current account standing or confidence level. The contracts-allowed figure in the dashboard updates automatically.
Step 3: Read the Entry/Stop/TP Levels
After identifying a trade direction, the auto-pivot stop places your stop at the nearest confirmed structural level. TP1, TP2, and TP3 are calculated automatically based on the stop distance and your configured RR multiples.
Step 4: Log Trades Manually
After each trade, enter the tier and result in the trade log section. The dashboard updates session P&L, win rate, and promotion progress in real time.
Step 5: Respect the Session Lockout
When the session lockout overlay appears, the reason is displayed prominently on the chart. The lockout is a visual reminder only — it does not interact with your broker.
Indicator Limitations
Position sizing uses tick value and ticks-per-point inputs specific to the traded instrument. These must be configured correctly for the output to be meaningful
The session lockout overlay is a visual reminder only. It does not block order placement
The manual trade log requires manual input after each trade. It does not auto-detect executions
Promotion threshold calculation uses simple arithmetic from input values and may not account for all possible rule variations across different prop firm structures
This indicator is a planning and logging tool. It does not generate entry or exit signals
Originality Statement
The combination of risk-tier-aware position sizing, session-end condition tracking with visual chart lockout, a 10-entry chained trade log with unit conversion, and a promotion threshold tracker in a single open-source overlay indicator is not replicated in existing Pine Script v6 publications
The sequential chaining of manual trade log entries through a processing function that propagates trade count, loss count, running P&L, and violation flag forward through ten entries provides structured session accounting within a chart indicator
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice. Position sizing outputs are mathematical calculations based on user-provided inputs and do not account for all real-world trade execution factors. Always verify position sizes and risk parameters independently before placing orders. The author accepts no responsibility for trading losses resulting from use of this indicator.
Made with passion by jackofalltrades
Indicator

Indicator

Parallel Transport & Holonomy [DAFE]Parallel Transport & Holonomy - (⟡ PTH)
This publication presents the quantitative mechanics and theoretical architecture behind the Parallel Transport & Holonomy engine. This system models price and volume dynamics as trajectories on a continuous two-dimensional manifold. By computing the parallel transport of multi-scale momentum vectors, tracking their covariant derivatives, and integrating their path-dependent rotational deficit ( Holonomy ), the indicator identifies macro regime shifts, structural pivots, and trend continuations.
The architecture is entirely self-contained, featuring a Legit Footprint Toggle that automatically falls back to an advanced Synthetic Footprint Engine when tick-level footprint data is unavailable. It is strictly anchored by a Rolling Confidence Matrix (RCM) and modulated by an Ensemble Dynamic Volatility Scaling (DVS) engine.
The core principle of this system is geometric invariance: signal evaluation is not based on static, lagging thresholds but on the coordinate-invariant deviation of momentum from its natural geodesic path.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Riemannian Price-Volume Manifold & Metric Tensor
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
We define the market state as a coordinate point on a two-dimensional Riemannian manifold
M, where the coordinates are:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Parallel Transport & Covariant Derivatives
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Let V be a momentum vector on the tangent space of the manifold, constructed at three distinct temporal scales: Fast (vecFast), Medium (vecMed), and Slow (vecSlow). The coordinate components of the vector scale k are computed as:
Geodesic Deviation
A path is geodesic if its covariant derivative along the direction of travel is zero (representing the path of least resistance on the manifold). We define the geodesic deviation Zgeodesic as the rolling z-score of the absolute transport deviation:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Holonomy & Phase Accumulation
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Holonomy describes the geometric phenomenon where parallel transporting a vector along a closed loop returns a vector with a changed orientation. This angular deficit directly measures the total curvature enclosed by the loop.
Holonomy Group Classifications
Based on the magnitude of the accumulated rotation (HolonomyNorm), the local coordinate space is classified into four geometric groups:
Trivial (Norm<0.10): The manifold is flat; parallel transport is path-independent, indicating quiet consolidated ranges.
Abelian (Norm<0.25): Minor commutative drift; the vector field undergoes predictable linear shifts.
Non-Abelian (Norm<0.50): Significant non-commutative curvature. Parallel transport is highly path-dependent, signaling complex trend development and institutional accumulation.
Singular (Norm≥0.50): Severe rotational deficit. The manifold geometry has collapsed or rotated sharply, marking high-probability reversal peaks and structural transitions.
Holonomy Regime Shifts
A Regime Shift is triggered when HolonomyNorm exceeds the user-defined threshold (i_holoThresh). Depending on the sign of the accumulated loop (sgn(H)) and the divergence between the fast and slow vectors, the engine classifies the transition into one of the following states:
Bull Rotation : Enclosed path yields a positive rotational deficit combined with positive multi-scale momentum.
Bear Rotation : Enclosed path yields a negative rotational deficit combined with negative multi-scale momentum.
Geodesic Break : Extreme localized acceleration causing the momentum field to tear away from its expected trajectory.
Scale Divergence : High-frequency (fast) and low-frequency (slow) vectors rotate in opposite directions, enclosing a singular point.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Rolling Confidence Matrix (RCM)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The Rolling Confidence Matrix (RCM) acts as a structural anchor. It takes multi-scale geometric indicators from the transport engine and compiles them into a state-space model that dynamically controls signal permissions.
State Space Representation
The matrix maintains a rolling assessment of market structure across three distinct states:
Established (State 0): The trend is structurally intact; manifold bands are compressed, and parallel transport confirms high directional persistence.
Transition (State 1): Price is approaching key structural levels or experiencing a holonomy spike. Manifold bands widen, and standard signals are gated.
Damaged (State 2): Price has broken through primary defensive corridors. Structural confidence is compromised; bands expand by the Damage Band Expansion multiplier
(i_damageWiden), and counter-trend positions are heavily penalized.
External Evidence Injection
On every bar, the system injects external geometric parameters from the manifold:
This evidence is integrated into the RCM, outputting structural permissions (allowLong, allowShort) and score modulations that are applied to the final signal scoring calculations.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Ensemble Dynamic Volatility Scaling (DVS)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
To adapt the mathematical models to varying market volatility, the script runs three independent volatility estimators concurrently on every bar:
Ensemble Combinatorics
The baseline values are calculated as moving averages over the memory period. The script then computes the ratios of the current estimators to their historical baselines:
This ratio dynamically scales the width of the holographic manifold bands and the RCM damage thresholds: during highly volatile regimes, thresholds are expanded to prevent whipsaws; during compression regimes, thresholds are tightened to capture early breakouts.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Footprint & Synthetic Fallback Engine
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The script includes a Use Legit Footprint toggle (i_useFp). When enabled on charts supporting tick databases, the system requests official exchange-traded order flow data:
fp=request.footprint(i_fpTicks,i_fpVA)
The Advanced Synthetic Footprint Engine
If the user deactivates the footprint toggle, or if the asset/timeframe does not support tick database access (e.g., historical bars or Forex), the Synthetic Footprint Fallback Engine** takes over, simulating volume-at-price and directional delta using high-frequency mathematical approximations:
This estimated delta reconstructs the synthetic buy and sell pressures:
Kyle's Lambda (Price Impact & Liquidity Risk)
Using these directional volumes, we calculate Kyle's price impact coefficient λ, measuring the price change per unit of volume flow:
High values of λ represent illiquid, thin, or toxic conditions. The system calculates the z-score of lambda (Zλ). If Zλ > 2.0, signal scores are dynamically penalized to protect capital from low-liquidity slippage.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Structural Scoring & Signal Gating
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The system generates a directional Signal Score using a two-tier quantitative scoring process.
Stage 1: Structural Base (Minimum of one required)
Siege Corridor Proximity : Price is within 1.2 ⋅ ATR of a verified support or resistance level.
ScoreBase = 0.28+(Hold Probability⋅0.18)
EMA21 Geodesic Pullback : Price pulls back to the EMA21 in trend alignment.
ScoreBase = 0.25
RSI Extreme Exhaustion : RSI is below 25 (for longs) or above 75 (for shorts).
ScoreBase = 0.28
Stage 2: Confirmations (Additive)
Multi-pattern confluence (2+ patterns matching): +0.15
Pressure bar strength exceeds thresholds: +0.08 to +0.15
Metric curvature aligns with structural turn: +0.10
Volume expansion exceeds historical average: +0.10
Holonomy phase shifts or loop spikes: +0.12
Directional Scaling & Gating
The score is adjusted based on trend alignment. With-Trend (WT) setups (longs above the EMA50, shorts below) are evaluated using standard thresholds. Counter-Trend (CT) setups face a strict scaling penalty:
ScoreCT = ScoreRaw ⋅ clamp(1.0−Trend Strength⋅0.15,0.45,1.0)
Additionally, the score passes through three gates:
Liquidity Penalty : Reduced by up to 30% if order flow thickness is classified as Desert or Frozen.
Kyle Lambda Gate : Penalized if price impact is highly volatile (Zλ > 2.0).
Danger Gate : Score is multiplied by 0.60 if the composite risk danger index exceeds 75.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Input Reference
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
═══ GEOMETRY ENGINE ═══
Hurst Period (30 to 200, default 80): Lookback window for R/S calculations to evaluate trend persistence.
Pivot Length (2 to 15, default 5): Lookback/lookahead buffer for swing pivot detection.
TF Preset (Auto, 1m-5m Scalp, 10m-15m Intra, 30m-1H Swing, 4H-D Position): Set the timeframe scaling preset. Auto dynamically scales lookbacks based on the current chart timeframe.
Use Legit Footprint (Boolean, default true): Toggles whether to query exchange tick database for real footprint data.
Footprint Ticks/Row (1 to 500, default 100): Height of the footprint rows in tick units.
Footprint VA % (50 to 90, default 70): Percentage of volume enclosed within the Value Area.
═══ TRANSPORT & HOLONOMY ═══
Vector Fast Scale (3 to 21, default 8): Periods for tracking short-term momentum vectors.
Vector Medium Scale (10 to 55, default 21): Periods for intermediate momentum geometry.
Vector Slow Scale (21 to 144, default 55): Baseline vector window representing the macro manifold.
Holonomy Window (13 to 89, default 34): Size of the temporal loop used to integrate local deviations.
Holonomy Spike Threshold (0.10 to 0.90, default 0.35): Sensitivity threshold for identifying rotational shifts.
Geodesic Deviation Sensitivity (0.5 to 3.0, default 1.5): Sensitivity for flagging off-path momentum.
Enable Continuation Signals (Boolean, default true): Toggles secondary pullback entries in strong trends.
═══ ROLLING CONFIDENCE MATRIX ═══
Block Transition Signals (Boolean, default true): If active, blocks standard entry signals when the matrix is in transition state.
Conf Band Tightening Factor (0.0 to 1.0, default 0.35): Compression multiplier for manifold bands under high confidence.
Damage Band Expansion (1.0 to 1.5, default 1.15): Expansion multiplier for manifold bands under structural damage.
═══ DYNAMIC VOLATILITY SCALING (DVS) ═══
Enable Ensemble DVS Engine (Boolean, default true): Toggles whether to scale target multiples and thresholds by volatility.
DVS Method (ATR Ratio, Parkinson, Garman-Klass, Ensemble): Method for calculating real-time volatility.
DVS Memory Period (20 to 200, default 100): Baseline lookback window for historical volatility.
DVS Sensitivity (0.3 to 1.5, default 0.7): Exponent scaling parameter for the DVS ratio.
═══ SIGNAL GATING ═══
Signal Threshold (0.10 to 0.85, default 0.40): Minimum score required to fire a signal.
Cooldown Bars (1 to 50, default 6): Minimum bar spacing between consecutive signals.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Visual System & Dashboard Interpretation
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Transport Field Manifold : A multi-layered band surrounding price. It contracts during clean, high-confidence geodesic flow and expands during high-entropy, damaged, or volatile regimes. Its color is determined by the RCM state: Green for bullish stability, Red for bearish, and Purple during transitions.
Siege Corridors : Plotted as horizontal support (Green) and resistance (Red) zones with an ATR-scaled boundary. At the right-hand side of the chart, these corridors display critical metrics: the total historical hit count, the estimated break probability (Pbreak), and the fail/reversal probability (Pfail).
Vector Field Lines : Small arrow-headed lines plotted on every third bar. They show the mathematical direction of the Fast momentum vector. They visually represent the difference between the actual observed path of the market and the expected parallel-transported baseline.
Holonomy Phase Ring : An indicator plotted at the right edge of the chart displaying the current phase angle (e.g., ◐ 144∘).
Glitch Markers: Flagged on the chart as ◈ GLITCH when anomalous pricing data or sudden coordinate jumps are detected on the manifold.
Dashboard: Displays real-time metric readings from all quantitative modules:
Tensor Metrics: Curvature, Entropy, Hurst Exponent, and Price Pressure.
Volatility: Dynamic DVS Ratio, active estimator method, and scaling state.
RCM Brain: State classification, integrity index, and gate permissions.
Performance: Total trades, win rate, total profit (R-multiple), profit factor, and max drawdown.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Limitations and Disclaimers
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
This tool is for analytical purposes only and does not predict future market direction.
Historical Simulation: The built-in simulator represents hypothetical performance on historical data. Past results do not guarantee future performance.
Volume Approximations: The synthetic footprint engine uses OHLCV approximations to estimate volume-at-price and directional delta. It is not an actual connection to L2 exchange data feeds or a central clearing book.
Persistence: Reinforcement learning weights are state-space variables that exist within the local execution thread; they reset to 1.0 on every chart load or browser reload.
— Dskyz. Trade with insight. Trade with anticipation. (It's lonely at the top) Indicator

Indicator

MS & RSI Divergences [invincible3]MS & RSI Divergences
MS & RSI Divergences is a market-structure-based trading tool designed to identify key swing highs, swing lows, RSI regular divergences, and swing-based volume profile zones directly on the main chart.
This indicator combines price action structure, momentum divergence, and volume distribution into one visual framework, helping traders analyze whether price movement is supported or weakened by momentum and volume.
The script detects confirmed pivot highs and lows using user-defined left and right lookback bars, then classifies each swing as:
HH — Higher High
LH — Lower High
HL — Higher Low
LL — Lower Low
It also draws a dotted ZigZag between confirmed swings, making the overall market structure easier to read. The active swing is dynamically updated, so if another stronger high or lower low appears before the opposite pivot forms, the script keeps only the strongest valid swing. This helps reduce duplicate or weak swing labels and keeps the chart cleaner.
Key Features
1. Market Structure Detection
The indicator automatically identifies major swing points and labels them as HH, LH, HL, or LL. This helps traders quickly understand whether the market is forming bullish continuation, bearish continuation, or possible reversal structure.
A sequence of HH + HL usually reflects bullish structure, while LH + LL usually reflects bearish structure.
2. RSI Regular Divergence
The indicator uses RSI to detect regular divergences at confirmed swing points.
A bearish divergence is detected when price forms a higher high, but RSI forms a lower high. This can suggest weakening bullish momentum.
A bullish divergence is detected when price forms a lower low, but RSI forms a higher low. This can suggest weakening bearish momentum.
Divergence lines are drawn directly on price, with a “D” label marking the divergence area.
3. Swing Volume Profile
For each completed swing leg, the indicator can draw a volume profile between the previous swing and the current swing.
This shows where the most trading activity occurred inside that swing range. The profile also includes a dashed POC line, which represents the price level with the highest volume concentration inside the swing.
This can help identify important reaction zones, support/resistance areas, and volume-based decision levels.
4. Leg Statistics
The indicator can display swing-leg statistics, including:
Total leg volume
Volume delta approximation
POC price
The delta is estimated using candle direction, where bullish candles contribute positive volume and bearish candles contribute negative volume.
Main Settings
Market Structure Settings
Left Bars Lookback controls how many bars are checked on the left side of a pivot.
Right Bars Lookback controls how many bars are required after a pivot before it is confirmed.
Show MS Labels enables or disables HH, LH, HL, and LL labels.
Show Dotted ZigZag enables or disables the dotted swing connection line.
RSI Divergence Settings
Show Regular Divergences enables or disables RSI divergence detection.
RSI Length controls the RSI calculation period.
You can also customize bullish and bearish divergence colors.
Swing Volume Profile Settings
Show Swing Volume Profiles enables or disables the volume profile for each swing.
Profile Granularity controls the number of volume rows.
Profile Width controls how far the profile extends to the right.
Show Leg Stats displays volume, delta, and POC information.
Background Transparency controls the visibility of the profile background box.
How to Use
Use the market structure labels to understand the current trend direction.
Use RSI divergence signals near HH, LH, HL, or LL areas to detect possible momentum weakness.
Use the swing volume profile and POC line to find price zones where volume was concentrated.
For stronger confirmation, combine this indicator with support/resistance, trendlines, higher-timeframe bias, or your own trading system.
Important Notes
This indicator uses pivot-based logic, so swing labels appear only after the required right-side confirmation bars have closed.
The active swing can update until the opposite swing is confirmed. This is intentional because the script keeps the strongest high or lowest low before a new opposite pivot appears.
This tool is designed for analysis and decision support. It should not be used alone as a buy or sell signal.
Best Used For
Price action analysis
Market structure reading
RSI divergence detection
Swing trading
Trend reversal analysis
Support and resistance confirmation
Volume profile-based swing analysis
Disclaimer
This indicator is for educational and analytical purposes only. It does not guarantee future price movement. Always use proper risk management and confirm signals with your own trading strategy before making trading decisions. Indicator

Indicator

CostaAlgo Horizontal LinesCostaAlgo Horizontal Lines – The Only Level Tool You'll Ever Need.
Stop wasting time drawing lines manually. This tool snaps clean horizontal levels across your entire chart in seconds. Set your start price, set your step, done. Every level perfectly spaced. Every time.
What it does:
Price levels automatically placed from your chosen starting point, spaced exactly how you want. Trading Gold at 4500 with 25-point steps? Done. BTC at 65000 with 250-point steps? One click. NQ, Forex, Crypto, Futures — any market, any spacing, any timeframe.
What you can customize:
Start price — your anchor
Step size — your spacing
Number of lines — 1 to 100
Color — whatever you want
Thickness — thin to bold
Style — Solid, Dashed or Dotted
Labels on/off — clean or detailed, your choice
Why it's different:
No clutter. No complexity. Just pure, clean levels that actually mean something. Switch from Gold to BTC? Change two numbers and you're set. It adapts to YOU, not the other way around.
This is the tool professional traders wish they had years ago.
Simple enough for beginners. Powerful enough for pros. Free for everyone.
Add it once. Use it forever.
CostaAlgo Horizontal Lines. Built different. Indicator

CostaAlgo Horizontal LinesCostaAlgo Horizontal Lines – The Only Level Tool You'll Ever Need.
Stop wasting time drawing lines manually. This tool snaps clean horizontal levels across your entire chart in seconds. Set your start price, set your step, done. Every level perfectly spaced. Every time.
What it does:
Price levels automatically placed from your chosen starting point, spaced exactly how you want. Trading Gold at 4500 with 25-point steps? Done. BTC at 65000 with 250-point steps? One click. NQ, Forex, Crypto, Futures — any market, any spacing, any timeframe.
What you can customize:
Start price — your anchor
Step size — your spacing
Number of lines — 1 to 100
Color — whatever you want
Thickness — thin to bold
Style — Solid, Dashed or Dotted
Labels on/off — clean or detailed, your choice
Why it's different:
No clutter. No complexity. Just pure, clean levels that actually mean something. Switch from Gold to BTC? Change two numbers and you're set. It adapts to YOU, not the other way around.
This is the tool professional traders wish they had years ago.
Simple enough for beginners. Powerful enough for pros. Free for everyone.
Add it once. Use it forever.
CostaAlgo Horizontal Lines. Built different. Indicator

Meridian Flow [WillyAlgoTrader]🧭 Meridian Flow is an overlay Smart-Money toolkit that reads market structure the way an institutional trader does — detecting confirmed swing points, classifying every break as a BOS (trend continuation) or a CHoCH (trend reversal), drawing the order block each break leaves behind, and then turning that signal into a complete trade plan with ATR-based stop-loss, three take-profits, automatic break-even, and a live performance dashboard — all on one chart, with zero manual drawing.
The core idea: most "SMC" tools just paint boxes and labels and leave you to figure out the rest. Meridian Flow closes the loop. It does not stop at "here is a break" — it answers where to enter, where the stop goes, where the targets are, when to move to break-even, and how the setup has performed . Structure detection, order-block tracking, a higher-timeframe bias filter, a full risk engine, a structure-anchored trend line, and a sectioned dashboard are wired into a single pipeline so each part feeds the next.
It works on any market and any timeframe — forex, crypto, stocks, indices, futures — because every component is built from price action and ATR, not from instrument-specific assumptions.
🧩 WHY THESE COMPONENTS WORK TOGETHER
A raw BOS/CHoCH labeler tells you structure broke, but not whether to trust the break, where the institutional zone is, or how to manage risk once you're in. An order-block tool draws zones but has no concept of trade management. A risk calculator needs an entry it can't generate on its own. Used separately, you're constantly stitching three or four tools together by hand.
Meridian Flow fuses them into one chain:
Confirmed swing detection → HH/HL/LH/LL classification → BOS / CHoCH break engine → HTF bias filter → Order-block creation + mitigation tracking → ATR risk model (SL / TP1-3 / break-even) → Structure-anchored ATR trend line → Live stats & form dashboard → Alerts
The swing engine finds confirmed pivots. Classification tells you whether each new swing extends or contradicts the prior one. The break engine reads the running structure state to decide BOS vs CHoCH — the same state then sets the direction of the trailing trend line, so the line and the labels never disagree. Each qualifying break spawns the order block that produced the move and tracks it until price mitigates it. The HTF filter vetoes breaks that fight the higher timeframe. The risk engine takes the surviving signal and immediately builds entry, stop, and three targets sized in ATR and R-multiples. The dashboard records the outcome and feeds it back to you as a win rate and a recent-form strip.
Without structure classification you can't separate continuations from reversals. Without the running-state logic, BOS and CHoCH blur together. Without order blocks you lose the institutional zone. Without the HTF filter you take every counter-trend poke. Without the risk model a signal is just an arrow. The combination is what turns "structure broke" into a managed, reviewable trade.
🔍 WHAT MAKES IT ORIGINAL
1️⃣ Confirmed swing engine with automatic HH / HL / LH / LL labeling.
Swings are found with symmetric pivots — equal left/right lookback (default Swing Length 13 ) — so a pivot is only confirmed once enough bars have closed on both sides. Each new high is labeled:
— isHH = (no previous high) OR (pivotHigh >= previousHigh)
— otherwise it is an LH
Each new low is labeled:
— isLL = (no previous low) OR (pivotLow <= previousLow)
— otherwise it is an HL
This gives you an objective, repeatable map of structure instead of subjective lines.
2️⃣ BOS vs CHoCH disambiguation via a running structure-state machine.
The indicator keeps an internal trend state (structTrend = +1 bull, −1 bear, 0 neutral). When a swing high breaks, it reads that state:
— bull break while structTrend >= 0 → BOS ▲ (continuation)
— bull break while structTrend < 0 → CHoCH ▲ (reversal up)
The mirror logic applies to bear breaks. This is why the same break can be a BOS in one context and a CHoCH in another — the label reflects the trend you were already in, not just the candle that broke.
3️⃣ Conflict suppression + warmup guard.
If a bull break and a bear break would register on the very same bar, the bar is flagged a conflict and both are suppressed — no contradictory signals. On top of that, no signal fires until the chart has warmed up:
— WARMUP_BARS = max(Swing Length × 2, 50)
Early-history noise, where pivots aren't yet reliable, is filtered out before a single arrow prints.
4️⃣ Order blocks tied to the break, with displacement detection and an arm→mitigate lifecycle.
When a break creates an OB, the engine scans back up to OB Lookback (default 30) bars for the last opposite candle (for a bullish OB: the last down candle, close < open) and prefers one that was followed by a displacement move out of its range. If no displacement is found, it falls back to the nearest opposite candle.
Every box then runs a lifecycle:
— Armed : price first closes beyond the zone (confirming the OB worked)
— Mitigated : price later returns into the zone (by wick or close, your choice), committed on bar close
Mitigated blocks fade to grey and freeze, or can be removed entirely. The box cap ( Max Order Blocks, default 8 ) always drops mitigated zones first, so live zones stay on the chart longest.
5️⃣ Non-repainting higher-timeframe bias filter.
An EMA (default 50 ) is computed on a higher timeframe (default 60-minute ) and read with a one-bar offset on confirmed values:
— Bullish bias when close >= HTF EMA
— Bearish bias when close <= HTF EMA
When the filter is on, longs are only allowed in a bullish HTF regime and shorts only in a bearish one. Because the HTF value is taken from the already-closed higher-timeframe bar, it does not repaint.
6️⃣ Preset-driven ATR risk model — entry, stop, and three targets in one shot.
Stop distance is volatility-scaled, and targets are placed as multiples of that risk (R):
— slDistance = ATR(SL length, default 13) × SL multiplier
— SL = entry ∓ slDistance
— TP1/TP2/TP3 = entry ± slDistance × (TP1/TP2/TP3 multiplier)
One click selects a full profile (SL ×ATR / TP1 / TP2 / TP3 in R):
— Conservative : 2.5 / 1R / 2R / 4R
— Balanced : 1.5 / 1R / 2R / 3R
— Aggressive : 1.0 / 1.5R / 2.5R / 4R
— Scalping : 0.8 / 0.8R / 1.5R / 2R
— Custom : set every multiplier by hand
Only one position at a time is tracked — no pyramiding, no overlapping clutter.
7️⃣ Break-even-after-TP1 with WIN-on-TP1 accounting.
When TP1 is first touched and break-even is enabled, the stop is moved to the entry price. From the next bar, any wick back to entry closes the trade at break-even — locking out the give-back loss. Crucially, a trade counts as a WIN the moment TP1 is touched , even if it later comes back to the break-even stop. This keeps the win-rate honest about partial profit-taking.
8️⃣ Structure-anchored ATR trend line (SuperTrend-style, but it flips on CHoCH).
A smoothed ATR band trails price, but its direction is not decided by its own crossover logic — it is slaved to the structure state:
— band = hl2 ∓ (ATR Trend Multiplier, default 5) × EMA(ATR(length 10), smoothing 5)
— Bull regime: line trails as max(previous line, lower band)
— Bear regime: line trails as min(previous line, upper band)
— The line flips only when structure flips (a CHoCH), marked with a circle
So your trailing line and your BOS/CHoCH labels always tell the same story.
9️⃣ Session stats engine — win rate gauge + recent-form strip.
The dashboard tallies closed trades, wins, losses, and win rate, rendered with a Unicode block gauge (▰▱). A separate Form strip shows the last 10 outcomes (▰ = win, ▱ = loss, newest on the right), so you can see whether the current settings are in or out of sync with the market at a glance.
🧠 HOW IT WORKS — bar by bar
Step 1 — Detect swings: symmetric pivots confirm a swing high or low and label it HH/HL/LH/LL.
Step 2 — Watch for a break: price closing (or wicking, your choice) beyond the last swing flags a raw break; same-bar conflicts are suppressed.
Step 3 — Classify the break: the running structure state turns the raw break into a BOS or a CHoCH and flips the trend state.
Step 4 — Filter by bias: if the HTF filter is on, the break must agree with the higher-timeframe EMA regime to qualify.
Step 5 — Spawn the order block: the engine finds the originating candle (preferring displacement) and draws the OB zone.
Step 6 — Open the trade: while flat, a qualifying break sets entry, ATR stop, and TP1/TP2/TP3 from the active preset.
Step 7 — Manage it: each bar checks for TP touches and stop hits; TP1 triggers break-even; SL or TP3 closes the trade and books the result.
Step 8 — Track zones: every open OB arms and then mitigates as price interacts with it.
Step 9 — Report: the dashboard updates trend, signal, levels, R:R, win rate, and recent form; alerts fire on close.
📖 HOW TO USE (beginner-friendly)
🎯 Quick start — get running in 5 steps:
1. Add Meridian Flow to any chart, any timeframe. Defaults already work.
2. Look at the dashboard (top-right). The colored header tells you the current trend: green = bullish, red = bearish, blue = neutral.
3. Wait for a Long ▲ or Short ▼ marker to print under/over a candle. That is a new trade signal.
4. Read the colored lines that appear: the dotted line is your entry, the solid red line is your stop-loss, the three dashed lines are TP1, TP2, TP3.
5. Use those exact levels in your broker. The dashboard shows the same numbers in text so you can copy them.
That is the whole loop: signal prints → take the levels → manage to the targets. Everything else below just helps you read and fine-tune it.
👁️ Reading the chart (what every element means):
— 🟢 Long ▲ / 🔴 Short ▼ markers = a trade just opened in that direction.
— BOS ▲/▼ = trend is continuing in the same direction.
— CHoCH ▲/▼ = trend may be reversing — the first sign of a turn.
— HH / HL = higher high / higher low (healthy uptrend). LL / LH = lower low / lower high (healthy downtrend).
— Colored boxes = order blocks (institutional zones). Bright = still active; faded grey = already mitigated (price came back to it).
— Dotted line = entry · solid red = stop-loss · dashed lines = TP1/TP2/TP3. A target turns solid teal with a ✓ once price reaches it.
— Trailing ATR line = quick visual trend; it flips (with a small circle) when structure reverses.
📊 Dashboard fields:
— Trend : current structure direction (Bullish / Bearish / Neutral).
— Signal : LONG, SHORT, or Wait (a new trade only opens when you're flat).
— Last event : the most recent BOS or CHoCH.
— Timeframe : the chart timeframe.
— SL / TP1 / TP2 / TP3 : live levels of the open trade (✓ marks targets already hit; "BE @" means the stop moved to break-even).
— R:R (TP1) : reward-to-risk to the first target.
— SL Dist % : how far the stop sits from entry as a percentage.
— Trades / W-L / Win rate : this-session performance with a gauge.
— Form : last 10 results, ▰ win · ▱ loss, newest on the right.
🔧 Tuning guide (fix common issues):
— Too many small/noisy signals: raise Swing Length (try 20-30) and set Break Confirmation to "Close".
— Signals feel late: lower Swing Length (5-10) and/or switch Break Confirmation to "Wick".
— Too many counter-trend trades: turn on the HTF Trend Filter.
— Stops too tight / too wide: change the Risk Preset, or use Custom and adjust SL ×ATR.
— Chart too busy: turn off OB labels and the mean line, reduce Max Order Blocks, or enable "Remove OB After Mitigation".
💡 Trading ideas:
— Reversal hunting: set Signal Mode to "CHoCH only" to trade structure turns; pair with an order-block retest for confirmation.
— Trend riding: set Signal Mode to "BOS only" with the HTF filter on to stack with the higher-timeframe direction.
— Zone entries: wait for a fresh OB, then enter on the mitigation tap back into the zone rather than chasing the break.
— Scalping: use the Scalping preset on low timeframes for tight stops and quick 1:1 to 1:2 targets.
— Risk-free runners: keep Break-Even After TP1 on so winners can't turn into losers.
⚙️ KEY SETTINGS REFERENCE
🏗️ Structure:
— Swing Length (default 13): pivot lookback. Lower = more, smaller swings; higher = cleaner.
— Break Confirmation (default Close): Close = fewer fakeouts; Wick = earlier, riskier.
— Signal Mode (default BOS + CHoCH): which events fire trades — CHoCH only / BOS only / both.
— Show HH/HL/LH/LL (default on) · Show BOS / CHoCH (default on).
📦 Order Blocks:
— Show Order Blocks (default on) · Create OB On (default BOS + CHoCH).
— Mitigation Trigger (default Wick): Wick = earlier; Close = stricter.
— Remove OB After Mitigation (default off) · OB Lookback (default 30) · Max Order Blocks (default 8).
— OB Box Transparency (default 85) · Show 50% Mean Line (default off) · Show OB Labels (default off).
🔍 Filters:
— HTF Trend Filter (default off) · HTF Timeframe (default 60) · HTF EMA Length (default 50).
🛡️ Risk Management:
— Risk Preset (default Balanced): Conservative / Balanced / Aggressive / Scalping / Custom.
— ATR Length (SL) (default 13) · SL ×ATR / TP1 / TP2 / TP3 multipliers (Custom mode).
— Show SL/TP Lines (default on) · Show SL/TP Labels (default on) · Show % Distance (default on).
— Break-Even After TP1 (default on) · Entry / SL / TP Line Style .
🎨 Visual:
— Theme (default Auto) · Show Buy/Sell Signals (default on) · Label Font Size (default Small).
— Show ATR Trend Line (default on) · ATR Trend Length (default 10) · Multiplier (default 5.0) · Smoothing (default 5).
— Show Watermark (default on).
📊 Dashboard:
— Show Dashboard (default on) · Position (default Top Right) · toggles for Market / Trade / Stats sections.
🔔 Alerts:
— Webhook JSON Format (default off) · Alert on SL Hit (default on) · Alert on TP / Break-Even (default off) · Alert on OB Mitigation (default off).
🔔 ALERTS
— 🟢 LONG / 🔴 SHORT — entry with ticker, timeframe, price, SL, TP1/TP2/TP3 and R:R.
— 🛑 SL HIT / 🛡️ BE STOP-OUT — stop or break-even stop-out, with entry and stop price.
— 🛡️ BREAK-EVEN — stop moved to entry after TP1.
— 🎯 TP1 / TP2 / TP3 HIT — each target as it is touched.
— 📦 OB MITIGATION — price returns into a bull or bear order block.
All alerts support plain text and JSON webhook output, and fire on bar close (once per bar close).
⚠️ IMPORTANT NOTES
— 🚫 No repainting. Swings use symmetric (equal left/right) pivots, so a pivot is confirmed only after the lookback bars close — the actual swing sits in the past by the Swing Length; the indicator draws forward from that confirmed bar. Breaks, hits, and OB mitigation all commit on bar close (barstate.isconfirmed), the HTF bias reads the already-closed higher-timeframe bar, and alerts fire once per bar close. This is delayed confirmation, not repainting of future values.
— 📐 Confirmation delay is inherent: signals appear after the bar that triggers them closes. This is the cost of avoiding fakeouts.
— ⚖️ Stats are session-based: win rate and the form strip reset when the script reloads or any input changes. They reflect the visible history with current settings, not a guaranteed forward result.
— 📊 "SL Dist %" is the stop distance as a percentage of entry — it is not a position-sizing or account-risk figure. Size your positions with your own risk rules.
— 🛠️ This is a market-structure analysis and trade-planning tool, not an automated trading bot. It detects structure, draws zones, builds stop/target levels, and tracks outcomes — trade decisions remain yours.
— 🌐 Works on all markets and all timeframes. Past performance does not guarantee future results.
— 🆓 Meridian Flow is free to use. Feedback and suggestions are welcome in the comments. Indicator
