指标

Supply and Demand Zones | Flux ChartsGENERAL OVERVIEW
Supply and Demand Zones indicator uses a simple but effective mechanism to find the most useful supply and demand zones on any chart. Most tools draw every zone they can find and leave the trader to sort through the clutter. This indicator does the opposite: it watches how price actually behaves at each zone and keeps only the levels that have earned attention.
The mechanism is straightforward. Each zone is built from a confirmed price swing, and from that moment it is tracked as a living object. Every time price returns, the indicator records what happened — a clean rejection (retest), a failed push-through that snaps back (also a retest), or a decisive break. From that record it computes one honest number, Held: the share of retests where the zone successfully pushed price away. A zone that has held four of five tests is immediately separated from one that keeps breaking.
That same track record then drives what you see. Instead of showing every zone, the indicator surfaces a small set of the most useful ones — ranked by how reliably they have held, how often they have been tested, and how close they are to current price. The result is a clean chart focused on the zones that have actually proven themselves, rather than a wall of boxes you have to filter by eye.
WHAT IS THE THEORY BEHIND THE INDICATOR?
Supply and demand trading is built on a simple idea: where price reversed sharply once, it often reacts again, because unfilled orders and trapped traders remain at that level. The problem is that not every zone is equal. Some levels are respected again and again; others break the first time they are tested. Most supply and demand tools draw every zone the same way and leave the trader to guess which ones still matter.
This indicator takes the position that a zone's history is more informative than its existence. A level that has been tested five times and held four of them is telling you something a fresh, untested level cannot. So instead of treating zones as static boxes, the indicator watches every interaction — bounces, failed breakouts, and clean breaks — and turns that record into a measurable hold rate. A zone earns its place on your chart by performing, not just by existing.
FEATURES
Finds the most useful zones — instead of drawing every zone, it tracks how each one behaves and surfaces only the levels that have proven themselves
Automatic zone detection — supply and demand zones are built from confirmed price swings, with boundaries sized by the average wick so each box covers the real reaction area
Per-zone track record — every zone carries its own data: how many times it has been retested, how many times it has broken, and how reliably it has held
Held statistic — each zone shows the share of its retests that successfully held, turning its history into one honest reliability number you can read at a glance
Retest tracking — every test of a zone is recorded and marked on the chart, including failed breakouts that snap back into the zone
Breakout & flip tracking — clean breaks are recorded, and the zone flips from supply to demand (or vice-versa) while keeping its full history
Strongest / Nearest ranking — shows the most useful zones, ranked by how reliably they have held, how often they have been tested, and how close they are to price
Clear, data-rich visuals — gradient zone fills, glowing retest markers, colour-coded flip segments, and a per-zone stats label that displays its retests, breakouts, and Held % right beside it
Clean-chart controls — minimum spacing hides near-duplicate zones, and a smooth fade-out dims zones as they drop off the list
Four alerts — retests and breakouts, on both supply and demand
ZONE DETECTION AND BOUNDARIES
What is a zone?
A zone is a price area drawn around a recent swing high or swing low. A swing high becomes a supply zone (an area sellers defended); a swing low becomes a demand zone (an area buyers defended). New zones are only created when they don't overlap an existing one, so the chart never stacks duplicate boxes on the same level.
Why does it matter?
Swings are where the market actually changed its mind, which makes them the most natural place to expect a future reaction. Building zones only from confirmed swings — and skipping overlaps — keeps the set of zones meaningful instead of cluttered. Clean, non-overlapping detection is the foundation everything else builds on: the track record and ranking are only as useful as the zones they start from.
How is it detected and calculated?
The indicator waits for a swing to confirm using the Swing Period: a high or low only counts once that many bars have printed on both sides of it. The zone's outer edge sits at the swing's extreme (the high for supply, the low for demand). The inner edge is set using the average wick of the candles around the swing, so the zone covers the real reaction area rather than a single thin line. Because a swing needs bars on both sides to confirm, each zone appears a fixed number of bars after the swing itself — a normal, non-repainting delay rather than a level that appears and disappears.
Settings
Swing Period — how many bars must confirm a swing on each side before it forms a zone. Higher = fewer, more significant zones; lower = more zones that react faster to price. Default 30.
Lookback — how far back the indicator looks for zones, in bars. Higher keeps older zones on the chart; lower focuses on recent price action. Default 2000.
RETESTS AND FAILED BREAKOUTS
What is a retest?
A retest is when price returns to a zone, touches it, and is rejected — closing back out on the same side it came from. This is the classic supply/demand reaction: price revisits the area and the zone pushes it away. A failed breakout — price pushing through the zone but then closing back inside it — is also counted as a retest, because the zone ultimately won.
Why does it matter?
Retests are the evidence that a zone is still active. A level that keeps rejecting price is one the market is clearly watching. Counting failed breakouts as retests is important too: a level that traps breakout traders and reclaims is often the strongest kind of level, and ignoring those events would understate a zone's true strength.
How is it detected and calculated?
On each closed bar, a zone is checked for a reaction: for a supply zone, price reaching into the zone but closing back below it counts as a retest; for a demand zone, reaching in but closing back above. To avoid over-counting when price lingers at a level, a Retest Cooldown requires a minimum number of bars between two counted retests on the same zone. Separately, if price closes clean through a zone and then closes back inside it on the next resolution, that failed breakout is recorded as a retest as well. All events are evaluated only on confirmed (closed) bars, so nothing is counted on an unfinished candle.
Settings
Retest Cooldown — waits this many bars before counting another test of the same zone, so price lingering at a level isn't counted as many separate retests. Default 3.
Retests (toggle + marker) — show or hide retest markers and choose their shape (Circle, Triangle, Cross, Diamond).
BREAKOUTS AND ZONE FLIPS
What is a breakout?
A breakout is when price closes decisively through a zone and keeps going, rather than being rejected. When a zone breaks, it flips: a broken supply zone becomes a demand zone, and a broken demand zone becomes a supply zone — the same idea as old resistance becoming new support. Crucially, the zone keeps its history through the flip; it doesn't start over.
Why does it matter?
A clean break is the opposite of a hold, and tracking it is what makes the Held statistic meaningful. The flip behaviour also reflects how these levels really work in practice — a level that breaks rarely disappears; it changes role. Keeping each zone's full history across flips means a level that has been a battleground through several cycles is shown as exactly that.
How is it detected and calculated?
When price first closes through a zone, the zone enters a pending state. The very next resolution decides what happened: if price closes through again, it is confirmed as a breakout and the zone flips its side; if price instead closes back inside, it is recorded as a failed breakout (a retest). This two-step confirmation avoids calling a breakout on a single bar that immediately reverses. Each flip also starts a new coloured time segment, so the zone's box visually records when it was supply and when it was demand across its life.
Settings
Breakouts (toggle + marker) — show or hide breakout markers and choose their shape. Off by default to keep the chart clean.
THE HELD STATISTIC
What is Held?
Held is the heart of the indicator. It answers a simple question: when price comes back to this zone, how often does the zone actually hold? It is shown on each zone's stats label as a count and a percentage, for example "Held: 4 (80%)" — meaning four of the zone's five retests successfully held.
Why does it matter?
This is the number that separates a level worth trading from one that just happens to be on the chart. A high Held % means the zone has repeatedly done its job; a low one warns you the level is leaky. Because it is measured from the zone's own history rather than assumed, it gives you an honest, at-a-glance read on reliability.
How is it detected and calculated?
After each retest, the indicator looks forward over the Hold Window — a set number of candles — and checks whether the zone was broken during that window. If the zone survived the window without a breakout, that retest counts as a hold. Only retests old enough to have a full window behind them are judged, so a very recent retest doesn't distort the number before its outcome is known. Held is then the count of successful holds, shown alongside its percentage of all retests.
Settings
Hold Window — after a retest, the zone must avoid a breakout for this many candles to count as a successful hold. Drives the Held stat and the Strongest ranking. Default 10.
STRONGEST AND NEAREST RANKING
What is the ranking?
Rather than crowd the chart with every zone it finds, the indicator shows a limited number per side and chooses which ones using one of two modes. Nearest simply shows the zones closest to current price. Strongest shows the zones that have most reliably held, weighted by how often they've been tested and how close they are to price.
Why does it matter?
Most charts have far more historical zones than are useful at once. Nearest is best when you care about the levels price is about to interact with regardless of their record. Strongest is best when you want the chart to surface proven levels — the ones that have repeatedly held — so your attention goes to the areas with the best track record.
How is it detected and calculated?
The Strongest score combines three things. Reliability is the zone's hold rate, but smoothed so a zone tested only once can't look perfect — its record is trusted more as it accumulates more tests. Evidence rewards zones that have been tested more often, with diminishing returns so one ancient zone doesn't dominate forever. Proximity favours zones closer to price. A small bonus is given to zones already on screen so the displayed list stays steady instead of swapping every bar. Nearest mode, by contrast, simply ranks by distance to price.
Settings
Rank By — Strongest (most reliable, weighted by tests and proximity) or Nearest (closest to price). Default Strongest.
Show — how many supply and how many demand zones to show at once; each side is counted separately. Default 5.
ZONE SPACING AND FADE-OUT
What are spacing and fade-out?
Two features keep the chart readable. Minimum spacing hides a zone that sits too close to one already shown, so you don't get several near-identical boxes stacked together. Fade-out smoothly dims a zone as it drops off the visible list, instead of having it vanish abruptly.
Why does it matter?
A clean chart is easier to act on. Spacing prevents visual clutter at congested levels, and the fade-out makes it obvious when a zone is no longer among the top picks without the chart jumping around distractingly.
How is it detected and calculated?
When selecting which zones to show, the indicator skips any candidate sitting within the Min Zone Spacing distance (a percentage of price) of a zone already chosen. When a previously shown zone is no longer selected, it is moved to a fade list and dimmed over a fixed number of bars before being removed. Drawing is also budgeted internally so the gradient zone fills always stay within the platform's object limits.
Settings
Min Zone Spacing (%) — hides zones sitting too close to one already shown, to keep the chart clean. Set to 0 to show every zone. Default 0.1%.
Supply / Demand colours — the colours used for supply and demand zones, their gradient fills, and their markers.
ALERTS
What alerts are available?
Bullish Retest — price bounced from a demand zone.
Bearish Retest — price rejected from a supply zone.
Bullish Breakout — price broke above a supply zone.
Bearish Breakout — price broke below a demand zone.
When do they fire?
Each alert fires on a confirmed bar at the moment the matching event is recorded, so you are notified of bounces and breaks as they are confirmed rather than on an unfinished candle.
IMPORTANT NOTES
All retests, breakouts and flips are evaluated only on closed (confirmed) bars, so events are not counted on an in-progress candle.
A breakout requires price to close through a zone and then confirm on the next resolution. A single bar that closes through and immediately closes back in is recorded as a retest (failed breakout), not a breakout.
Held only judges retests that have a full Hold Window of bars behind them, so the most recent retest may not yet be reflected in the Held count until its outcome is known.
When a zone breaks it flips side and keeps its full history, so a single long-lived zone can show interactions from several supply/demand cycles.
The number of zones shown is limited per side by the Show setting; other valid zones continue to be tracked in the background and can appear later as conditions change.
UNIQUENESS
Most supply and demand indicators draw zones and stop there, leaving the trader to guess which levels still matter. Supply and Demand Zones treats each zone as a tracked object with a measurable record. Every retest, failed breakout and clean break is recorded over the zone's life, and the Held statistic turns that record into a single, honest reliability number shown right on the zone — a level that has held four of five tests is immediately distinguishable from one that keeps breaking. Failed breakouts are folded into retests rather than ignored, capturing the trap-and-reclaim behaviour that often marks the strongest levels, and broken zones flip side while keeping their entire history instead of resetting. The Strongest ranking is driven by that same measured record — reliability, number of tests, and proximity — with smoothing so a single lucky test can't masquerade as a perfect level, meaning the chart automatically surfaces the zones that have actually proven themselves. The result is a supply and demand tool that doesn't just show you where zones are, but how much each one has earned your trust.
DISCLAIMER
This indicator is an analytical and educational tool. It does not predict future price movement and does not provide financial advice. A zone's past hold rate describes what has already happened and does not guarantee future behaviour. Always use proper risk management and combine this tool with your own analysis. 指标

