مؤشر

مؤشر

مؤشر

Liquidity Side Bias Engine [AGPro Series]Liquidity Side Bias Engine
🧠 Core Idea
Which side of resting liquidity is the more likely near-term draw right now: the buy-side above, or the sell-side below?
This script is built to answer that one question with structure instead of guesswork.
📌 Overview / What It Does
Liquidity Side Bias Engine is a forward-looking, two-sided liquidity planner for smart-money and ICT-style analysis. Most price action leaves resting liquidity on both sides of the market: buy-side liquidity above old highs and equal highs, and sell-side liquidity below old lows and equal lows. At any moment, one of those two sides usually has the stronger pull. This tool maps the nearest untapped liquidity on each side and weighs it into a single, readable side lean.
Concretely, it identifies the closest buy-side pool above price and the closest sell-side pool below price from equal-highs and equal-lows clusters, the prior higher-timeframe high and low, and unmitigated swing points. It then scores each side from 0 to 100 using proximity, pool strength, trend context, and premium-discount range position, and reports which side is leaning, by how much, where the primary draw sits, and which opposite level would flip the read.
It does NOT predict price, generate buy or sell signals, or automate trades. It organizes a two-sided liquidity picture into a structured bias so the chart is easier to read and plan around. Every output is analytical context, not a recommendation.
🎯 Purpose & Design Philosophy
Liquidity tools usually fall into two buckets: reactive sweep detectors that mark a liquidity grab after it already happened, and static maps that draw every pool on the chart and leave interpretation entirely to the trader. Both are useful, but neither answers the practical question a planner actually asks before the move: of the two sides, which one is the market more likely leaning toward next?
This engine was built to fill that gap. It is for the trader who already understands liquidity but wants a clean, consistent way to frame the two-sided picture without manually weighing five different factors on every chart. It supports a patient, context-first mindset: read the lean, understand why it leans, watch the primary draw and the flip level, and let broader market context confirm or deny the idea. The goal is intentional, structured thinking, not a shortcut around it.
⚡ Why This Script Is Different
Most liquidity tools focus on what already happened, marking sweeps and grabs after the candle closes, or they paint a dense map of every pool and stop there.
This script does NOT try to call tops and bottoms, does NOT fire trade signals, and does NOT bury the chart in unlabeled levels.
Instead, it looks forward. It treats buy-side and sell-side liquidity as a two-sided tug-of-war and resolves it into one lean score from 0 to 100, with a clear dominant side, a primary draw target, an opposite flip level, the pool type in play, and a premium-discount range read. The leaning side is drawn solid and emphasized; the opposite side is drawn faint as the flip reference. The result is a single, calm decision-support read instead of a wall of levels or a backward-looking alert.
⚙️ Methodology
1. Context Detection
An ATR baseline, an EMA trend backbone with a slope check, and a premium-discount dealing range are computed to describe the current environment.
2. Reference Mapping
The nearest untapped buy-side pool above price and sell-side pool below price are located from equal-highs and equal-lows clusters, the prior higher-timeframe high and low, and unmitigated swing points. The prior period adapts to the chart: prior day on intraday, prior week on daily, prior month on higher timeframes.
3. Reaction Evaluation
Each side is scored from 0 to 100 across four factors: proximity (closer pools pull more), pool strength (cluster size, prior-period magnetism, freshness), trend context (the direction-aligned side is weighted), and range position (discount weights the buy-side draw, premium weights the sell-side draw). The two scores are compared into a single lean; a small balance gap is treated as two-sided.
4. Visual Output
The leaning side, its primary draw, the opposite flip level, pool type, distance, and a next-action read are rendered into a clean panel, two side lines, a centered bias badge, and moderate alternating event labels.
🗺️ How to Read the Chart
- Side lines: the buy-side line sits above price, the sell-side line below. The leaning side is solid and bold; the opposite side is faint and dashed, marking the flip reference.
- Bias badge: a compact badge near current price shows the leaning state and its 0-100 score.
- Target tag: a single right-edge tag marks the primary draw price on the leaning side.
- Faint pool lines: lighter dotted lines show other untapped pools as a soft liquidity map.
- Labels: green relates to buy-side context, pink to sell-side context, amber to balanced.
- Panel: a fixed readout of state, bias score, primary draw, pool type, range, flip level, and action.
🚦 Signals & States
- Buy-Side Lean → buy-side liquidity above is currently the leaning near-term draw.
- Sell-Side Lean → sell-side liquidity below is currently the leaning near-term draw.
- Balanced → both sides are close in score; no clear leaning side.
- Buy-Side Taken / Sell-Side Taken → a liquidity side was traded through (mitigated).
These are interpretive states, not instructions. A Buy-Side Lean does not mean buy; it means the upside pool is the weighted draw in the current context.
🔔 Alerts Logic
Three optional alerts are available:
- Buy-Side Lean: triggers when the dominant side flips to buy-side above the active threshold.
- Sell-Side Lean: triggers when the dominant side flips to sell-side above the active threshold.
- Liquidity Side Taken: triggers when a buy-side or sell-side pool is traded through.
Alerts are attention markers that point you back to the chart for context. They are not trade instructions and carry no guarantee of any outcome.
🧩 Confluence Logic
The lean is itself a confluence read. When proximity, pool strength, trend alignment, and range position agree on one side, that side scores higher and the lean is more pronounced. When they disagree, the score stays moderate and the state may resolve to Balanced, which is information in itself: the two-sided picture is unresolved.
📊 When to Use
- Trending markets, to frame whether the trend-aligned liquidity remains the dominant draw.
- Ranging markets, to read which range extreme is the more likely draw from the current premium-discount position.
- Around prior-period highs and lows, to gauge which side carries the stronger pull.
- As a planning overlay alongside your own structure, entries, and risk framework.
⚠️ When NOT to Use
- In very low-liquidity symbols or sessions, where swing points and pools are unreliable.
- In extremely noisy or news-driven conditions, where levels are violated erratically.
- As a standalone entry trigger, or in isolation from market structure and risk context.
- On data with large gaps or thin history, where pool detection has too little to work with.
🎛️ Key Inputs
- Swing Strength: how strong a swing must be to qualify as a pool. Higher keeps only major swings.
- Pool Memory: how many recent swings are retained per side.
- Equal Level Tolerance: ATR width for grouping nearby levels into an equal-highs or equal-lows cluster.
- Use Prior-Period Pools: includes the adaptive prior-period high and low as pools.
- Trend Backbone EMA and Slope Bars: define the directional context weighting.
- Premium-Discount Range: lookback for the dealing range that drives the range-position factor.
- Max Draw Distance, Pool Freshness Window: shape how distance and age affect the score.
- Active Bias Score and Balanced Gap: thresholds for an active lean versus a balanced read.
- Visual, label, and panel controls: side lines, badge, target tag, pool map, label density, panel location, theme, and font size.
🖥️ Interface & Visual Design
The panel is the primary readout, leading with the leaning state and 0-100 score, then primary draw, pool type, premium-discount range, flip level, and a concise action line. On the chart, visual hierarchy favors the leaning side: it is solid and emphasized, while the opposite side stays faint. Labels are kept moderate and strictly alternating so the chart reads cleanly at a glance. Panel location, theme, and font size are adjustable; the panel is shown by default for readability.
🧪 Practical Usage Workflow
1. Read the panel: note the leaning state and the bias score.
2. Check the primary draw and the flip level: where is the weighted draw, and what would invalidate the read.
3. Read the premium-discount range line: is price in discount or premium, and how far is the draw in ATR.
4. Confirm with your own market structure, higher-timeframe context, and risk framework before any decision.
🔍 Interpretation Guidelines
Think of the lean as a weighted opinion about the two-sided liquidity picture, not a forecast. A higher score means the factors agree more strongly; a moderate score or a Balanced state means the picture is mixed and patience is warranted. The flip level is a structural reference, not a hard line. Always interpret the lean inside the broader market context rather than in isolation.
🚫 What This Script Is NOT
- It is NOT a prediction engine and does not forecast price direction.
- It is NOT financial advice or a recommendation to buy or sell.
- It is NOT an automated trading system.
- It does NOT produce guaranteed signals or outcomes.
⚠️ Limitations & Transparency
Outputs depend on detected swing structure and may differ across timeframes and symbols. Volatility, liquidity, and changing market conditions affect how pools form and how they are taken. Prior-period pools rely on higher-timeframe data and shift as new periods print. The tool describes current structure; it cannot know the future, and any level can be exceeded or fail to be reached.
🧠 Market Context Notes
Liquidity tends to rest where many participants place stops and pending orders: above equal highs, below equal lows, and around prior-period extremes. In an uptrend, price in discount often leans toward the buy-side draw above; in a downtrend, price in premium often leans toward the sell-side draw below. This engine encodes that two-sided logic into a single read, but market context always has the final word.
🧾 Use Case Examples
- Price is in discount within its range, trend is up, and the nearest buy-side pool is a prior-week high: the engine shows a Buy-Side Lean with the prior-week high as the primary draw.
- Price is in premium, momentum is fading, and equal lows rest below: the engine may show a Sell-Side Lean with those equal lows as the primary draw and a high above as the flip level.
- Both sides score closely: the engine reports Balanced, signaling an unresolved two-sided picture.
🧱 System Philosophy
This tool reflects the AGPro Series approach: convert a familiar but messy concept into a calm, structured, decision-support read. Liquidity is everywhere on a chart; the value is in organizing it into a single, honest lean that respects the trader's own judgment rather than replacing it.
🔐 Non-Promise Statement
This script makes no promise of profit, accuracy, or any specific result. It is an analytical and organizational tool. No certainty is offered or implied.
📉 Risk Disclosure
Trading involves substantial risk, and most participants can lose money. This script is provided for educational and analytical purposes only and does not constitute financial advice. All decisions, positions, and outcomes remain entirely your own responsibility. Always manage risk and trade within your own plan.
📚 Educational Note
Used as intended, the engine can sharpen how you think about two-sided liquidity: where it rests, which side is weighted, and what would change the picture. Treat it as a lens for structured analysis, and keep building your own market understanding alongside it.
مؤشر

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. مؤشر

مؤشر

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 TradingView 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
مؤشر

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
مؤشر

مؤشر

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) مؤشر

مؤشر

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. مؤشر

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. مؤشر

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. مؤشر

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. مؤشر

ID009 Liquidity Path [ReconHK] A liquidity-focused chart indicator designed to help traders study whether price is reclaiming or holding above a key liquidity pivot, while also checking structural liquidity, traded activity, trend context, relative volume, and buyer-pressure confirmation.
------------------------------------------------------------------------------------------------
## 1. What this indicator is for 🧭
------------------------------------------------------------------------------------------------
Liquidity Path is designed to help traders understand whether price is moving through a healthier liquidity area instead of chasing random breakouts. The indicator builds a liquidity profile from the selected lookback period, finds the main activity area, and marks the Liquidity Pivot, also known as the profile point of control.
The main idea is simple: price action near a high-activity area can be more meaningful than price action in a thin or fragmented area. When price reclaims or holds above the Liquidity Pivot with volume, buyer pressure, and trend support, the setup may show a stronger liquidity path.
This indicator is not a buy-or-sell system by itself. It is a decision-support tool for reviewing liquidity structure, participation, and price behavior around the profile pivot.
The purpose is to help traders avoid late or weak breakouts by checking whether price is close to the main liquidity pivot and supported by participation.
------------------------------------------------------------------------------------------------
## 2. What you see on the chart 👀
------------------------------------------------------------------------------------------------
The indicator can show several visual elements:
Blue liquidity profile : a right-side profile showing where more trading activity happened during the selected lookback.
Orange Liquidity Pivot : the main profile pivot, based on the highest activity area of the profile.
Lookback zone : the chart area used to build the liquidity profile.
EMA 20 and EMA 50 : optional trend-context lines.
Optional bias background : subtle background showing whether price is above or below the Liquidity Pivot.
The blue profile helps the user see where activity is concentrated. Thicker profile areas mean more activity was detected at that price zone. The orange Liquidity Pivot is the key reference level used by the path logic.
When price is above the Liquidity Pivot, the market is trading above the main activity reference. When price is below it, price is trading under that reference and may need a reclaim before the path setup improves.
------------------------------------------------------------------------------------------------
## 3. How to read the Liquidity Pivot 🟠
------------------------------------------------------------------------------------------------
The Liquidity Pivot is the central level of this indicator. It represents the price area with the strongest smoothed activity inside the selected profile lookback.
A reclaim above the Liquidity Pivot can be useful because it shows that price has moved back above a major activity reference. A hold or retest above the pivot can also be important because it may show acceptance above that area instead of only a short-lived breakout.
The indicator checks whether price is:
above the Liquidity Pivot,
not too far above the pivot,
not too extended from the short-term trend,
supported by relative volume,
showing buyer-pressure behavior,
aligned with the trend filter when enabled.
This helps separate cleaner liquidity-path situations from late, extended, or weak moves.
A reclaim is more useful when it happens near the pivot with participation. A move that is already too far above the pivot may be late and riskier.
------------------------------------------------------------------------------------------------
## 4. Suggested workflow ✅
------------------------------------------------------------------------------------------------
A practical workflow:
Start with the default settings.
Keep Liquidity quality on Balanced for most liquid stocks and crypto.
Use the blue liquidity profile to see where activity is concentrated.
Watch the orange Liquidity Pivot as the main reference level.
Check whether price is reclaiming or holding above the pivot.
Use the relative volume setting to require real participation.
Use the trend filter if you want signals to prefer EMA trend alignment.
Avoid acting when price is already too far above the pivot or too extended from the EMA.
Use alerts as chart-review reminders, not automatic trade instructions.
Confirm the setup with your own support, resistance, market structure, news, and risk plan.
The indicator is most useful when the user wants to study whether price is moving from a high-activity base into a stronger continuation path. It is less useful when the market is illiquid, fragmented, or moving with large gaps and weak participation.
------------------------------------------------------------------------------------------------
## 5. Risk notes and correct expectations ⚠️
------------------------------------------------------------------------------------------------
This indicator does not guarantee that price will continue higher after reclaiming the Liquidity Pivot. A reclaim can fail, especially during weak market conditions, low-volume moves, news shocks, or broad market selloffs.
Important reminders:
The Liquidity Pivot is a reference level, not a guaranteed support level.
A path signal is a confirmation event, not a complete trading plan.
Relative volume can confirm participation, but it does not remove risk.
Trend alignment can improve context, but trends can reverse.
Thin or fragmented symbols may produce less reliable readings.
Always define risk, stop logic, invalidation, and exit planning separately.
This script does not place trades, manage positions, set stops, or calculate position size. It should be used only as a decision-support tool.
Use the indicator to organize your liquidity and participation review. Do not use it as a substitute for risk management.
------------------------------------------------------------------------------------------------
## 6. Script structure and originality
------------------------------------------------------------------------------------------------
Liquidity Path is an overlay indicator. It is not a strategy.
The script uses:
* indicator(..., overlay = true)
* plot() for the Liquidity Pivot / POC line
* plot() for optional EMA 20 and EMA 50 lines
* bgcolor() for optional bias background
* box.new() for the right-side liquidity profile
* box.new() for the lookback zone
* label.new() for the pivot label
* alertcondition() for signal and pivot events
The script does not use:
* strategy.entry()
* strategy.exit()
* strategy.close()
* automatic order placement
* automatic risk management
The originality of the script is in how it combines several liquidity concepts into one path framework.
The main components are:
1. Structural liquidity filter
2. Continuity check
3. Profile-based Liquidity Pivot
4. Smoothed activity profile
5. Value area calculation
6. Trend context using EMA 20 and EMA 50
7. Relative volume confirmation
8. Buyer-pressure confirmation
9. POC reclaim or retest logic
10. Extension control
11. Path-mode strictness
12. Cooldown control
13. Visual profile and pivot tools
14. Alerts for reclaim, loss, and path signal
These components are not just displayed separately. They work together to answer one practical question:
Is price reclaiming or holding above an important liquidity area with enough structure, volume, trend context, and buyer pressure?
This is what makes the script different from a basic moving-average, volume, or profile-only display.
------------------------------------------------------------------------------------------------
## 7. Structural liquidity filter
------------------------------------------------------------------------------------------------
The script first checks whether the symbol has acceptable structural liquidity. This helps reduce signals on thin, fragmented, or unreliable markets.
The structural liquidity data is calculated from daily data:
dClose
dOpen
dHigh
dLow
dVol
The script calculates daily dollar volume:
addvD = daily close * daily volume
Then it calculates:
addv20 = 20-period average daily dollar volume
p10Addv20 = 10th percentile of daily dollar volume over the short liquidity window
This means the script does not only check average liquidity. It also checks whether the lower-end liquidity is acceptable. A symbol can have one large-volume day and still be unreliable if many other days are weak.
The script also checks gap behavior:
gapPct = absolute difference between current daily open and prior daily close
gapHit = gap is counted when it is greater than the internal gap threshold
gapFreqPct = percentage of recent days with meaningful gaps
This helps identify symbols that move with frequent gaps instead of continuous trading behavior.
The continuity check uses the selected continuity timeframe:
contTfInput = 30, 60, 120, or 240 minutes
It checks whether volume is missing or zero on that secondary timeframe:
deadBar = continuity timeframe volume equals zero
deadBarPct = percentage of dead bars in the recent window
The script also checks stability:
cvAddv = coefficient of variation of daily dollar volume
rangeFrac = daily range divided by daily close
medRangeFrac = median range fraction
The Liquidity quality setting changes thresholds:
Strict requires higher average dollar volume, stronger lower-percentile dollar volume, fewer dead bars, fewer gaps, lower dollar-volume variation, and lower median range fraction.
Balanced uses medium thresholds and is intended for most liquid stocks and crypto.
Loose allows weaker structure and can produce more signals, but may also accept less reliable symbols.
The script creates:
structAddvOk
structP10Ok
structDeadOk
structGapOk
structCvOk
structRangeOk
The main path setup uses:
structuralQualified = structAddvOk and structP10Ok and structDeadOk
The script also calculates:
structuralRobust = structuralQualified and structGapOk and structCvOk and structRangeOk
This gives the script a liquidity-quality foundation before it evaluates the profile path signal.
------------------------------------------------------------------------------------------------
## 8. Liquidity profile and pivot calculation
------------------------------------------------------------------------------------------------
The script builds a custom right-side liquidity profile from the selected lookback period.
The profile range is:
highs = highest high over the lookback
lows = lowest low over the lookback
priceRange = highs - lows
The profile is divided into a fixed number of bins:
BINS_COUNT = 120
Each bar in the lookback contributes activity to one price bin using hlc3:
p = hlc3
The script adds volume to the selected bin:
v = volume * weight
The weighting is enabled internally:
weightedInput = true
This means newer bars receive more weight than older bars:
w = 1.0 - i / lookbackInput
This creates a profile that still uses the full lookback but gives more importance to recent activity.
After raw bin activity is built, the script smooths the profile. It loops around each bin and averages nearby bins with distance-based weights. This reduces noise and avoids making the pivot depend too heavily on one single sharp bin.
The script finds the strongest smoothed bin:
maxVol = highest smoothed bin activity
pocIdx = index of strongest bin
pocRaw = price at the center of that bin
This raw pivot is then smoothed:
pocSmoothed = EMA of pocRaw
The final Liquidity Pivot is clamped inside the calculated value area:
pocPrice = clamp(pocSmoothed, value area low, value area high)
The value area is calculated from the POC outward:
1. Start at the POC bin.
2. Add the neighboring bin with more activity.
3. Continue expanding up or down until the selected value-area percentage is reached.
The script calculates:
vah = value area high
val = value area low
The plotted Liquidity Pivot is the final smoothed and clamped POC:
plot(pocPrice, title = "Liquidity Pivot / POC")
This profile design is useful because the pivot is not just the highest raw volume bin. It is smoothed, recent-weighted, and constrained by the internal value area.
------------------------------------------------------------------------------------------------
# 9. Liquidity Path signal logic
------------------------------------------------------------------------------------------------
The Liquidity Path signal is built from several gates.
First, the script checks where price is relative to the Liquidity Pivot:
abovePocNow = close > pocPrice
belowPocNow = close < pocPrice
Then it measures distance from the pivot:
pocDistancePct = distance between close and pocPrice in percent
This is important because the script tries to avoid late entries. A price that is far above the pivot may already be extended.
The script also measures distance from the fast EMA:
emaDistancePct = distance between close and EMA 20 in percent
The path mode changes strictness:
Early allows more signals and a wider reclaim window.
Balanced uses medium behavior.
Strict requires tighter confirmation.
The script detects:
crossClosePoc = close crosses above the Liquidity Pivot
crossUnderPoc = close crosses below the Liquidity Pivot
It also detects recent reclaim behavior:
barsSinceReclaim
recentReclaim
The reclaim window changes by path mode:
Strict = shorter window
Balanced = medium window
Early = longer window
The script also allows a recent retest:
recentPocRetest
A retest means price recently touched near the Liquidity Pivot but closed back above it. This supports the idea that the pivot may be acting as an accepted liquidity reference.
The POC break-quality check requires:
* price above the pivot
* close meaningfully above the pivot
* high above the pivot
The POC slope check changes by mode:
Strict requires the pivot to be rising recently.
Balanced allows the pivot to be stable or rising over a short comparison.
Early allows a more flexible pivot condition.
The extension filters are:
nearPocPath = price is above POC but not too far above it
notExtendedPath = price is not too far from EMA 20
The trend filter checks:
* EMA 20 above EMA 50
* close above EMA 20
* EMA 20 not falling
This filter can be disabled by the user.
The volume confirmation checks:
* relative volume is not na
* relative volume is above the user threshold
* current volume is above volume moving average
The buyer-pressure confirmation checks:
* bullish candle
* close location value is above the bullish threshold
* delta is improving, or recent buy-share estimate is strong, or price closed above the prior high
The final setup requires:
liquidityPathSetup =
structuralQualified
and price above POC
and POC break quality
and price near POC
and price not extended
and recent reclaim, recent retest, or current reclaim
The final raw path signal requires:
liquidityPathSetup
and trendPathOk
and volumePathOk
and pressurePathOk
and path-mode slope condition
The final signal also uses a cooldown:
pathCooldownBars depends on Early, Balanced, or Strict mode
pathSignal = pathSignalRaw and pathCooldownOk
This makes the signal more selective than a simple POC cross. It must pass liquidity quality, pivot location, extension control, trend context, participation, buyer pressure, and cooldown logic.
------------------------------------------------------------------------------------------------
## 10. Inputs, visuals, alerts, and publication notes
------------------------------------------------------------------------------------------------
The script includes user inputs grouped into four sections.
Core inputs:
1. Liquidity quality
Controls the structural liquidity filter.
Strict = cleaner but fewer symbols and signals.
Balanced = recommended default.
Loose = more permissive.
2. Continuity timeframe
Secondary timeframe used to check whether trading activity is continuous or fragmented.
3. Use trend filter
When enabled, path signals prefer EMA 20 above EMA 50, close above EMA 20, and non-falling EMA 20.
Liquidity Profile inputs:
4. Profile lookback
Number of bars used to build the blue profile and calculate the Liquidity Pivot.
5. Value area %
Percent of profile activity used to define the value area.
6. Show blue liquidity profile
Displays the right-side profile.
7. Show pivot label
Displays the right-side label for the Liquidity Pivot.
8. Show lookback zone
Highlights the exact chart area used to build the profile.
Liquidity Path inputs:
9. Path signal mode
Early, Balanced, or Strict.
10. Max distance above POC %
Prevents late signals when price is already too far above the pivot.
11. Min RVOL confirmation
Minimum relative volume required for participation confirmation.
Visual inputs:
12. Show EMA lines
Displays EMA 20 and EMA 50.
13. Show PATH labels
This input exists in the current script, but the uploaded version does not show a plotted path label command. If a visible label is intended, a plotshape() or label.new() condition should be added for pathSignal.
14. Show subtle bias background
Optional green or red background based on price above or below the Liquidity Pivot.
15. Pivot name
Custom name shown beside the pivot label.
Visual drawing:
The right-side profile is drawn using boxes. Each box represents one price bin. Wider boxes mean more normalized activity at that price area.
The lookback zone is drawn with a box covering:
* selected lookback bars
* highest high and lowest low of that lookback
The pivot label is drawn on the right side at the current Liquidity Pivot price.
Alerts:
The script includes three alert conditions:
1. Liquidity Path Signal
Triggered when price reclaimed or held above the POC with liquidity, volume, and buyer-pressure confirmation.
2. POC Reclaim
Triggered when price crosses above the Liquidity Pivot.
3. POC Lost
Triggered when price crosses below the Liquidity Pivot.
Important distinction:
* POC Reclaim is a simple pivot-cross event.
* POC Lost is a simple pivot-loss event.
* Liquidity Path Signal is more selective because it requires structural liquidity, pivot position, extension control, trend context, relative volume, buyer pressure, and cooldown logic.
Publication note:
This description explains how the combined parts work together so users do not need to read Pine code to understand the tool. It also clarifies that the script is a liquidity and participation review indicator, not an automated trading strategy.
Open-source transparency note: if any external open-source code, function, or logic was reused, the original author and source should be credited clearly in the publication.
مؤشر