AQR Momentum Factor [JOAT]AQR MOMENTUM FACTOR
A tribute to AQR Capital Management's seminal momentum-factor research — including Asness's classic "Value and Momentum Everywhere" framework. The script estimates cross-horizon momentum by ranking returns across five independent look-back horizons (default 1, 5, 20, 60, 120 bars — including the AQR-canonical 12-1 month equivalent), volatility-adjusting the result, and producing a composite momentum score in that fires Buy / Sell labels when the score crosses configurable thresholds.
Why cross-horizon ranking
A single momentum lookback is fragile. AQR's published research (Asness, Moskowitz, Pedersen, and others) shows that momentum is best estimated by agreement across horizons — when short-, medium-, and long-term momentum all point the same way, the signal is much more reliable than any single horizon alone. The script encodes that directly:
Five horizons — 1 / 5 / 20 / 60 / 120 bars by default (configurable independently).
At each horizon the return is percentile-ranked against its own trailing 252-bar (trading year) distribution.
The five percentile ranks are mapped from to (50% → 0; 100% → +1; 0% → −1).
The composite is the average of the five mapped ranks.
The output is bounded in and represents how unusual current momentum is relative to its own recent history, averaged across timeframes .
Volatility adjustment (optional but on by default)
The composite is divided by a volatility Z-score over a configurable window (default 60 bars), clamped at a Z cap (default 2.5) to avoid division-by-zero blow-ups. This dampens signals during high-volatility regimes — which is what AQR's "low-vol momentum" research finds is the genuinely tradeable component of the factor.
When vol-adjustment is off, the score is raw cross-horizon momentum. When it is on, the score is risk-adjusted momentum, which is the institutional read.
Signal engine
BUY — composite > buy threshold (default +0.70 → top ~15% across horizons).
SELL — composite < sell threshold (default −0.70).
Extreme High / Low alerts — composite > +0.90 / < −0.90. The script's strongest reads.
A configurable Min Bars Between Same-Side Signals (default 5) prevents clustering. A confirm-on-close toggle (default ON) ensures non-repaint signals.
Bar colouring — strict 2-hue discipline
The chart bars are coloured by the sign of the composite, with saturation proportional to magnitude. The "Bar Color Saturation Floor" input controls how aggressively the colour fades when momentum is weak — at 0 the bars are always full colour; at 1 they fade toward background when momentum is weak. The defaults (0.65) produce a clean institutional read where strong-momentum bars stand out and weak-momentum bars merge into the background.
A hidden composite-line plot (toggleable) opens a pane below the chart for users who want to see the score itself, or feed it to Data Window / webhook automation.
Visual system
Buy / Sell labels on threshold crosses (configurable size).
Bar colouring by signed momentum with saturation floor.
Hidden composite line (toggleable, pane).
Light regime background (off by default) — very subtle bgcolor sampled from bull/bear.
A locked Golden Blaze palette: gold bull / oxblood bear / off-white neutral on a dark-slate ground — the classic AQR institutional aesthetic. Strict 3-hue discipline + bg.
Dashboard
Monospaced table positionable to any of nine corners. Surfaces:
Composite score with signed value.
Per-horizon percentile ranks (h1 / h2 / h3 / h4 / h5).
Horizon agreement count (how many horizons agree with the composite sign).
Volatility Z value and adjustment factor in use.
Last signal direction with bars-ago.
Configuration: rank window, vol window, thresholds.
Alerts
Four alert conditions, each independently controllable:
BUY (composite crosses above buy threshold)
SELL (composite crosses below sell threshold)
Extreme Score (|composite| crosses extreme high or low)
Horizon Disagreement (off by default) — fires when horizons split (~half above 50%, half below). Useful as a "no edge" warning.
How to read it
Three reads, in order of conviction:
Extreme score with full horizon agreement — the highest-conviction read. All five horizons agree, the score is in the top 10% / bottom 10% of its own distribution, and vol-adjustment has not damped it. This is the institutional setup.
Buy / Sell with vol-adjustment active in a low-vol regime — the "low-vol momentum" setup AQR's research identifies as the strongest factor exposure. Pair with a directional execution tool.
Horizon disagreement alert — stand-aside signal. Some horizons say bull, some say bear; there is no momentum factor exposure available. Wait for agreement to return.
Suggested settings
Defaults (horizons 1/5/20/60/120, rank window 252, vol window 60, vol Z cap 2.5, ±0.70 thresholds, ±0.90 extreme) are tuned for daily charts on broad indices — the timeframes where momentum factor exposures are statistically most meaningful. For lower timeframes drop all horizons proportionally (1/5/15/30/60) and the rank window to 200. For weekly+ keep defaults; momentum on weekly is the canonical factor.
Originality / what's reused
The momentum factor is published academic finance — Jegadeesh & Titman 1993, Asness 1994, AQR's "Value and Momentum Everywhere" 2013. The 252-bar / one-year ranking window is the classical institutional convention. The implementation here — the five-horizon configurable engine, the ta.percentrank -based ranking pipeline, the linear remap, the volatility-Z adjustment with clamp, the saturation-floored bar-colouring with strict 2-hue discipline, the horizon-disagreement alert logic, and the AQR Golden Blaze palette — is JOAT-original. No third-party code reused. The script is a tribute to AQR's published methodology, not a direct replication of any proprietary AQR model.
Open source
Published open-source under the default Mozilla Public License 2.0. The horizon pipeline, the ranking engine, the vol-adjustment routine, the signal engine, and the dashboard are isolated modules. Forks welcome with credit.
Limitations
The 252-bar ranking window assumes a daily chart for the "trading year" interpretation; on lower timeframes the window represents a different real-world horizon. The momentum factor is well-documented historically but, like all factor exposures, it can underperform for extended periods — the dashboard's horizon-agreement count is the script's own early warning when the factor is breaking down. Vol-adjustment is on by default because it is statistically supported; turn it off only for research.
—
-made with passion by jackofalltrades
指标