Structure Fracture Map [JOAT]Structure Fracture Map is an open-source market structure and imbalance zone indicator that combines Fair Value Gap detection with a dynamic quality scoring system, a dual strength bar visualization inside each zone, and a real-time Break of Structure and Change of Character engine. It provides a single-indicator view of where price has left imbalances, how significant those imbalances are, and where structural shifts have occurred.
The problem with most FVG indicators is static treatment — a gap is detected and displayed with no differentiation between a high-quality gap formed on a strong impulse with above-average volume and a weak gap formed on a low-volume, narrow-range bar. Structure Fracture Map scores every FVG at formation and continuously updates that score based on mitigation progress, age, and trend alignment, ranking all active zones so that only the most institutionally relevant ones remain visible.
Core Concepts
1. Fair Value Gap Detection
A bullish FVG exists when the current bar's low is above the high of the bar two positions prior — a three-bar pattern where the middle bar's range creates a gap that price has not filled. A bearish FVG is the inverse. Detection is confirmed only on completed bars to prevent repainting.
2. Four-Component Strength Score
Each FVG receives an initial strength score from four components: gap size relative to ATR(14) scaled to 40 points, volume relative to 20-bar average scaled to 30 points, trend EMA alignment scaled to 20 points, and candle body-to-range ratio scaled to 10 points. The score is recalculated every bar, with a small age penalty and a mitigation penalty applied as price partially fills the gap:
float totalStrength = (gapScore * 40) + (volScore * 30) + (trendScore * 20) + (candleScore * 10)
fvg.qualityScore := totalStrength - fvg.mitigation * 50 - fvg.age * 0.1
3. Dual Strength Bars
Inside each FVG box, two small bars are rendered — one showing bearish pressure score and one showing bullish pressure score as a proportion of the box width. The relative lengths reflect which directional force is currently dominating at that imbalance zone.
4. Mitigation Tracking
Mitigation is computed as the ratio of how far price has penetrated into the zone to the total zone height. A fully mitigated FVG is removed from the display. Partially mitigated FVGs remain visible with their score updated downward, reflecting reduced structural significance.
5. Break of Structure and Change of Character
Pivot highs and lows track the most recent confirmed structural levels. A Break of Structure (BOS) occurs when price closes through the last confirmed pivot in the current structural direction — confirming continuation. A Change of Character (CHoCH) occurs when price closes through the last confirmed pivot against the current direction — signaling a potential structural shift. Both events are labeled with a horizontal line at the break level.
Features
FVG detection with quality scoring: Bullish and bearish fair value gaps detected and scored by gap size, volume, trend alignment, and candle quality
Dynamic score updates: Quality scores recalculated each bar with age decay and mitigation penalty
Top-N zone ranking: Only the highest-scoring active zones displayed; lower-quality zones removed as better ones form
Dual strength bars: Bearish and bullish strength bars inside each zone show directional pressure balance
Mitigation tracking: Zones removed automatically when fully mitigated; partial mitigation reflected in updated score
BOS and CHoCH detection: Structural break events labeled with horizontal level lines and text identifiers
HH / HL / LH / LL pivot labels: Confirmed swing pivot types labeled on chart for structural context
Swing level extension lines: Dotted lines at current unbroken swing levels extending to right edge of chart
Four color themes: Phantom, Neon, Classic, Solar
Non-repainting: All detection gated by barstate.isconfirmed
Alert conditions: New top-ranked FVG, BOS bull, BOS bear, CHoCH bull, CHoCH bear, FVG touched
Dashed FVG borders: Each Fair Value Gap box has a dashed colored border matching its directional bias — teal for bullish, pink for bearish
Clean pivot arrow labels: HH, HL, LH, LL events rendered as minimal text arrows (▲ HH etc.) with no background box, positioned above/below bars without obstructing price action
Short BOS/CHoCH event lines: Break of Structure and Change of Character events marked with compact 6-bar horizontal lines and right-anchored labels — no full-width horizontal clutter
Resistance/Support swing extensions: Nearest unbroken swing high labeled "Res" and swing low labeled "Sup" at right edge, updated each bar
Structural bias background: Subtle bull/bear background tint driven by current HH/HL or LH/LL structural sequence
Trend EMA reference line: 50-period EMA plotted in elite theme color as a trend context reference
Input Parameters
FVG Zones:
Show Top Zones: Maximum number of ranked zones displayed (default: 10)
Max Stored FVGs: Maximum FVGs tracked in memory (default: 50)
Volume MA Length: Volume average for scoring (default: 20)
Trend EMA Length: Trend alignment reference (default: 50)
Show Strength Bars toggle
Bull/Bear FVG colors
Market Structure:
Swing Lookback: Bars required on each side for pivot confirmation (default: 10)
Show Structure Labels toggle
Show BOS Events toggle
Show CHoCH Events toggle
Show Swing Level Lines toggle
How to Use This Indicator
Step 1: Read Zone Rankings
Zones with higher quality scores represent structurally more significant imbalances. Focus on fresh (un-mitigated) zones with strong scores for potential reaction areas.
Step 2: Monitor Dual Strength Bars
A bullish FVG whose bearish strength bar is growing indicates that selling pressure is building within the zone. When the bearish bar exceeds the bullish bar, the zone may be losing its bullish character.
Step 3: Use BOS and CHoCH for Context
A BOS confirms continuation. A CHoCH is a warning that the current structural bias may be reversing. CHoCH events near high-quality FVG zones are particularly significant structural signals.
Step 4: Watch Swing Level Extensions
The dotted right-edge lines show the nearest unbroken swing high and low — the next levels where a BOS or CHoCH could occur. These levels frame the most immediate structural breakpoints.
Indicator Limitations
Pivot confirmation requires a lookback offset. BOS and CHoCH events are labeled after confirmation, not on the bar that caused them
FVG quality scores include volume as a factor. On instruments where volume is less meaningful, the score may rank gaps differently than expected
Age penalty causes long-standing FVGs to lose score over time even if they remain structurally valid
This indicator identifies existing imbalances and structural events. It does not predict where price will go next
Originality Statement
A dynamic per-bar quality score for FVGs that decays with age and mitigation, combined with a top-N ranking system that actively removes lower-quality zones when better ones form, is not replicated in existing open-source Pine Script v6 FVG publications
Dual strength bars rendered inside each FVG box — showing the current bull-versus-bear directional pressure balance within that specific imbalance zone — is an original visualization concept
Combining FVG quality ranking, mitigation tracking, BOS/CHoCH structural event detection, and pivot type labeling in a unified indicator with a single clean overlay is an original integration
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice. Trading involves substantial risk of loss. Fair Value Gaps and structural events are based on historical price data and do not predict future price direction. The author accepts no responsibility for trading losses resulting from use of this indicator.
Made with passion by jackofalltrades
مؤشر