指标

指标

Adaptive Supertrend [ForexCracked]🔷 OVERVIEW
Adaptive Supertrend is a trend-following tool that automatically adjusts its sensitivity to current market volatility. A classic Supertrend uses one fixed factor, which whipsaws in choppy conditions and lags in calm ones. This version measures the live volatility regime and scales the ATR factor between a low and a high setting, so the trail tightens when volatility is low and widens when volatility is high.
🔷 CONCEPTS
Supertrend trails price using an ATR band whose width is set by a "factor." Instead of one fixed factor, this script ranks the current ATR against its own recent range (a 0–100 volatility percentile) and maps that rank onto a factor between your Min and Max settings:
• Low volatility → smaller factor → tighter trail, earlier signals. • High volatility → larger factor → wider trail, fewer false flips.
🔷 HOW TO USE
• Stay with the trend while the line sits below price (up) or above price (down). • A flip of the line marks a potential trend change, shown with a Buy or Sell label. • Read the Info panel for the live trend and the current volatility regime (Low / Medium / High). • Combine it with structure or support and resistance for confirmation, and always use a stop. No single indicator is a complete system.
🔷 SETTINGS
• ATR Length — lookback for the ATR band. • Min Factor / Max Factor — the range the factor adapts between. • Volatility Lookback — bars used to rank the current volatility. • Style — Buy/Sell labels, gradient fill, info panel, bar coloring, and colors.
🔷 ALERTS
• Buy (flip up) and Sell (flip down).
Free and open-source. Educational tool, not financial advice. 指标

Position Size Calculator - Risk Manager, Risk/Reward & L[LunqFX]Risk Manager is an on-chart position size and risk/reward calculator for TradingView that turns proper risk management into one click. Set your account size and risk per trade %, and it instantly gives you the exact position size (units / lots / contracts / shares), your risk and reward in dollars, the risk/reward ratio, and the breakeven win rate you need to be profitable — all visualized as clean risk and reward zones right on the chart. It works out of the box with an auto ATR setup (Entry / Stop Loss / Take Profit placed for you), or type your own levels. Built in Pine Script v6, it works on forex, crypto, stocks, indices, futures, gold (XAUUSD) and Bitcoin (BTCUSD), on any timeframe — because it sizes risk, not signals. Keywords: position size, position sizing, risk management, risk reward, risk/reward ratio, lot size calculator, money management, stop loss, take profit, R multiple, risk per trade, breakeven win rate, Kelly criterion, day trading, swing trading, scalping.
◆ WHY THIS MATTERS
Most traders blow accounts not because of bad entries, but because of bad position sizing and inconsistent risk. Professionals risk a fixed small % per trade (commonly 0.5–2%) and know their risk/reward before they click buy. This tool enforces that discipline on every trade — no spreadsheets, no external calculators.
◆ WHAT IT DOES
Exact position size from your account balance and risk %, in units, lots, contracts, shares or coins.
Risk and reward in account currency and as a % of account.
Risk/reward ratio with a clean visual meter.
Breakeven win rate — the minimum win rate needed to be profitable at your current R:R (a metric most calculators skip).
Visual risk zone (red) and reward zone (green) drawn between Entry, Stop and Target.
Optional fractional Kelly suggested risk %.
A modern, colour-coded dashboard.
◆ HOW IT WORKS
Auto mode (default): Entry is set at price, Stop at a chosen ATR distance, and Target at your chosen R multiple — a valid setup appears instantly on any instrument.
Manual mode: turn Auto off and enter your own exact Entry / Stop / Target prices in the settings.
Position size = (account balance × risk %) ÷ (distance from entry to stop). This guarantees that if the stop is hit, you lose exactly your chosen risk %.
Reward = position size × distance to target; R:R = reward ÷ risk.
Breakeven win rate = 100 ÷ (1 + R:R) — e.g., at 2R you only need to win >33% of trades to break even.
Lots/contracts = units ÷ your contract size (100000 for a forex standard lot, 1 for stocks/crypto, your multiplier for futures).
◆ HOW TO USE IT
Set Account balance and Risk per trade % once (e.g., 1%).
Pick Auto direction (Long/Short) or switch to manual and place your real Entry/Stop/Target.
Read the Position size — that is exactly how much to trade so your loss at stop = your set risk.
Check the R:R meter and Breakeven — only take trades whose math fits your strategy’s win rate.
Use the red/green zones to see risk and reward visually before entering.
Adjust Contract size to match your instrument (forex lots, futures multiplier, etc.).
◆ SETTINGS
Trade Setup (auto ATR or manual prices, direction, ATR stop, target R), Account & Risk (balance, risk %, contract size, size label), Kelly (optional), Visuals (box length, neon candles), Panel (text size, position, colours).
◆ ALERTS
Price hit Entry · Price hit Stop · Price hit Target.
◆ ORIGINALITY
This is original work. The auto-ATR setup engine, the account-aware sizing, the visual risk/reward zones, the colour-coded dashboard with the R:R meter and the breakeven-win-rate readout are all my own implementation. No third-party code is used.
◆ LIMITATIONS
This is a planning and sizing tool, not a signal generator — it does not tell you when to buy or sell.
Position size assumes your account currency matches the quote currency; for cross-currency pairs or unusual contracts, set Contract size to match your broker’s lot/units.
The auto ATR setup is a starting template — always adjust Stop and Target to real structure.
Results depend on the inputs you provide (balance, risk %, contract size); double-check them for your broker.
◆ NON-REPAINTING
This is a calculator: it draws from your inputs and the current price and never alters historical bars.
Risk Manager is an educational tool, not financial advice. Trading involves risk of loss. Always do your own research and manage risk responsibly. © LunqFX. 指标

True Time Price Profile - Hybrid Dynamic Bins[ALT_analyst]True Time Price Profile - Hybrid Dynamic Bins
◆ NOTICE / DISCLAIMER
This architecture is NOT a standard Volume Profile (VP) or a conventional Time Price Opportunity (TPO) indicator.
It is a highly advanced, multi-variable structural density engine.
It was specifically designed to mathematically extract institutional defense lines and localized price absorption in environments lacking reliable tick volume (e.g., Forex, CFD, Indices),
functioning as a rigorous technical benchmark for supply/demand extraction.
◆ EXECUTIVE SUMMARY
This script is deployed as a Proof of Concept (PoC) to demonstrate the integration of price absorption, time-based variance,
and strict pro-rata energy distribution within a localized UI rendering environment.
By discarding standard aggregation methods, this open-source architecture isolates the true "quality" of price stagnation,
exposing anomalous market states where large capital defends specific price buckets.
◆ ARCHITECTURE & QUANTITATIVE LOGIC
Standard profiles often struggle because they cannot distinguish between a "rapid vacuum passing" and a "defended consolidation."
This engine utilizes three proprietary layers to resolve this logic gap:
Pro-Rata Energy Distribution Engine
To prevent large-range bars (e.g., sudden momentum spikes) from artificially inflating the profile score across empty price vacuums, this script enforces a strict pro-rata allocation matrix.
Let N_bins be the total number of price bins a single bar intersects.
The assigned value for each specific bin is calculated as:
Apportioned Value = Base Value / N_bins
This completely neutralizes vacuum zones, correctly assigning mass only to true areas of conflict.
Velocity & Acceleration (Absorption) Evaluator
Instead of counting volume, the script measures the deceleration of price action.
It compares the high-low range of the current bar (v_curr) against the previous bar (v_prev). A negative acceleration (accel < 0) indicates kinetic energy is being absorbed by limit orders.
This absolute delta is extracted as the base absorption value (|a|).
Time Variance Logic (Market Memory)
A price level tested multiple times over a prolonged period holds significantly more structural integrity than a level tested only once.
The engine applies the statistical variance of the normalized time index (t) to scale the localized importance of a bin:
Variance (σ²) = (Sum of t² / n) - (Average t)²
The final Hybrid Score is the integration of absorbed energy scaled by the logarithmic variance:
Score = Sum( |a| * ln(1 + σ²) )
◆ PRACTICAL APPLICATION: HOW TO TRADE WITH THIS ENGINE
Instead of blindly treating every high-volume node as support/resistance, utilize this engine to identify Structural Friction:
Locating Hidden Institutional Limits:
Bins with exceptionally high Hybrid Scores often act as heavy liquidity pools.
Price action will typically stall or reverse sharply upon re-entering these zones.
Breakout Validation:
If price breaks out of a Value Area (VA) without generating new high-score bins, it indicates a lack of limit-order resistance (a vacuum).
These moves are prone to rapid continuation or swift mean-reversion sweeps.
Cross-Session Node Alignment (Breakout Threshold):
By anchoring the profile to short, sequential sessions, observe if high-scoring nodes (POCs) align horizontally at the same price level across multiple independent profiles.
This structural anomaly signifies a massive, sustained accumulation of limit orders.
A decisive price breach of this specific alignment typically triggers a high-probability volatility breakout, as the defended liquidity pool is rapidly consumed.
◆ SYSTEM CAPABILITIES AND LIMITATIONS
Visual Synthesis of Invisible Nodes:
Resolves precise support/resistance vectors purely from price action kinetics, independent of broker volume feeds.
Dynamic Resolution Scaling:
The bin size is strictly tethered to the Average True Range (ATR), ensuring the profile grid automatically calibrates to the underlying asset's volatility regime.
Limitations & Warnings:
TradingView enforces a strict cap of 500 max boxes/lines per indicator. To prevent script execution limits or array errors, the maximum lookback and bin count are dynamically capped.
Furthermore, if the scaled ATR drops to absolute zero, the geometric grid cannot initialize.
◆ INPUT PARAMETERS REFERENCE
Live Update Frequency:
Toggle between 'Update on Every Tick' and 'Update on Bar Close'.
CRITICAL WARNING: Using tick updates combined with multiple MTF arrays on a fast timeframe will cause localized UI lag. Use 'Bar Close' as a CPU saver.
Profile Calculation Mode:
Select 'Classic' for standard aggregation, or 'Hybrid' to engage the Absorption + Variance matrix (The core edge of this tool).
Grid Step Multiplier:
Lower values increase vertical resolution.
Warning: Values below 0.05 on high-volatility assets may trigger the 500-box rendering limit.
Show Debug Data Table:
Projects a live array matrix on the bottom right, displaying precise Price, Count, Absorption, Variance, and Hybrid Scores for absolute algorithmic transparency.
指标

指标

HTF Candle PO3 AMD SessionsHTF Session Dashboard (Higher Timeframe Candles)
Core idea: This indicator allows you to view the price action of a Higher Timeframe (HTF) drawn as full candles directly on your current lower timeframe chart. It's designed to keep you aware of the macro market structure without needing to constantly switch timeframes.
How It Works
Instead of just showing standard HTF levels, this indicator dynamically builds and projects the current day's higher timeframe candles (e.g., 4-Hour candles) off to the right side of your active chart (e.g., a 1-minute or 5-minute chart).
The candles are constructed in real-time. As price moves on your lower timeframe, the active "current" HTF candle will grow its wicks and adjust its body live.
Key Features
Live HTF Candle Projection: Displays the sequence of HTF candles that make up the current trading day, spaced neatly to the right of the current price action.
Session Extremes: Automatically draws dotted reference lines stretching across your chart to highlight the absolute High, Low, Body High, and Body Low of the entire current session.
Live Countdown Timer: Shows a dynamic timer above and below the candle cluster indicating exactly how much time is left until the active HTF candle closes.
Hour Labels: Every HTF candle has a small label indicating its open hour (with an adjustable timezone offset setting) to help you quickly identify Kill Zones within the macro candles.
Visual Customization: Fully adjustable body width, transparency, spacing, offset distance, and bull/bear color schemes.
Clean Daily Reset: The indicator automatically clears the prior day's candles at midnight (exchange time) and begins building the new sequence, keeping your chart uncluttered.
Why Use This?
When trading intraday (like on a 1m chart), it's easy to get lost in the noise and trade right into a major 4-Hour support or resistance level. By projecting the 4-Hour candles directly onto your 1-minute chart, you always know exactly where you are relative to the higher timeframe narrative and structure.
Recommended Settings
HTF Setting: 240 (4 Hours) or 60 (1 Hour) when trading on a 1m–15m chart.
Hour Label Offset: Adjust this (e.g., +1 or -1) if you want the candle hour labels to match a specific local time zone (like EST) rather than exchange time.
指标

Auto Candlestick Patterns Targets Setup🔷 OVERVIEW
Auto Candlestick Pattern Targets automatically identifies supported candlestick reversal patterns and displays a complete trade setup directly on the chart. When a qualifying pattern is detected, the indicator plots an Entry level, Stop Loss, and up to three Take Profit levels based on its internal calculation logic.
The objective is to reduce the amount of manual chart work by presenting trade levels in a consistent visual format.
🔷 HOW IT WORKS
The indicator continuously evaluates completed candles for supported bullish and bearish candlestick formations.
When the pattern conditions are satisfied, it:
• Displays a Buy or Sell label
• Calculates an Entry level
• Places a Stop Loss based on the detected pattern
• Projects three Take Profit targets
Each setup remains visible on the chart, allowing users to review historical signals and monitor active trades.
🔷 VISUAL FEATURES
• Automatic Buy and Sell labels
• Entry level
• Stop Loss level
• Three Take Profit targets
• Risk and reward visualization
• Historical signal display
• Configurable colors and styles
🔷 INPUTS
The indicator includes options to customize:
• Signal sensitivity
• Display of Entry, Stop Loss, and Targets
• Label visibility
• Colors
• Historical setup display
🔷 USAGE
A common workflow is:
Wait for a Buy or Sell signal.
Allow the signal candle to close.
Review the plotted Entry, Stop Loss, and Take Profit levels.
Combine the setup with your own market analysis before making trading decisions.
🔷 MARKETS
The indicator can be applied to:
• Forex
• Stocks
• Cryptocurrency
• Indices
• Commodities
It is compatible with multiple timeframes, depending on the user's trading approach.
🔷 NOTES
This indicator is intended as a chart analysis tool and does not predict future price movements. Trade setups are generated according to the indicator's programmed rules and should be evaluated alongside other forms of technical analysis and appropriate risk management. 指标