Setup Symmetry LevelsSetup Symmetry Levels
Setup Symmetry Levels is a market structure indicator designed to identify potential reaction levels based on completed bullish and bearish price setups.
The script tracks consecutive price behavior and plots horizontal levels whenever a user-defined setup threshold is reached. These levels can help traders visualize areas where the market has previously shown notable reactions and may provide useful context for future price analysis.
Features:
• User-configurable bullish and bearish setup thresholds
• Automatic support and resistance level plotting
• Forward projection of detected levels
• Optional setup completion markers displayed on the chart
• Symmetry-based projection levels derived from previous reaction points
• Adjustable colors, line styles, line widths, and label visibility
• Compatible with all symbols and timeframes
The symmetry calculation uses historical reaction levels to generate additional projected levels around the most recent completed setup. These projections are intended to provide a structured visual framework for studying price behavior and market structure.
This indicator is provided for analytical and educational purposes only. It does not provide financial advice, trading recommendations, guaranteed outcomes, or predictions of future market performance. Users should combine this tool with their own analysis, risk management practices, and market research.
The indicator can be applied to cryptocurrencies, stocks, forex, indices, commodities, and other liquid markets.
مؤشر

Cascade Liquidity Zones [JOAT]Cascade Liquidity Zones
Introduction
Cascade Liquidity Zones is an open-source institutional stop-hunt and liquidity zone detector built around the mechanics of how large participants move price through retail stop clusters before reversing. It identifies demand and supply zones from pivot-impulse structures, scores them by quality, confirms sweep events with multiple filters, and marks potential failure entry patterns — all within a single indicator that requires no additional tools to interpret.
The foundational premise is that price routinely sweeps beyond visible structural levels to trigger stop orders placed by retail participants, before institutional participants absorb the liquidity generated and reverse price. Identifying these events in advance, tracking the zones where they are likely to occur, and confirming them with volume and wick rejection filters produces a framework for anticipating institutional reactions at structural extremes.
Core Concepts
1. Pivot-Impulse Zone Creation
Demand zones are formed from confirmed pivot lows and supply zones from confirmed pivot highs. Each pivot creates a zone spanning a configurable ATR multiple, representing the area of institutional activity around that structural level. Zones are scored using a three-component Impulse Quality Score:
f_score(idx) =>
bodyR = math.abs(close -open ) / math.max(high -low , syminfo.mintick)
volR = volume / ta.sma(volume, 20)
atrR = (high -low ) / ta.atr(14)
(bodyR*40.0) + (math.min(volR,4.0)/4.0*35.0) + (math.min(atrR,3.0)/3.0*25.0)
This scores the impulse candle by three factors: directional body conviction (40%), volume participation relative to average (35%), and range size relative to ATR (25%).
2. Four-Layer Glow Zone Visualization
Each zone is drawn as four concentric boxes expanding outward from the core zone level, with decreasing opacity on each outer layer. This creates a visual glow effect that communicates zone location and zone type at a glance. Demand zones use the bull theme color; supply zones use the bear theme color.
3. Sweep Confirmation Engine
A demand zone sweep is confirmed when all of the following conditions pass simultaneously on a confirmed bar: minimum wick penetration percentage, close back inside or above the zone, volume exceeds average by a configurable multiple, wick rejection percentage exceeds minimum threshold, cooldown period elapsed, and optional pattern filters pass.
4. Failure Entry Engine
An alternative entry mode detects price failure patterns at pivot levels. A bullish failure occurs when price wicks below the most recent confirmed pivot low and closes back above it on the same bar, with the wick exceeding a minimum ATR size and a minimum rejection percentage. This targets trapped short-sellers at pivot extremes.
5. Zone Flip Mechanics
When price closes fully through a demand zone, that zone flips to a supply zone — its color changes from bull to bear theme color and it becomes eligible for short-side sweeps. This reflects the structural concept that broken support becomes resistance.
6. Liquidity Value and Hold Percentage
Each zone tracks cumulative volume × price product from its origin bar, displayed as a liquidity value label ($K, $M, $B). Zones also track how many times price has touched and rejected from them without breaking through, expressed as a hold percentage.
Features
Pivot-impulse zone creation: Demand and supply zones built from confirmed structural pivot points, scored by impulse quality
Three-component impulse quality score: Body conviction, volume participation, and ATR-relative range scored at zone creation
Four-layer glow boxes: Each zone drawn as four concentric boxes with decreasing opacity for a depth visualization effect
Multi-filter sweep confirmation: Wick penetration %, close direction, volume multiple, wick rejection %, cooldown, and optional pattern filters
Failure entry engine: Detects pivot-wick failure patterns as an alternative signal type with independent settings
Zone flip: Broken demand zones automatically flip to supply and vice versa
Liquidity value labels: Volume × price accumulated at each zone's origin bar, displayed in human-readable scale
Hold percentage: Ratio of zone tests that did not break through; used to prioritize zone strength
Trade block on sweep: Entry, stop, and two TP levels rendered as boxes and lines when a sweep confirms
Zone clustering: Overlapping zones within a minimum ATR separation are deduplicated, keeping the higher-quality zone
Backtest tracker: Win rate and expected value tracked across all sweep signals
Non-repainting: All sweep confirmations gated by barstate.isconfirmed
Institutional dashboard: 18-row table with zone statistics, sweep and failure counts, win rate, and expected value
Input Parameters
Zone Detection:
Pivot Lookback: Bars required on each side to confirm a pivot (default: 10)
Max Active Zones Per Side: Maximum simultaneous demand or supply zones (default: 8)
Zone ATR Width: Zone height as ATR multiple (default: 0.4)
Min Zone Separation: Minimum distance between zones in ATR units (default: 1.5)
Sweep Confirmation:
Min Wick Penetration %: Minimum wick extension through zone boundary
Volume Confirmation toggle and minimum volume multiple
Wick Rejection Filter toggle and minimum rejection %
Cooldown Bars Between Sweeps
Failure Entry:
Enable Failure Entry Mode toggle
Pivot lookback, wick ATR minimum, wick rejection minimum, volume confirmation, cooldown
Trade Block:
Show Trade Block toggle
RR Ratio for TP placement
SL Mode: Zone boundary or Wick extreme
SL Buffer in ATR units
How to Use This Indicator
Step 1: Identify Active Zones
Fresh zones (not yet swept) are displayed in full color. Prioritize fresh zones with high hold percentages and large liquidity values for upcoming sweep setups.
Step 2: Wait for Sweep Confirmation
A sweep is confirmed when the bar closes after the wick penetration. The trade block appears automatically with entry at the close of the confirmation bar, stop behind the zone boundary plus buffer, TP1 at 1:1 R, and TP2 at the configured RR ratio.
Step 3: Distinguish Sweeps from Failures
Standard sweeps require price to touch inside the zone boundary. Failure entries detect pivot-level failures at a higher structural level. Enable only one mode at a time to avoid conflicting signals.
Indicator Limitations
Pivot confirmation requires bars after the pivot candle. Zones are plotted with an inherent offset corresponding to the lookback length
All sweep confirmations require a bar close. Price that sweeps and reverses within the same bar without confirming on close will not generate a signal
Volume-based filters are less reliable on assets where volume data is unreported or synthetic
Zone flip mechanics assume that a broken level becomes resistance. This structural assumption does not hold in all market conditions
Originality Statement
The combination of a three-component impulse quality score at zone creation, four-layer glow box visualization, multi-condition sweep confirmation, zone flip mechanics, and a failure entry engine in a single indicator is not replicated in existing open-source Pine Script v6 publications
The liquidity value metric (volume × price at pivot origin) as a zone ranking input alongside hold percentage provides an institutional sizing dimension that simple pivot-based zone indicators do not include
The dual-mode architecture (sweep engine + failure entry engine) with independent settings for each, selectable via a single mode toggle, allows the same structural framework to address two different entry philosophies within one indicator
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice. Trading involves substantial risk of loss. Liquidity sweep patterns identified by this indicator represent historical structural events, not predictions of future price behavior. The author accepts no responsibility for trading losses resulting from use of this indicator.
Made with passion by jackofalltrades
مؤشر