FVG & OB Quality ScorerICT FVG & OB Quality Scorer
Core idea: Not all Fair Value Gaps and Order Blocks are created equal. This indicator answers the question "Which FVG or Order Block will actually work?" by scoring every detected zone on 10 confluence pillars derived from ICT's (InnerCircleTrader) 2022–2024 Mentorship methodology.
How It Works
Every time an FVG or Order Block forms on the chart, the indicator runs it through a 10-factor scoring engine (each factor scored 0–10, total 0–100):
# Pillar What It Checks
❶ Displacement / CISD Was the move impulsive? Body > 70% of candle range = institutional candle. Also checks for Change in State of Delivery (close crossing prior candle's open).
❷ Liquidity Sweep Was BSL or SSL taken before the zone formed? Checks swing pivots, Prior Day High/Low, and IPDA 20-day levels.
❸ Premium / Discount Bullish zones in discount (< 50% of range) score high. Bearish zones in premium (> 50%) score high.
❹ Market Structure Is the zone aligned with the current trend (BOS)? With-trend = 10, counter-trend = 1.
❺ HTF Bias Does the Daily (configurable) candle direction agree with the zone? Misalignment = low probability.
❻ OTE Fibonacci Is the zone inside the 62%–79% Optimal Trade Entry retracement? The 70.5% "sweet spot" scores perfect 10.
❼ FVG + OB Overlap Is there a confluence zone where an FVG and Order Block exist at the same price level? This is ICT's highest-probability setup.
❽ Volume Was displacement volume above the 20-bar average? 3x+ average = clear institutional activity.
❾ Kill Zone Timing Formed during London KZ, NY AM KZ, or Silver Bullet windows? "Time supersedes price."
❿ Freshness First-touch zones score highest. Zones decay in score and fade in color as they age.
Grading Scale
Score Grade Meaning
86–100 S Elite — high conviction, full size
71–85 A/A+ Strong — tradeable with confirmation
51–70 B/B+ Above average — needs extra confluence
26–50 C/C+ Below average — watch only
0–25 D Weak — skip entirely
What You See On The Chart
Color-graded zones: Red (weak) → Orange → Gold → Green → Bright Green (elite)
FVGs = solid-border boxes labeled BISI / SIBI
Order Blocks = dashed-border boxes labeled +OB / -OB
CE line = dotted midline (Consequent Encroachment — ICT's 50% level)
MT line = solid midline on OBs (Mean Threshold — ICT's precision entry)
Score labels with letter grade — hover for full 10-pillar tooltip breakdown
Dashboard table ranking all active zones by score with market context (Structure, HTF Bias, Kill Zone status)
Zones fade in color as they age (freshness decay) and are removed/dimmed on mitigation
Key Settings
Min Score to Display — Set to 60+ to only see B+ and above (recommended for clean charts)
Mitigate On — Wick vs Close (ICT uses Close for higher conviction)
HTF Timeframe — Defaults to Daily; change to 4H for swing setups
IPDA Reference Lines — Toggle 20-day high/low institutional levels
Kill Zone sessions — All configurable in NY time 指标

Trend Momentum Breakout [AlphaPine]Overview
Trend Momentum Breakout is built for traders who use trendline breaks as part of their market-structure review.
The indicator displays support and resistance trendline references, keeps the chart focused on recent structure, and highlights breakout conditions based on the selected confirmation settings.
It is designed to answer one focused chart-reading question:
Where is price showing a confirmed break of a support or resistance trendline reference?
This indicator is not a complete trading system. It is a structure layer that can be used alongside broader market context, price action, volume, higher-timeframe bias, risk planning, and a trader's own execution rules.
What It Shows
Support and resistance trendline references.
Bullish breakout markers after resistance breaks.
Bearish breakout markers after support breaks.
Smaller and larger structure views.
Optional volume confirmation.
Optional moving averages for trend context.
Optional structure point markers for visual review.
Alerts for monitored breakout conditions.
Visual Legend
Red line: resistance trendline reference.
Green line: support trendline reference.
Thicker line: larger structure.
Thinner line: smaller structure.
Dashed line: projected or recently broken trendline segment.
Green up marker: bullish resistance breakout.
Red down marker: bearish support breakout.
Gray marker: optional structure point marker.
How To Use
Add the indicator to a liquid market and start with the default settings.
Use the visible trendline references as market-structure context. When a breakout marker appears, treat it as a confirmed structure event, not as an automatic trade entry.
Traders can adjust the structure scale, chart cleanliness, breakout confirmation, optional volume filter, display style, and optional moving averages to match their chart-reading workflow.
Alerts can be used to monitor breakout conditions without watching every chart continuously. Alerts should be treated as notifications, not automatic trade instructions.
Confirmation Behavior
Breakout markers appear only after the indicator has enough confirmed chart structure to display an active trendline reference. A marker is shown when price confirms a break under the selected settings.
Optional volume confirmation can be enabled for traders who want an additional participation filter.
Important Live-Chart Note
This indicator uses confirmed chart structure. Confirmed structure requires time to form, so historical trendlines can look cleaner than what a trader would have seen live at the original turning point.
This is normal for structure-based indicators. Historical plots should be used for review and learning, not as proof of profitability or as evidence that every past marker was tradable in real time.
For live use, wait for the current bar to close, the trendline to be confirmed, and the breakout marker or alert to appear under the selected settings.
Settings Overview
The default settings are designed to keep the chart readable while showing recent support and resistance trendline structure.
Available controls include:
Structure lookback and scale.
Maximum visible lines.
Trendline selectiveness.
Advanced structure sensitivity.
Scan depth and chart-performance balance.
Breakout confirmation strictness.
Optional volume confirmation.
Recent marker display.
Marker size and visibility.
Trendline and marker colors.
Optional moving averages.
Alert controls and cooldown.
Moving Averages
Moving averages are included as an optional chart overlay only.
They are useful when traders want basic trend context without adding a separate moving average indicator. They do not turn Trend Momentum Breakout into a trend-following system and should still be interpreted with the broader chart.
Best Use
This indicator is intended for markets and timeframes where traders already use trendline structure as part of their analysis.
Good fit:
Trendline breakout review.
Market structure mapping.
Support and resistance break monitoring.
Discretionary trade planning.
Multi-timeframe chart review.
Breakout watchlists with alert support.
Less suitable for:
Automatic buy/sell execution.
Low-liquidity markets with erratic candles.
Choppy conditions where trendline breaks may be less informative.
Using historical markers as standalone proof of profitability.
Trading Notes
Resistance and support are often better understood as areas, not perfect single-price levels. This indicator draws trendlines as visual references because its purpose is trendline breakout mapping. Traders should still account for spread, volatility, liquidity, candle context, and nearby support/resistance zones.
Breakouts can fail. A confirmed trendline break does not remove the need for risk management, invalidation planning, and broader market context.
What Makes It Useful
Trend Momentum Breakout helps organize trendline breakout analysis by combining structure references, confirmation markers, visual controls, optional volume context, optional moving averages, and alert support into one focused indicator.
The goal is not to replace a trader's decision process. The goal is to make trendline breakout structure easier to see, review, and monitor.
Disclaimer
This indicator is for educational and analytical use only. It is not financial advice and does not guarantee any trading result. Traders are responsible for their own analysis, risk management, and execution decisions. 指标

Confluence Context - Regime Filter + Market Structure🎯 CONFLUENCE CONTEXT - REGIME FILTER + MARKET STRUCTURE
Your signal tool tells you WHEN. This tells you WHETHER.
Confluence Context — Regime Filter + Market Structure is the companion layer that
sits on top of whatever you already trade and answers the one question that wrecks
most setups: does the context actually agree? It draws no zones and fires no
entries — it reads the environment, scores it, and hands you a single
glance-readable verdict. 📊
🔥 WHY IT EXISTS
Most signal tools fire identically in every environment — trending, ranging, dead,
or violent. The killer is the clean-looking signal taken in the wrong context: a
breakout in a dead session, a continuation against structure, a trend entry while
volatility is flatlined. Confluence Context — Regime Filter + Market Structure
gates your entry with the four things signal tools love to ignore.
🧩 THE FOUR LAYERS
📐 Market Structure — Swing pivots labeled BOS (Break of Structure, with the
trend) and CHoCH (Change of Character, against it), with a running bias: Bullish,
Bearish, or Neutral. Confirmed-bar only.
🌊 Volatility Regime — ATR vs its own moving average, sorting the tape into Low,
Normal, or Extreme. This is the regime filter — it tells you whether you're in the
environment your strategy was actually built for. Flip on H1 mode to inherit a
higher-timeframe regime read from the prior closed 60-min bar, no repaint.
🕐 Session Filter — London / New York / Asia with pair presets (JPY, USD majors,
AUD/NZD) or fully custom windows + timezone. Reads the live wall clock, so it flips
to "Closed" the moment the market closes instead of freezing on the last bar.
📈 Trend — Price vs a configurable EMA. Simple, and it earns its weight.
⚡ HOW THEY STACK (the scoring engine)
Every layer casts a weighted vote into TWO independent tallies — a bull score and a
bear score, scored separately so you can actually see when context is fighting
itself instead of just being quiet. Clear your threshold and the Highlighter
collapses both into one verdict:
🟢 Stacked Long · Leaning Long · ⚪ Balanced · Leaning Short · 🔴 Stacked Short
It tints your candles and/or background and drops a headline row in the table —
CONTEXT: BULLISH · Stacked Long · 9 / 2. It confirms context, it doesn't call
trades, so it speaks BULLISH / BEARISH, never BUY / SELL.
🔗 THE COMPANION HOOK
The engine holds a heavyweight slot for an "External Zone Hit" you toggle manually
(bull and bear separately) the moment YOUR zone or level tool confirms a touch.
That's the whole point: it lets your existing setup feed the one input it can't
infer, so the verdict reflects your real trigger — not a guess.
🛠️ HOW TO USE IT
Slap it on top of whatever you trade. Tune the EMA, regime multipliers, and session
windows to your instrument. Read the verdict off the table or the candle tint —
filter your primary signal so you only pull the trigger when context agrees, or let
the confluence alert ping you when the dominant side clears threshold. Alerts ship
for structure breaks, regime shifts, session opens/closes, and threshold crossings.
⏱️ BEST TIMEFRAMES
Built to shine on M15 through H4 — enough structure to mean something, fast enough
to act on.
♾️ The whole idea: it stays useful after it's been on your chart for a while. Every
read maps to a concrete trading or chart decision — no decoration, no noise.
🔓 Open-source.
Repaint policy: structure, regime, and score history evaluate on confirmed bars;
the HTF regime read uses a closed-bar offset and doesn't repaint; the session
display is live by design and doesn't touch history. Settings are starting points,
not advice — tune them to your market and validate before risking capital. 指标

Momentum ConsensusMomentum Consensus reduces three momentum readings to a single agreement view. Each of DI-Power, BBP and the MACD-V histogram is reduced to its sign (above zero, below zero, or exactly zero), and the pane shows the net as one column: its height is the count above zero minus the count below zero (range -3 to +3), green and pointing up when bulls lead, red and pointing down when bears lead, and nothing when the two sides cancel. Only one side is ever drawn, so the column itself is the net stance. All three inputs are momentum or trend readings - DI-Power is (DI+ minus DI-) weighted by ADX, BBP is Elder Bull Bear Power over ATR, and MACD-V is the ATR-normalized MACD histogram - so the tally is a clean read of momentum agreement rather than a mix of different dimensions. Each reading is divided by its own rolling maxAbs; that scaling never subtracts a baseline, so each keeps its true zero and sign, and since the tally reads sign only, the scaling does not change the count, it just keeps each reading matching its source. When exactly one reading is on a side, a one-letter badge marks the lone reading (D for DI-Power, B for BBP, M for MACD-V) in its own colour, pinned to the top edge for a lone bull and the bottom edge for a lone bear so it never overlaps the column. Two alerts are available for when the net flips sides (its sign crosses zero), one for each direction. Everything is inferred from OHLCV. Built on public, well-documented concepts, implemented from scratch in original Pine. Descriptive context only, not a signal and not financial advice. 指标

指标

指标

指标

Multi-Indicator Confluence Strategy Automator [MarkitTick]💡 A comprehensive, multi-dimensional technical analysis suite engineered to evaluate market conditions through a rigorous synthesis of trend, momentum, volatility, and cross-asset correlation metrics. Designed for traders who require a systematic approach to market entry and risk management, this script aggregates signals from multiple proven indicators and applies advanced statistical filters to minimize false positives. By unifying foundational technical analysis with advanced mathematical concepts like the Hurst exponent and momentum inflation, this tool provides a highly objective, data-driven environment for evaluating market structure and defining structured trade parameters.
✨ Originality and Utility
Standard trading methodologies often rely on isolated indicators, which can lead to high failure rates in dynamic market environments. The originality of this script lies in its robust confluence engine, which demands simultaneous alignment across multiple independent market dimensions before generating a signal.
Instead of merely stacking moving averages, this suite integrates a strict Boolean gating system that evaluates:
A primary directional baseline derived from a Hull Moving Average combined with an Average True Range volatility buffer.
A directional movement and momentum confirmation matrix utilizing the Average Directional Index and Commodity Channel Index.
Dynamic volume filtering to ensure market participation supports the price action.
Advanced statistical gating mechanisms, including confluence decay, regime detection, and cross-asset correlation analysis.
This utility is exceptionally valuable for systematic traders, as it translates complex, multidimensional market data into a highly legible, unified dashboard while automatically projecting risk-adjusted stop-loss and take-profit levels dynamically based on current market volatility.
🔬 Methodology and Concepts
● The Confluence Engine
The core of this strategy revolves around a scoring system that evaluates bullish or bearish alignment. A valid signal requires a minimum confluence score, calculated by assessing the following core components:
• Baseline Trend
The script utilizes a Hull Moving Average to determine the primary market bias. To eliminate noise, a volatility buffer equivalent to a fraction of the Average True Range is applied, ensuring that only definitive breakouts beyond the baseline are considered valid directional shifts.
• Directional Movement (ADX/DMI)
The first confirmation layer relies on the Average Directional Index alongside the Directional Movement Indicators. A trend is only considered active if the ADX exceeds a user-defined threshold, and the relationship between the positive and negative directional indicators defines the bias.
• Momentum Oscillators (CCI)
The second confirmation layer employs the Commodity Channel Index to measure the current price level relative to an average price level over a given period. Bullish or bearish confirmation requires the CCI to pierce specific upper or lower thresholds.
• Volume Validation
A volume filter ensures that signals are backed by significant market interest. The current period's volume must exceed a rolling exponential moving average of historical volume, multiplied by a strict sensitivity factor.
• Advanced Gating Filters
Confluence Decay: A time-based penalty system that degrades the value of a signal if the confluence state persists for too long without triggering an entry, preventing late entries into exhausted trends.
Hurst Regime Detector: Classifies the market as trending or mean-reverting, gating signals that conflict with the overarching statistical regime.
Momentum Inflation Ratio: Normalizes current price velocity against historical volatility to detect and filter out exhaustion spikes.
Cross-Asset Lead-Lag: Computes the Pearson correlation against a secondary asset to confirm macroeconomic or sector-wide alignment before entry.
🎨 Visual Guide
The script employs a highly intuitive visual hierarchy designed to keep the chart clean while providing maximum data density.
● Chart Elements
• Heatmap Candles
The standard price candles are color-coded based on the baseline trend state. Bullish bars are colored a vibrant teal, bearish bars are marked in a distinct red, and neutral states default to a muted slate blue. This visual heuristic allows traders to instantly recognize the dominant market regime without processing raw numerical data.
• Signal Markers
When all confluence conditions and advanced gates are met, the script plots distinct entry markers: small upward-pointing triangles below the bar for long signals, and downward-pointing triangles above the bar for short signals.
• Risk Management Levels
Upon a confirmed signal, the script dynamically draws horizontal lines representing the trade parameters:
Entry Line: A dashed, neutral-colored line projecting the exact trigger price.
Stop Loss (SL): A dashed, red line projected against the trend based on a multiple of the Average True Range.
Take Profit (TP1, TP2, TP3): Three dotted, green lines representing scaled exit targets, dynamically calculated using expanding volatility multiples.
Each line is accompanied by a precise price label anchored to the right side of the chart.
● The Information Dashboard
A comprehensive table is anchored to the top right of the screen. It displays the real-time status of the Baseline, Confirm 1, Confirm 2, Volume, Exit status, and the aggregate Score. Furthermore, it outputs the exact values for ADX, ATR, Decay Age, Hurst Exponent, Momentum Inflation, Baseline Distance-Integral, and Lead-Lag Correlation, using a color-coded text system (Green for bullish/favorable, Red for bearish/unfavorable, Yellow for warnings).
📌 Note : the best way to resolve visual overlap is to navigate to the Object Tree and drag the indicator above the main chart layer, or simply hide the native candles in your chart settings.
📖 How to Use
● Interpreting Signals
Traders should monitor the chart for the appearance of the signal triangles. Because the script utilizes a strict minimum gap requirement between signals, traders will not be overwhelmed by repetitive alerts during a sustained trend.
● Executing Trades
Once a signal appears, the script automatically projects the optimal Entry, Stop Loss, and three Take Profit levels on the chart. Traders can use these exact price labels to populate their exchange order tickets or algorithmic routing software.
● Managing Positions
The built-in Exit Indicator, driven by a faster CCI calculation, will trigger an alert when counter-trend momentum builds, providing an objective reason to manually close or trail stops on an active position before the hard stop loss is hit.
● Dashboard Monitoring
Use the dashboard table to gauge the overall health of the trend. If the Confluence Score drops or the Confluence Decay percentage reaches high levels, it is highly advisable to tighten stops on existing positions, as the mathematical probability of trend continuation has diminished.
⚙️ Inputs and Settings
● Core Indicator Tuning
Baseline HMA Length: Adjusts the sensitivity of the primary trend filter.
ADX/DMI Length & Threshold: Defines how strong a trend must be to pass the first confirmation gate.
CCI Length & Threshold: Sets the momentum required for the second confirmation gate.
Volume RMA Length & Multiplier: Configures the strictness of the volume participation filter.
● Risk Parameters
ATR Length: The lookback period for volatility measurement.
SL ATR Mult: The multiplier applied to the ATR to define the stop-loss distance.
TP1, TP2, TP3 ATR Mult: The multipliers defining the three scale-out profit targets.
● Advanced Filter Settings
Confluence Decay: Toggles the time penalty system and defines the maximum bars before full decay.
Hurst Regime Detector: Toggles regime filtering and sets the threshold for trending vs. mean-reverting environments.
Momentum Inflation Ratio: Toggles velocity normalization and sets the threshold ratio for exhaustion alerts.
Cross-Asset Lead-Lag: Defines the correlation ticker, correlation lookback window, and minimum Pearson threshold.
🔍 Deconstruction of the Underlying Scientific and Academic Framework
● Rescaled Range Analysis and the Hurst Exponent
This script integrates a specialized implementation of the Hurst Exponent, a statistical measure originally developed in hydrology, to classify financial time series data. It calculates the cumulative deviation of the asset's price from its Simple Moving Average over a defined rolling window. By identifying the maximum and minimum cumulative deviations, the script establishes the range, which is then normalized against the standard deviation of the price series to compute the rescaled range ratio. The final Hurst value is derived logarithmically. A value significantly greater than 0.5 mathematically confirms a persistent, trending regime, while a value below 0.5 indicates an anti-persistent, mean-reverting environment.
● Momentum Inflation via Volatility Normalization
The script tackles the academic problem of momentum illusion, where sheer point movement is mistaken for structural momentum, by normalizing absolute price speed against the Average True Range. It then compares this normalized current velocity against a rolling historical average of normalized velocity. If the resulting ratio exceeds the user-defined threshold, the script identifies the movement as mathematically over-extended, gating further entries to prevent buying the top or selling the bottom of a volatility spike.
● Cross-Asset Correlation Dynamics
To account for macroeconomic interconnectedness, the script employs a rolling Pearson correlation coefficient between the primary asset and a defined leading indicator. By analyzing the covariance of the two assets relative to the product of their standard deviations over a specific window, it mathematically verifies if the broader sector or macroeconomic environment supports the localized signal.
● Distance-Integral Calculations
The Baseline Distance-Integral utilizes a rolling mathematical sum of the spatial delta between the closing price and the moving average. This integral provides a quantifiable area-under-the-curve measurement, offering deeper insight into the cumulative kinetic energy of a trend rather than relying solely on point-in-time cross signals.
⚠️ Disclaimer
All provided scripts and indicators are strictly for educational exploration and must not be interpreted as financial advice or a recommendation to execute trades. We expressly disclaim all liability for any financial losses or damages that may result, directly or indirectly, from the reliance on or application of these tools. Market participation carries inherent risk where past performance never guarantees future returns, leaving all investment decisions and due diligence solely at your own discretion. 指标

Bollinger Squeeze Breakout + VolumeA volatility contraction often precedes a volatility expansion. When Bollinger Bands narrow significantly, it signals that the market has entered a period of low energy, and low energy rarely lasts. This strategy is built around that principle: it waits for a genuine squeeze, then enters only when price breaks out of the bands with volume confirming that the move has real participation behind it, not just noise.
The logic
A squeeze is identified when the Bollinger Band width (the distance between the upper and lower bands relative to price) falls below its own recent average,meaning volatility is unusually compressed compared to the recent past. Once that condition is met, the strategy watches for price to close outside either band. A long entry triggers when price closes above the upper band during a squeeze, confirmed by volume exceeding its 20-period average. A short entry triggers under the mirrored condition on the lower band. Stops and targets are based on ATR, since the appropriate distance for both should scale with the market's actual movement at the time of entry, not a fixed number.
This approach tends to filter out the false breakouts that occur during already-volatile, choppy conditions, since the entry only fires after a genuine period of compression, which is when breakouts have historically had more follow-through.
Notes on use
The squeeze threshold and lookback length are the two inputs worth tuning per instrument, a 50-period lookback works reasonably well on daily and 4-hour charts, but lower timeframes may benefit from a shorter lookback to react faster to genuine volatility shifts. As with any breakout strategy, backtest across both trending and range-bound periods before drawing conclusions, since this approach is built specifically to perform during regime transitions and may underperform in markets that stay range-bound for extended periods without ever truly compressing.
This is shared for educational and discussion purposes. As always, backtest thoroughly on your own instruments and timeframes, and treat this as a starting framework rather than a finished system. Feedback and variations are welcome in the comments. 策略

MACD Trend Continuation Filter [algo_aakash]MACD Trend Continuation Signals with Trend Strength and Session Validation is a trend-following indicator designed to reduce false MACD crossover signals by requiring confirmation from market direction, trend strength, and trading session activity before generating a signal.
Instead of treating every MACD crossover equally, the indicator applies a sequential validation process so that signals are only produced when momentum develops in the direction of the prevailing trend during active market sessions.
Problem Statement
Standard MACD crossover strategies often generate numerous signals during ranging markets, weak trends, or periods of reduced market participation. While many of these crossovers satisfy the basic MACD conditions, they frequently lack the broader context needed to support a higher-probability continuation move.
This indicator addresses that issue by combining momentum, trend direction, trend strength, and session timing into a single validation workflow. The objective is not to increase the number of signals, but to improve their selectivity by filtering out conditions that commonly produce lower-quality entries.
Methodology
The indicator evaluates each setup through four consecutive validation stages.
Stage 1 – Momentum Trigger
The process begins with a traditional MACD crossover.
A bullish setup requires the MACD line to cross above the signal line while both remain below the zero line, indicating that bullish momentum is emerging from previously negative momentum.
A bearish setup requires the MACD line to cross below the signal line while both remain above the zero line, indicating weakening bullish momentum before potential downside continuation.
Stage 2 – Trend Direction
After a valid MACD crossover is detected, price location relative to the selected EMA determines the higher-level trend.
Long signals require price above the EMA.
Short signals require price below the EMA.
This prevents taking counter-trend MACD crossovers.
Stage 3 – Trend Strength
The indicator then evaluates ADX.
Signals are only accepted when ADX exceeds the user-defined threshold, indicating that directional movement has sufficient strength. When enabled, this filter attempts to reduce signals generated during low-volatility consolidation periods.
Stage 4 – Session Validation
Finally, signals are restricted to the selected trading sessions.
By default, only London and New York sessions are considered valid. These periods generally coincide with higher market participation and increased liquidity compared with quieter trading hours.
Only when all four stages agree is a signal plotted.
Signal Workflow
Bullish Signal
MACD crosses above its signal line.
MACD remains below zero.
Price trades above the EMA trend filter.
ADX exceeds the minimum strength threshold (optional).
The current bar occurs during an enabled trading session (optional).
A bullish signal is displayed.
Bearish Signal
MACD crosses below its signal line.
MACD remains above zero.
Price trades below the EMA trend filter.
ADX exceeds the minimum strength threshold (optional).
The current bar occurs during an enabled trading session (optional).
A bearish signal is displayed.
Why This Indicator Is Different
Many MACD-based scripts generate signals immediately after every crossover.
This indicator instead applies a layered validation process where each filter serves a distinct analytical purpose:
MACD identifies the momentum shift.
The EMA confirms the broader directional bias.
ADX measures whether the market is exhibiting sufficient directional strength.
The session filter limits signals to predefined periods of higher market activity.
Rather than operating as independent indicators displayed together, these components form a sequential decision process where each stage must validate the previous one before a signal is produced.
Inputs
The indicator allows customization of:
MACD fast, slow, and signal periods
EMA length
ADX length
Minimum ADX threshold
London session
New York session
Enable/disable ADX filtering
Enable/disable session filtering
Alerts
Built-in alert conditions include:
Bullish Signal
Bearish Signal
Alerts trigger only after all enabled validation stages have been satisfied.
Practical Usage
The indicator is intended for traders who prefer trading with the prevailing market direction rather than reacting to every MACD crossover.
Because multiple filters must align, signal frequency is intentionally lower than a standard MACD indicator. Traders may use the signals alongside their own price action analysis, support and resistance levels, or risk management rules.
Limitations
Signals are generated only after bar confirmation.
Strong trends may still produce losing trades during rapid market reversals.
Session filtering may exclude valid opportunities occurring outside the selected trading hours.
ADX measures trend strength but does not indicate future price direction.
The indicator is designed as a confirmation tool and should not be relied upon as the sole basis for trading decisions.
Notes
This script is intended for educational and analytical purposes. It visualizes a structured validation process that combines momentum, trend direction, trend strength, and trading session timing into a single signal-generation workflow. As with any technical indicator, outputs should be evaluated within a broader trading plan that includes appropriate risk management. 指标

All In One#ALL IN ONE. This was developed to take into account all major functions which influence the price and trying to detect trend and reversal as early and as accurately as possible. It takes into account pretty much everything except the options influence and delta. This one tool combined with options data is very powerful. Weeks worth of backtesting has helped to refine this and make it better.
" THIS IS INTENDED FOR DAILY TIMEFRAME"
This is a multi-layered trading indicator that combines market structure analysis, volume profiling, momentum scoring, early reversal detection, and a regime-aware quality grading system into one tool. Here's everything it measures and why each piece matters.
### 1. Market Structure (BOS / CHoCH)
Tracks pivot highs/lows at a configurable length and detects when price breaks structure — a **Bull CHoCH** (Change of Character) when price crosses above the last swing high while not already in an uptrend, and the mirror for bear. Each break also auto-draws an **Order Block** (the last opposing candle before the move) which stays active until "mitigated" (price trades back through it). This tells you where institutional footprints likely sit and whether the prevailing trend has structurally shifted.
### 2. Internal Structure (iBOS / iCHoCH)
Same logic as above but on a tighter pivot length, capturing minor/internal structure shifts inside the larger trend — useful for spotting early continuation or internal pullback completion before the major structure reacts.
### 3. Fair Value Gaps (FVG)
Detects 3-candle price voids (`low > high ` for bull, `high < low ` for bear) and boxes them as unmitigated liquidity/imbalance zones. They persist until price trades back through the gap, marking areas the market is statistically likely to revisit.
### 4. Premium / Discount Zones
Splits the current swing range at its midpoint (equilibrium) and labels price as trading in Premium (expensive, sell-side bias) or Discount (cheap, buy-side bias)
### 5. Multi-Timeframe Trend (1H / 4H / 1D)
Independently calculates SMC trend direction on three timeframes using `request.security`, giving you confluence/alignment confirmation rather than relying on a single timeframe's noise.
### 6. Volume Analysis Suite
Includes relative volume vs. a moving average, up/down volume ratio (50-bar cumulative buy vs. sell pressure), VolBuzz (% above/below average), and HVE/HV1 tagging (highest volume ever / highest in the past year) — flags genuine institutional participation vs. routine volume.
### 7. Momentum Score (0-100)
A weighted composite of RSI, EMA stack position, MACD histogram, volume-confirmed candle strength, and body-size-vs-ATR — condensed into a single normalized score so you don't have to read five separate oscillators.
### 8. Early Reversal Detection Engine
The most complex subsystem — combines RSI divergence, liquidity sweeps, wick rejection, volume climax, ATR-extension snapbacks, Williams %R hooks, and MTF trend agreement into a weighted 0-100 reversal score, with cooldowns and CHoCH-based filters to avoid fighting strong trends. Flags both "Early" and "Strong" reversal grades.
### 9. Relative Strength (RS) vs. Benchmarks
Compares the symbol's performance against SPY, QQQ, and a sector ETF (e.g., XLK) over a lookback window — tells you if you're trading a leader or a laggard relative to the market.
### 10. Regime Detection
Classifies the current environment as Bull Trend, Bear Trend, Compression, Expansion, or Range/Chop using MTF trend alignment plus Bollinger Band-width contraction/expansion — context that changes how every other signal should be interpreted.
### 11. Quality Score (the regime-aware grading system we just built)
This is the unifying layer — it takes Trend, Structure, Liquidity/Trend-Health, Volume/Trend-Momentum, Momentum, RS, and Candlestick sub-scores and combines them into a single 0-100 grade (A+ Setup → Avoid). Critically, it **switches scoring logic** depending on whether the market is in a clean trend (rewards trend health and sustained pressure) or a setup/chop phase (rewards sweep + discount + volume climax entry conditions) — so the same dashboard works whether you're trend-following or hunting reversals.
### 12. Dual Dashboard Display
One table gives you the full multi-timeframe/volume/momentum snapshot at a glance; the second breaks down exactly how the quality score was built, sub-score by sub-score, so you can see *why* a setup is graded the way it is rather than trusting a black-box number.
---
### Why it's a full package
Most retail indicators give you structure or FVGs or volume — rarely all of them reconciled into one coherent decision layer. This tool's real value is that the **quality score forces every other module to agree before it tells you something is good** — trend, structure, liquidity, volume, momentum, and relative strength all have to contribute, and the regime switch stops the score from unfairly penalizing a healthy trend just because it doesn't look like a textbook reversal setup. It's built to answer one practical question — "is this actually a good trade right now, and why" — using everything else in the script as supporting evidence rather than standalone signals you'd have to mentally reconcile yourself.
## Operating Notes: Interpreting Reversal Signals in Strong Trends
When multiple timeframe and momentum readings align in one direction, confirm volume support on the lower timeframes (4H and 1H Vol Buzz) before acting on a reversal signal. A reading above +25% on those timeframes adds meaningful confirmation.
Case Study: A High-Score Signal That Failed to Reverse the Trend
In late September, the indicator fired an Early Bear Reversal at a score of 85/100. Price nonetheless continued making higher highs through November and December. Reviewing the dashboard at the signal bar: all three SMC timeframes (1H, 4H, 1D) were Bullish, the Momentum Score read 84/100 (Strong Bull), and RSI stood at 72. Every component of the bear reversal score was technically valid — the engine correctly identified local exhaustion. But local exhaustion within a strong trend typically resolves as a brief pause or shallow pullback, not a structural reversal.
Principles for Evaluating Reversal Signals
A high reversal score indicates conditions for a reversal, not a confirmed trend change. The score reflects exhaustion, not capitulation. In a strong uptrend, even a textbook bear setup often resolves as a 2–5% pullback before the primary trend resumes.
Multi-timeframe alignment is the primary filter. When 1H, 4H, and 1D structure are all bullish, bear reversal signals should be treated with significant skepticism. At minimum, the 4H or 1D trend should flip bearish before a bear reversal signal carries real weight.
RSI divergence loses reliability in strong trends. RSI can remain overbought for extended periods during sustained moves. Divergence frequently fires early and is repeatedly overridden by continued price advance, leading to premature short entries or unwarranted exits from long positions.
ATR band position is a key qualifier. A reversal signal carries limited weight if price is only touching the inner or outer band edge. The signal gains weight when price has pushed deep into the outer ATR zone (Band 2) and begins closing back inside it — indicating an actual mean-reversion event rather than ordinary extension.
Momentum Score should be deteriorating, ideally below 50, before a bear reversal is trusted. A reading of 84/100 indicates the underlying trend engine remains fully intact. A credible reversal candidate shows momentum already declining over several bars, not holding at trend-strength levels.
Vol Buzz and U/D Ratio confirm whether genuine selling pressure is present. A bear reversal signal has substantially more weight when accompanied by elevated Vol Buzz on down candles and a U/D ratio below 0.8. Absent that confirmation, the apparent reversal more likely reflects a temporary pause in buying rather than active distribution.
Structural confirmation is required before acting. A reversal score fires on a single bar, but a credible reversal requires confirmation through an actual structure break — at minimum a Bear CHoCH on the 4H or Daily timeframe. Until that print occurs, the prevailing trend remains intact and reversal signals should be treated as alerts to monitor rather than instructions to trade.
Summary Framework
A high reversal score functions as an early warning, not an entry trigger. It indicates that conditions are favorable for a reversal — comparable to a weather forecast calling for a storm that does not always materialize. Confirmation should be sought through structural breaks, volume validation, or multi-timeframe alignment before any position is taken against the prevailing trend. As a standing rule: do not take a position against a strong, multi-timeframe-confirmed trend on the strength of a single reversal signal, regardless of score. Wait for a second signal or for structure to break first. 指标

ZH Market FilterBackground coloring (the core filter) paints the chart by market regime, based on Qullamaggie's MA idea. It compares a fast MA (10) and slow MA (20), and checks whether each is trending up versus 5 bars ago:
* Dark green — 10 above 20, both trending up (strongest)
* Light green — 10 above 20, only the 10 trending up (early/weakening)
* Yellow — 10 above 20, neither trending up (stalling)
* Black — anything else (downtrend or chop)
Plotted lines: the 10-MA (red) and 20-MA (black), plus three toggleable reference SMAs — 50 (blue), 100 (orange), 200 (purple).
Range-bound override lets you mark a consolidation manually. You enter four things: Range Top, Range Bottom, Start Date, and Range Color. From the start date forward, the background paints your chosen color — overriding the MA coloring — because you've called it range-bound. It ends automatically on the first candle that closes above the top or below the bottom, then reverts to the normal MA coloring for good. It's one range per start date (move the date forward to mark a new one), and it triggers on closes, not wick pokes.
Metrics table (top-right) shows two readouts, pulled exactly from your ZH indicator:
* QQQ — QQQ's daily % change
* BRD — breadth, calculated as (new highs − new lows) / new lows × 100 from ATHI.US and ATLO.US
Labels are white; values are green when positive, red when negative.
A few practical notes: it's Pine v6, the metrics need ATHI.US/ATLO.US data on your plan (they work in your ZH script, so you're set), and if you leave the range prices at 0 it simply won't paint — no more flattened chart. One thing to keep in mind on the range start date: it has to be a date that exists on the chart, not in the future, or nothing paints. 指标