مؤشر

مؤشر

ZigZag_KB_Fib_Dual_TradeWhat this indicator does
ZigZag KB Fib Dual Trade automates a Fibonacci-based trading strategy that extracts two sequential trade opportunities from a single A→B down-swing on any chart. Instead of one entry and one exit, you get a layered structure: when Trade 1 hits its take-profit, the same fib levels reframe into a Trade 2 setup automatically.
The indicator handles detection, zone calculation, state tracking, and signal generation. You watch the chart.
How it works
The script uses TradingView's official ZigZag library to identify confirmed price swings, then filters for A→B down-swings only (high → low). On the most recent confirmed down-swing, it projects:
0.236 — Trade 1 stop loss line
0.32–0.382 — Trade 1 Entry Zone
0.618–0.68 — Trade 1 TP Zone (also Trade 2 Entry Zone)
1.0–1.05 — Trade 2 TP Zone
Trade 1
Entry: Close > 0.382 with EMA 9 / EMA 21 confirmation and volume > 1.2× 20-bar average
Take Profit: High reaches 0.618 zone
Stop Loss: Close < 0.236
Trade 2
Sequential entry: After Trade 1 TP fires, close > 0.68 with EMA + volume confirmation
Jump-in entry: If price gaps past Trade 1 entirely and closes above 0.68, Trade 2 activates directly
Take Profit: High reaches 1.0 zone
Stop Loss: Close < 0.618
Visual state machine
The indicator tracks six states and updates zone colors live:
StateVisualWaiting T1 entryEntry Zone lit + T1 TP zone lit + T2 TP dimmedIn Trade 1Same with entry arrow on trigger barT1 played → Waiting T2Entry Zone dims, 0.618-0.68 band turns to T2 Entry color, T2 TP lights upIn Trade 2Same with T2 entry arrowFully playedAll zones dimmed
A Macro swing layer (A_highest paired with B_lowest-since-A) draws in the background as dimmed gray when it differs from the active swing, giving you the bigger context behind the current setup.
Setup invalidation rules
Pre-activation: If price closes below B, the indicator anchors B to the new lower low automatically and recalculates zones — the macro A→B is preserved.
After SL hit: Setup returns to "waiting" state and can re-trigger if entry conditions are met again.
After Trade 2 TP: Setup is fully played until a new A→B forms.
Filters
EMA filter (default ON): require close > EMA 9 AND close > EMA 21 at entry
Volume filter (default ON): require volume > 1.2× 20-bar SMA at entry
Both filters are toggleable. The strategy was developed assuming both ON.
Info table
Top-right info table shows live state, A and B prices, drop %, all zone ranges, both SL levels, current price, EMA filter status, volume filter status, and macro swing context (when present).
Alerts (six conditions)
T1 Entry / T1 TP / T1 SL
T2 Entry / T2 TP / T2 SL
Settings
Pivot detection: ZigZag deviation % (default 35, tunable), minimum bars between pivots
Fibonacci levels: all six levels editable
Moving averages: EMA 9 and EMA 21 colors and widths
Zone styling: entry/TP/dimmed colors, border width, fill transparency, SL line color and width
Display: zone extension bars, info table toggle, A/B label toggle, ZigZag debug line
Recommended use
Built for the daily timeframe on NSE Indian equities, but works on 4H, 1H, and 15-minute charts as well. Tune the deviation percentage based on timeframe — higher deviation for daily (major swings), lower for intraday.
The indicator is intended to surface and structure trades for manual review, not as a fully automated trading bot. It removes the decision fatigue of calculating fib levels by hand, watching for EMA + volume confluence, and tracking trade state across two sequential setups.
Notes
Not financial advice. Test on your own market and timeframe before risking capital.
Past performance of the strategy does not guarantee future results.
The script handles state correctly on confirmed bars; intra-bar transitions may flicker until the bar closes.
مؤشر

Prismatic Depth [JOAT]Introduction
Prismatic Depth is an open-source multi-pillar institutional signal filter that scores bullish and bearish market pressure across nine independent analytical dimensions simultaneously. Rather than generating a signal from any single indicator, Prismatic Depth requires a weighted composite score above a configurable threshold, a minimum directional lead between bull and bear scores, and alignment of up to five optional confirmation gates — all at the same time.
The problem this solves is signal noise. Most indicators produce signals from a single input: a moving average crossover, an RSI threshold, a volume spike. Each of these fires constantly in all market conditions, including conditions where it has no historical edge. Prismatic Depth measures nine separate market properties and only produces a signal when a statistically unusual number of them agree simultaneously. The result is a lower-frequency, higher-context signal that reflects a broader institutional consensus rather than a single technical event.
Core Concepts
1. The Nine-Pillar Scoring Architecture
Each pillar measures a distinct market property independently. Pillar weights are user-configurable and sum to produce a maximum possible score of 100. The nine pillars are:
Structure: Detects higher-high / higher-low and lower-high / lower-low sequences using confirmed pivot highs and lows. A bullish structural sequence adds the Structure weight to the bull score.
Volume: Measures the slope of On-Balance Volume using linear regression over 20 bars. A rising OBV slope contributes to the bull score; falling contributes to bear.
Momentum: Blends three momentum inputs — Kaufman Adaptive Moving Average position, RSI relative to 50, and Williams Percent Range relative to midpoint. Each sub-component is weighted equally at one-third.
Liquidity: Detects swing-low sweeps — bars where price wicks below the last confirmed swing low and closes back above it. These represent stop-hunt events followed by institutional absorption.
Volatility: Evaluates whether the ATR-to-SMA(ATR) ratio falls within a productive range (0.8 to 1.6). Markets outside this range are either too compressed for trend signals or too expanded for reliable entries.
Session: Measures the current bar's position relative to the daily session midpoint. Bars in the lower half of the daily range carry a bullish session score; bars in the upper half carry a bearish score.
Higher Timeframe: Compares current close to a 50-period EMA on a user-selected higher timeframe via request.security() with lookahead disabled.
Delta Pressure: Tracks cumulative signed volume and detects when its moving average crossing direction aligns with price movement. A Pressure Score blending the volume delta ratio, volume rate, and bar body ratio is computed.
Fractal Efficiency: Computes the Fractal Efficiency Ratio — the ratio of the net directional price move to the total path length of individual bar changes. An FER above 0.60 in conjunction with ADX above 20 passes the efficiency gate.
// Fractal Efficiency Ratio
float ferNet = math.abs(close - close )
float ferPath = math.sum(math.abs(ta.change(close)), ferLen)
float ferVal = ferPath > 0.0 ? ferNet / ferPath : 0.0
2. Weighted Score Gating
The final bull and bear scores are compared against a minimum threshold (default: 70 of 100) and a minimum directional lead (default: bull must exceed bear by at least 20 points). Both conditions must hold simultaneously before a signal is considered.
bool longSignal = bull >= threshold and (bull - bear) >= scoreGap
and inSession and noiseGate and vwmaGate and stGate and ribbonGate
3. Optional Confirmation Gates
Five binary gates can be independently enabled or disabled: VWMA(200) price relationship, Supertrend direction, 8-line HMA ribbon direction, ADX minimum threshold (noise filter), and session time filter. Each gate is AND-logic — all enabled gates must pass before a signal fires.
4. Kaufman Adaptive Moving Average
The momentum pillar uses KAMA rather than a standard moving average. KAMA adjusts its smoothing constant based on the Efficiency Ratio of recent price movement, reacting quickly during trending phases and becoming nearly flat during choppy periods.
5. 8-Line HMA Gradient Ribbon
Visual context is provided by an 8-line Hull Moving Average ribbon (using every other increment for performance while retaining the full gradient effect). A normalization factor (ribbon spread divided by its 200-bar EMA, clamped to -1 to +1) drives a color gradient from the bear theme color to the bull theme color. The gradient reflects conviction intensity, not just direction.
6. Trade Block Visualization
When a signal fires, entry, stop, and up to four take-profit levels are plotted as horizontal lines and labeled at the right edge of the chart. Risk and reward zones are shown as translucent boxes. All drawn objects are updated every bar to extend rightward until closed.
Features
Nine-pillar weighted confluence scoring: Structure, Volume, Momentum, Liquidity, Volatility, Session, HTF Trend, Delta Pressure, and Fractal Efficiency each scored independently and summed
Configurable pillar weights: Each pillar's contribution to the total score is independently adjustable
Five optional binary gates: VWMA, Supertrend, HMA Ribbon, ADX noise filter, and session filter independently toggled
Threshold and directional lead gating: Score must exceed minimum AND directional lead must exceed gap before any signal fires
Extreme signal tier: Separate threshold for extreme confluence readings with distinct visual treatment
8-line HMA gradient ribbon: rFactor-normalized color gradient reflecting momentum spread intensity vs. its 200-bar historical average, with gradient fills between all adjacent ribbon lines
Gradient glow bar coloring: Glow color mode uses barcolor() to highlight signal bars in the bull or bear theme color; when disabled, falls back to RSI-intensity gradient bar coloring
Regime background tint: Subtle chart background tint on regime transitions, clearing after 10 bars
Four TP levels with live boxes and lines: TP1–TP4 plotted as gradient green lines and translucent boxes extending right in real time
Four stop modes: Supertrend, ATR cap, fixed percentage, pivot-based
Built-in backtest tracker: Win rate, expected value in R, and trade count
Four color themes: Phantom (cyan/magenta), Neon (teal/pink), Classic (green/red), Solar (orange/blue)
Institutional dashboard: 14-row table showing all nine pillar scores, signal state, and performance metrics
Non-repainting: All signals gated by barstate.isconfirmed; HTF request.security() uses lookahead=barmerge.lookahead_off
Input Parameters
Scoring Engine:
Min Score to Signal: Minimum composite score required (default: 70)
Extreme Score: Score for extreme tier (default: 90)
Min Directional Lead: Bull-bear gap required (default: 20)
Pillar Weights:
Individual weight sliders for each of the nine pillars (defaults sum toward 100)
Trend Gates:
VWMA Gate toggle and length (default: 200)
Supertrend Gate toggle, ATR length, multiplier
Ribbon Gate toggle, base length, step
ADX Noise Gate toggle and minimum ADX value
Signal Control:
Cooldown bars between signals (default: 5)
Session filter toggle and session string
Trade Levels:
Show Trade Block toggle
Stop mode: Supertrend / ATR Cap / Fixed % / Pivot
RR multiples for TP1, TP2, TP3, TP4 (defaults: 0.5, 1.0, 1.5, 2.0)
How to Use This Indicator
Step 1: Select a Theme and Configure Gate Sensitivity
Choose a color theme that suits your chart. Start with all five gates enabled and default weights. Observe signal frequency across several recent weeks of history.
Step 2: Interpret the Dashboard Score Rows
Each pillar row in the dashboard shows its current directional score in the stronger direction. A row colored in the bull theme means that pillar is contributing to bullish confluence. The Signal row shows the final output.
Step 3: Use Signals as Context, Not Directives
A signal fires when an unusual number of market dimensions agree. It does not predict how far price will move or guarantee a profitable outcome.
Step 4: Set Stop Mode Before Live Use
The Supertrend stop mode trails the stop with the Supertrend level. ATR Cap limits maximum stop distance. Fixed % uses a fixed percentage of price. Pivot uses the last confirmed structural pivot.
Step 5: Review Backtest Statistics Skeptically
The win rate and expected value displayed are calculated from signal history on the current chart only. They reflect past performance on historical data. Optimizing weights to maximize these numbers on a single chart produces overfitted results that will not generalize.
Indicator Limitations
Pivot-based pillars (Structure, Liquidity) confirm with a lookback offset — the structural event is labeled bars after it occurred. This is non-repainting behavior inherent to pivot detection
The Fractal Efficiency gate may delay signals following sharp, fast moves where path length temporarily normalizes
High pillar weights placed on a single pillar can effectively reduce this to a single-factor indicator. Weight distribution should be reasonably balanced
The session pillar score assumes intraday context. On daily and higher timeframes, it contributes a neutral fixed value
The backtest tracker embedded in this indicator does not account for slippage, commission, or partial fills. It is not a substitute for a properly configured strategy backtest
Enabling all gates simultaneously will produce very few signals. Tune gate selection to the market and timeframe being analyzed
Originality Statement
Prismatic Depth is original in its nine-pillar architecture and the specific combination of inputs it assembles. This publication is warranted because:
The Fractal Efficiency Ratio as a scoring pillar and gate condition — measuring the directional efficiency of price movement over a lookback, distinct from ADX — is not present in existing open-source Pine Script v6 publications as of this writing
Weighted pillar scoring where the user controls the relative contribution of each dimension, combined with both a score threshold and a directional lead gap as dual gatekeeping conditions, produces a more selective output than threshold-only systems
The Delta Pressure pillar — computing a composite of volume delta ratio, volume rate versus average, and candle body compression — is an original implementation distinct from standard OBV or CMF approaches
The combination of nine independently scored dimensions with five independently toggled binary confirmation gates in a single configurable framework, with a built-in per-signal performance tracker, is not replicated in existing open-source publications
Disclaimer
This indicator is provided for educational and informational purposes only. It does not constitute financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss. Confluence readings are based on historical price data and do not guarantee any future market outcome. Past win rate statistics shown by the built-in tracker do not predict future performance. Always apply proper risk management. The author accepts no responsibility for trading losses resulting from the use of this indicator.
Made with passion by jackofalltrades
مؤشر
