Darvas Box Theory [Alpha Extract]A sophisticated momentum breakout and trend-continuation framework based on Nicolas Darvas’ classic box theory, rebuilt with modern confirmation filters, adaptive risk management, and real-time trade-state tracking. This indicator identifies consolidation ranges, validates breakout conditions through volume and trend confirmation, manages long-side breakout entries, trails stops through higher boxes, and displays a live status dashboard for complete market structure awareness. By combining box compression, volatility filtering, breakout validation, and structured stop logic, the system provides a clean and disciplined framework for trading momentum expansion after consolidation.
🔶 Advanced Darvas Box Detection Engine
Implements a dynamic Darvas box construction model that identifies price consolidation ranges using configurable confirmation bars. The system continuously scans recent market structure, defines the highest high as the box ceiling, the lowest low as the box floor, and validates the range only when the box meets minimum volatility-adjusted height requirements.
candidateTop = ta.highest(high, boxLen)
candidateBottom = ta.lowest(low, boxLen)
heightOk = (candidateTop - candidateBottom) >= atr * minBoxAtr
This ensures boxes are not created from meaningless low-range noise and instead represent tradable compression zones with enough structure to support breakout analysis.
🔶 ATR-Filtered Box Quality Control
Features an adaptive box validation system using Average True Range to measure whether a box has enough height relative to current market volatility. Traders can adjust the Minimum Box Height setting to control how selective the indicator becomes.
A lower ATR threshold creates more boxes and more frequent signals, while a higher threshold filters out weak consolidations and focuses only on larger, cleaner market structures.
🔶 Optional Rising Box Requirement
Includes an optional rising-box filter designed for classic Darvas-style momentum trading. When enabled, the system only accepts new boxes if their ceiling is higher than the previous box top, helping traders focus on progressive bullish structure and avoid lower-quality sideways chop.
This is useful for traders who want to trade continuation setups only when the market is forming higher price ranges.
🔶 Breakout Confirmation Framework
Provides flexible breakout detection using either candle close confirmation or wick-based confirmation. Close mode requires price to close beyond the box boundary for stronger confirmation, while Wick mode reacts as soon as price trades beyond the box level for faster but more aggressive signals.
upBreakRaw = boxReady and (breakoutMode == "Close" ? close > boxTop : high > boxTop)
longSignal = breakoutUp and volumeOk and trendOk
This allows traders to choose between conservative confirmation and faster momentum detection depending on their strategy style.
🔶 Volume Breakout Validation
Integrates volume confirmation to help filter weak breakouts and highlight expansion moves supported by stronger market participation. The system compares current volume against a moving average baseline and requires breakout volume to exceed a configurable multiplier.
This helps identify breakouts with real participation rather than low-volume fakeouts.
🔶 Trend Filter Integration
Uses a configurable EMA trend filter to align breakout signals with the broader market direction. When enabled, long breakout signals are only accepted when price is trading above the selected trend EMA.
This keeps the system focused on momentum continuation setups rather than counter-trend breakouts with weaker follow-through potential.
🔶 Automated Darvas Trade State Engine
Transforms box breakouts into a structured trade-management framework. When price breaks above a completed box with valid trend and volume confirmation, the system enters a long trade state, stores the entry price, initializes the stop level, and begins live trade tracking.
The indicator then monitors whether price continues into higher boxes, generates add signals, or exits when the stop or downside breakdown condition is triggered.
🔶 Add Signal & Higher Box Continuation Logic
Features higher-box continuation logic that identifies additional momentum opportunities while already in a long position. If a new confirmed breakout occurs above the original entry price while the trade is active, the system generates an Add signal and updates the trade structure.
This helps traders scale into trending moves as the market builds new Darvas boxes above the previous structure.
🔶 Adaptive Stop Management System
Provides three different stop modes for flexible risk management:
• Box Floor — places the stop at the bottom of the Darvas box.
• Breached Ceiling — uses the breakout ceiling as the protective reference.
• ATR — applies a volatility-adjusted trailing stop based on ATR.
baseStop = stopMode == "Breached Ceiling" ? boxTop : stopMode == "ATR" ? src - atr * atrStopMult : boxBottom
exitSignal := tradeState == 1 and (src < trailStop or breakoutDown)
This allows traders to choose between structural, breakout-level, or volatility-based protection depending on their trading approach.
🔶 Trail Stop To Higher Boxes
Includes automatic stop advancement as price confirms higher boxes. When enabled, the stop trails upward with stronger box structures, helping lock in gains while allowing the trend to continue.
This creates a disciplined trend-following system that protects profits without exiting too early during strong momentum phases.
🔶 Breakdown & Exit Logic
Implements clean exit handling when price falls below the active trailing stop or breaks down through the box floor. This gives the system a defined invalidation structure and prevents trades from remaining active after momentum has failed.
Exit markers are displayed directly on the chart for fast visual confirmation.
🔶 Real-Time Status Dashboard
Features a compact live dashboard displaying the most important Darvas trade and box information in real time. The table shows:
• Current trade state
• Box top
• Box floor
• Volume ratio
• Trend filter status
• Distance to breakout
• Box height relative to ATR
• Open R multiple
This gives traders an immediate overview of whether the market is forming a box, preparing for breakout, actively in a trade, or filtered by trend/volume conditions.
🔶 Clean Visual Box Architecture
Creates a clear visual representation of forming and completed Darvas boxes using configurable colors, transparency, top and bottom level lines, breakout markers, exit markers, and optional grey candle overlay. Forming boxes are displayed separately from completed bullish or bearish boxes, making it easy to distinguish live consolidation from confirmed breakout structure.
The system also manages historical box limits automatically to keep charts clean and prevent visual overload.
🔶 Performance Optimization & Historical Box Management
Uses efficient array-based storage and automatic cleanup logic to manage historical boxes, lines, and chart objects. Traders can control how many completed boxes remain visible, allowing the indicator to preserve historical context while maintaining smooth TradingView performance.
This makes the tool suitable for both short-term and long-term chart analysis.
🔶 Comprehensive Alert System
Includes alert conditions for the most important Darvas events:
• Darvas Box Buy
• Darvas Box Add
• Darvas Box Exit
These alerts allow traders to monitor breakout opportunities, continuation setups, and invalidation events without watching the chart constantly.
🔶 Why Choose Darvas Box Theory ?
This indicator modernizes the classic Darvas Box strategy by combining traditional breakout structure with advanced confirmation logic, volatility filtering, dynamic stop management, and real-time trade monitoring. Instead of simply drawing static boxes, the system evaluates whether each range has enough volatility, confirms whether breakouts are backed by volume, checks whether price is aligned with the broader trend, and then manages the trade through structured stop logic.
The result is a clean momentum trading framework designed to help traders identify compression, wait for confirmed expansion, manage entries with discipline, scale into higher-box continuation, and exit when the structure fails. Perfect for trend-following traders, breakout traders, swing traders, and systematic momentum traders looking for a more complete version of the classic Darvas Box methodology.
指标

Aurelian Structure Engine [JOAT]Aurelian Structure Engine
Introduction
Aurelian Structure Engine is a market structure and execution-context model that combines confirmed pivots, break events, HTF bias, anchored value, relative volume, and pressure scoring. It is built to separate meaningful structural breaks from ordinary candle noise.
This open-source indicator is designed as a context tool, not a standalone trading system. It focuses on explaining the current market state with restrained visuals and confirmed-bar logic where signals are used.
Core Concepts
1. Confirmed Swing Structure
Swing highs and lows are confirmed with pivot logic before the script evaluates breaks. ATR buffering helps prevent small wick violations from becoming structure events.
2. Bid and Offer Block Geometry
Recent opposing candles can become bid or offer blocks only when their vertical placement makes structural sense. Invalidated or overlapping blocks are removed.
3. Anchored Value Context
An EMA and yearly anchored VWAP stack define whether price is operating above or below value.
4. Tiered Quality Score
Pressure, RVOL, HTF bias, structure, and proximity are converted into B, A, and A+ style states.
bullScore = structure + pressure + rvol + htfBias + valueContext
Features
Confirmed BOS and CHoCH-style structure tracking
Bid and offer blocks with invalidation logic
EMA/VWAP value spine and structure bands
Volume pressure and RVOL scoring
A/B/A+ state labels and compact dashboard
Input Parameters
Swing pivot length and ATR buffer
Block search and extension controls
HTF bias timeframe
Pressure, RVOL, cooldown, and A+ score gates
Display toggles for bands, blocks, candles, and panel
How to Use This Script
Read the structure side first, then check whether pressure, RVOL, and HTF bias confirm the break. A+ labels require stronger agreement than A or B labels.
Limitations
The script uses historical OHLCV data and cannot know future prices.
Signals and states can be late during fast reversals because confirmed-bar logic is used to reduce repainting.
Model outputs should be interpreted with market context, risk controls, and independent analysis.
No visual state should be treated as a certain trade outcome.
Originality Statement
Aurelian is original in combining guarded bid/offer block geometry, confirmed structure, anchored value, and multi-factor signal quality into one restrained overlay.
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice, investment advice, or a recommendation to buy or sell any financial instrument. All calculations are derived from historical market data and may produce inaccurate readings in some market conditions. No indicator can predict future market behavior. Use proper risk management and independent judgment.
-Made with passion by jackofalltrades
指标

ATR & Fibonacci Expansion ZonesATR & Fibonacci Expansion Zones is a multi-mode ATR framework designed to help traders read price location, volatility expansion, session structure, and active high/low range context. The script is built around a simple but powerful idea: ATR levels can provide a volatility-adjusted map of how far price has moved from a meaningful close reference. From there, the workflow adds flexible mode selection, organized ATR labels, optional historical ATR periods, mode-aware AVWAPs, active high/low zones, and fibonacci labels that correspond to a respective level within the enabled mode.
────────────────────────────
Core Idea
────────────────────────────
ATR (actual true range) is powerful because it gives price movement a volatility-adjusted frame of reference.
This script helps traders evaluate:
• How far price has expanded from the selected close anchor
• Whether price is still near the first ATR expansion zone or already extended
• Whether price is approaching a major +1, +2, +3, or +4 ATR area
• Whether price is reacting around an active session high/low zone
• Where price is trading inside the active session fibonacci range
• Which ATR mode best frames the current move: Daily, Multiday, Swing, Position, or Long-Term
That makes the script useful for intraday context, multiday moves, swing structure, position-style tracking, and longer-term range mapping.
────────────────────────────
ATR Modes
────────────────────────────
The script renders one selected ATR engine at a time. This keeps the chart cleaner than stacking multiple ATR families together.
Included modes:
Daily
Uses the daily ATR framework. Best for day/session-level context on intraday charts.
Multiday
Uses the weekly ATR framework. Best for trades developing across multiple sessions.
Swing
Uses the monthly ATR framework. Best for larger swing-style movement.
Position
Uses a 3-month ATR framework. Best for broader position-style context.
Long-Term
Uses a 12-month ATR framework. Best for major range structure and larger macro-style moves.
All modes can render the full 23.6% through 400% ATR expansion range, with separate line and label controls for each major range block.
────────────────────────────
ATR Expansion Grid
────────────────────────────
The main ATR grid plots upper and lower ATR expansion levels from the selected close anchor.
The grid includes:
• 23.6% to 100%
• 123.6% to 200%
• 223.6% to 300%
• 323.6% to 400%
Each range has its own parent Show / Hide controls for lines and labels, plus child controls for upper and lower sides. This makes it easier to keep the chart simple when only the closer ATR levels matter, or expand the full map when price is making a larger move.
The labels can show:
• ATR ratio
• ATR level price
• selected mode tag
• percent distance from current price
That percent-from-price read helps make the grid more practical because you can quickly see how close price is to the next ATR level instead of visually estimating it or using the info line tool.
────────────────────────────
Previous / Current Close Reference
────────────────────────────
The PCL / CC line and label show the active close reference used by the selected ATR grid. Depending on the selected mode and settings, this can represent:
• Previous Close
• Current Close
• Daily close reference
• Weekly close reference
• Monthly close reference
• 3-month close reference
• 12-month close reference
The label can also show close-to-close percent change and RSI(14) from the selected ATR timeframe. This is important because the close anchor is the foundation of the ATR grid. The script keeps that reference visible so the user can see exactly where the ATR expansion map begins.
────────────────────────────
ATR Session AVWAPs
────────────────────────────
The script includes mode-aware ATR Session AVWAPs. These are not static VWAPs. They follow the currently selected ATR mode. Depending on the mode, the AVWAP set can reset from:
• the active day/session
• the active week
• the active month
• the active 3-month period
• the active 12-month period
Included AVWAP paths:
• Session VWAP
• High AVWAP
• Low AVWAP
The Session VWAP starts from the active ATR period/session start. The High AVWAP anchors from the candle that creates the active period high. The Low AVWAP anchors from the candle that creates the active period low. When a new active high or low forms, the matching AVWAP re-anchors.
In practical terms:
• ATR levels show volatility expansion from the selected close anchor
• AVWAPs show volume-weighted behavior from the active period structure
• High/Low AVWAPs help track how price behaves after major active-period extremes form
This adds a useful volume-weighted layer around the ATR map.
────────────────────────────
ATR Session High / Low Boxes
────────────────────────────
The script can also draw active high and low boxes for the selected ATR session or period.
The High Box starts from the candle that creates the active high.
The Low Box starts from the candle that creates the active low.
These boxes are wick-based, which makes them useful for highlighting rejection zones, liquidity wicks, exhaustion candles, or important high/low reference areas inside the active ATR period.
────────────────────────────
ATR Session Fibonacci Labels (levels)
────────────────────────────
ATR Session Fibonacci Labels add another layer of context beside the ATR grid.
The ATR grid answers:
“How far has price expanded from the selected close anchor?”
The session fib labels answer:
“Where is price trading inside the active high-to-low range?”
The fib labels use the same active high and low tracked by the AVWAP and high/low box engines.
Direction is inferred automatically:
• If the low formed before the high, the script treats it as a bullish session leg
• If the high formed before the low, the script treats it as a bearish session leg
The fib labels can show:
• fib ratio
• price
• percent distance from current price
This creates a clean second layer of structure: ATR levels for expansion, fib labels for internal active-range location.
────────────────────────────
Historical ATR Periods
────────────────────────────
The script includes an optional Historical ATR Periods mode. When enabled, prior ATR grid segments can remain visible for a user-defined number of completed ATR periods.
This is useful for reviewing:
• how price respected previous ATR levels
• where prior extensions acted as support or resistance
• whether price repeatedly reacted around certain volatility zones
• how current ATR behavior compares to prior periods
Historical labels are intentionally excluded to keep the chart cleaner. The historical mode focuses on line segments only.
────────────────────────────
Asset-Aware Behavior
────────────────────────────
The script includes separate behavior for stocks, crypto, and futures.
For stocks and funds:
• ATR calculations can use regular or extended-session source data
• Daily lines can start from regular open or extended open
• Daily AVWAPs, boxes, and fib labels can reset from the extended-session / premarket day start when available
• Higher-timeframe stock modes wait for the first regular-hours bar of the new period for cleaner visual alignment
For crypto:
• the chart ticker is used
• Daily mode resets once per calendar day
For futures:
• the chart ticker is used
• Daily mode uses a Globex-style 5:00 PM Central session boundary
• higher-timeframe modes reset from the selected W / M / 3M / 12M ATR period boundary
This makes the script more flexible across different asset classes instead of treating every market like a regular-hours stock chart.
────────────────────────────
How I Use It
────────────────────────────
I use this script as a volatility and structure map.
A few practical ways to read it:
• Daily mode helps frame intraday price movement around the active daily ATR grid
• Multiday mode helps show where price is trading inside the weekly ATR structure
• Swing mode is useful when the daily chart is too narrow and the monthly range matters more
• Position and Long-Term modes help zoom out and understand broader extension zones
• PCL (previous close) / CC (current close) keeps the close anchor visible
• The Auto close-anchor setting is especially useful for Daily stock mode because it automatically adapts between Current Close during New York premarket / after-hours and Previous Close during regular market hours
• This means the ATR grid can stay aligned with the session environment without forcing the user to manually decide when to use PCL or CC
• During premarket and after-hours, Current Close helps the levels respond to the active extended-hours move
• During regular hours, Previous Close keeps the main daily ATR map anchored to the completed prior session
• The price guide dash makes it easier to line up current price with the ATR label column
• High/Low Boxes help mark active wick-based extremes
• Session AVWAPs add a volume-weighted path from the active period and its extremes
• Session Fib Labels show internal retracement context inside the active high/low range
• Historical ATR Periods help review how price behaved around prior ATR grids
The Auto close-anchor behavior is one of the most practical parts of the workflow. Premarket and after-hours trading can make a static previous-close grid feel disconnected from the live move, while regular-hours trading often benefits from keeping the prior close as the main reference. Auto handles that transition in the background so the ATR levels remain tied to the most relevant close reference for the active session. In other words, you don't have to decide when to use "Use Current Close" depending on if your'e in pre-market or regular trading hours.
The value of this script is organization. It brings ATR expansion, close-reference context, session extremes, AVWAP structure, and active-range fib location into one chart-side workflow.
ATR levels by themselves can already be useful but this script expands that idea into a fuller range map so traders can better judge whether price is early in a move, pressing into extension, reacting from an active extreme, or moving through a broader volatility structure.
────────────────────────────
Attribution
────────────────────────────
This script is a modern rebuild inspired by Saty’s ATR Levels concept and my original ATR Levels publication.
Special thanks to SimpleCryptoLife for past help and inspiration around improving the original ATR Levels workflow and for the Significant Figures library used for cleaner number formatting.
As always, this is a visual context tool. It is not meant to replace risk management, market structure, support/resistance, volume analysis, or a complete trading plan.
────────────────────────────
A Few Chart Examples
────────────────────────────
指标

Trendline Break Detector [TBD]# Trendline Break Detector
A structural analysis indicator that identifies pivot trendline breaks across three independent pivot tiers (Fast / Medium / Slow) and rates every break with a single 0–12 Break Strength score. The score summarises both the quality of the break itself and the broader trend context surrounding it.
This is a structural analysis tool, not a signal generator. It marks where pivot structures break and how cleanly. It does not place trades or suggest entries, exits, targets, stops, or position sizes. The arrows are descriptive annotations of market structure.
────────────────────────────────────
WHAT THE INDICATOR DRAWS
────────────────────────────────────
• Swing trendlines built from pivot points, at three configurable timescales (Fast / Medium / Slow tiers, default lengths 8 / 21 / 34) drawn simultaneously
• Direction arrow labels at the exact bar where each pivot trendline is broken, showing:
- The tier's pivot length (e.g. 21)
- The direction arrow (▲ upward break / ▼ downward break)
- The Break Strength score (e.g. ·9) in the range 0–12
• Confluence S/R zones (optional) — coloured boxes showing where multiple support/resistance sources cluster together, scored 0–10
• Status Panel — a compact 5-row overlay summarising active tiers, the most recent break, its score, current trend context (VWAP, ER, HTF), and how many filter gates are active
────────────────────────────────────
WHY FIBONACCI PIVOT LENGTHS (8 / 21 / 34)?
────────────────────────────────────
The three default tier lengths are not arbitrary — they are consecutive terms from the Fibonacci sequence (1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144 ...). Three properties of the Fibonacci sequence make it especially well suited to a multi-tier pivot indicator:
1. The ratio between consecutive terms approaches the golden ratio (φ ≈ 1.618).
8 → 21 is roughly 2.6× (skipping a term gives the φ² ratio of ~2.618), and 21 → 34 is roughly 1.62× (φ itself). This means each tier is meaningfully separated from the next on a logarithmic scale, so the three tiers detect genuinely different timescales of structure rather than near-duplicates. If you used 8 / 10 / 12 instead, all three tiers would fire on essentially the same pivots.
2. Fibonacci-spaced lookbacks produce naturally diverse signals.
A pivot of length N requires N bars on each side without a higher high (or lower low). Fibonacci spacing ensures that the bar requirement at each tier grows non-linearly: the Fast tier (8) reacts to short-term swings, the Medium tier (21) to swings roughly half an hour to a few hours apart on intraday charts, and the Slow tier (34) to the major intraday or multi-session structure.
3. Fibonacci numbers and ratios are deeply established in technical analysis literature.
Pivot lengths drawn from Fibonacci values are widely used because they produce repeatable, recognisable swing structures across many instruments. The 8 / 21 / 34 choice is a balanced midpoint of the sequence — small enough to catch intraday structure, large enough to filter out tick-level noise.
You can override the defaults. All three tier lengths are exposed as inputs (Pivot Lengths group). If you prefer Wilder's classic 14, a tighter set like 5 / 13 / 21, or a slower set like 13 / 34 / 89, simply change them.
────────────────────────────────────
MULTI-INSTANCE TECHNIQUE FOR HIGHER-TIMEFRAME CONTEXT
(RECOMMENDED FOR LOW TIMEFRAMES)
────────────────────────────────────
The indicator's three tiers cover roughly one decade of timescale separation (8 → 34 is ~4×). On very low timeframes — 1m, 3m, 5m — that single decade often is not enough to see the whole structural picture. The Fast tier (length 8 on 1m = ~8 minutes) and the Slow tier (length 34 on 1m = ~34 minutes) both live inside what a 15m or 1H trader would consider a single bar.
The cleanest way to get true multi-timeframe context without changing chart is to apply the indicator multiple times to the same chart with different pivot length sets, like this:
| Instance | Fast | Medium | Slow | What it captures (on a 1-minute chart) |
|---|---|---|---|---|
| 1 — Local | 8 | 21 | 34 | Sub-minute to ~30-minute structure |
| 2 — Intermediate | 21 | 34 | 55 | ~20-minute to ~1-hour structure |
| 3 — Context | 34 | 89 | 144 | ~30-minute to ~2.5-hour structure |
All three instances run on the same 1-minute chart, but each one sees a different timescale of structure. The lengths share consecutive Fibonacci values across instances (34 appears in all three; 21 in two; 55 in two), so the tiers chain together coherently rather than fighting each other.
How to read the stacked instances:
• When a high-score break fires on Instance 3 (slowest), you are seeing a major structural event on a higher timeframe — the kind of break that typically initiates trends.
• When a high-score break on Instance 1 (fastest) lines up with the direction of recent Instance 2 / Instance 3 breaks, the smaller break is occurring with-trend on the higher timeframe.
• When Instance 1 breaks against the established Instance 3 direction, treat it as a counter-trend or mean-reversion event.
Practical setup tips:
• Disable the Status Panel on two of the three instances (Settings → Status Panel → Show Status Panel) to avoid stacked panels. Keep it visible only on the most-watched instance.
• Use the Style settings to give each instance a slightly different colour so the labels remain distinguishable on the chart.
• Disable trendline drawing on the faster instances if the chart gets cluttered (Trendlines → Show Trendlines off) — you can still see the break arrows.
This stacking technique gives you genuine higher-timeframe structural context without ever switching timeframes, which is particularly useful for scalpers and intraday traders who want to read the higher-TF tape while watching execution-grade bars.
────────────────────────────────────
HOW TO INTERPRET THE BREAK STRENGTH SCORE (0–12)
────────────────────────────────────
The score is a descriptive summary of structural properties, not a probability of profit or a recommendation. Higher scores indicate that the break occurred with more of the supporting structural conditions in place (and earlier in the broader trend). They do not guarantee the move continues.
A useful way to read the score band by band:
| Score | Band | What it means structurally |
|---|---|---|
| 0–3 | Very Low | The break occurred without most supporting conditions — small magnitude, low volume, weak pivot, or strong intrabar rejection. Often these are wicks, false breaks, or last-leg moves in already-extended trends. Treat with caution. |
| 4–6 | Low | Some quality conditions met but several are missing. The break is real but unremarkable. Common in chop or transitional regimes. |
| 7–8 | Medium | The break meets most of the structural quality criteria — meaningful magnitude, decent participation, reasonable pivot height. The trend context is mixed (not strongly established yet, not absent). These are the bread-and-butter breaks. |
| 9–10 | High | Most Break Quality criteria are met AND the break occurs ahead of (or at) a structural inflection rather than late in an established trend. These tend to be the cleanest setups the indicator flags. |
| 11–12 | Very High | All-or-near-all Break Quality criteria fire AND the broader trend is not yet established in the break direction — i.e., the break itself is the structural turn. Rare. |
Important nuances about the score:
1. The score is path-dependent on which filter gates you have active.
If you turn off every filter, you will see every break the engine detects regardless of score. If you turn on stringent filters (Adaptive Trail Strict, VWAP Require-strong-aligned, Confluence Zone gate), you will only see breaks that already pass those gates, and the displayed scores will tend to skew higher. Pick a filter configuration and stick with it so the scores remain comparable across your charts.
2. Higher score ≠ better trade.
A high score means the break occurred with strong structural properties. Whether that creates a tradeable opportunity depends entirely on your strategy, risk management, position sizing, and the current market regime. A score of 10 in a choppy range is still a break in a choppy range.
3. The (5 − Trend Context) inversion deliberately penalises late breaks.
A perfectly clean break in an already-established trend will score lower than the same clean break at a fresh turning point. This is intentional: the indicator's design thesis is that quality breaks occur AT structural inflection points, not after them. If you prefer with-trend breakouts to count fully, disable the Trend Context component in the inputs and the score will become Break Quality alone (range 0–7).
4. The score is computed on bar close.
Mid-bar values shown intrabar may revise before close. Treat the displayed score as final only after the bar closes.
5. Compare scores within the same symbol and timeframe.
Because ATR and volume have different magnitudes across symbols and timeframes, comparing a score of 8 on EURUSD-1m to a score of 8 on BTCUSD-1h is not strictly apples-to-apples. The score is most informative as a relative measure within a single chart context.
6. Combine score with tier.
A score of 8 on the Slow tier represents a higher-significance structural event than a score of 8 on the Fast tier, because the Slow-tier trendline took longer to build and represents broader structure. When reading the chart, weight Slow-tier breaks more heavily than Fast-tier breaks at the same score.
7. Use the multi-instance technique to validate scores.
When using three stacked instances (as described above), the most informative situations are those where a high score on the slower instance (e.g. Context 34/89/144) lines up directionally with a high score on the faster instance (e.g. Local 8/21/34). Alignment across instances is a stronger signal than any single instance's score in isolation.
────────────────────────────────────
WHY THIS IS A MASHUP, AND WHY THE COMPONENTS BELONG TOGETHER
────────────────────────────────────
A trendline break, on its own, is a low-information event. The same break can be either a high-quality structural rupture from a long compressed base, or a meaningless poke through a noise-level pivot inside chop. To tell those apart in a reproducible way, you need to measure several independent properties of the break event AND the trend context surrounding it.
This script combines the components below for that single purpose. Each one answers a question the others cannot answer alone. Every one of them feeds into the final 0–12 Break Strength score.
1. Multi-tier swing pivot engine (three parallel tiers)
The core. Builds and tracks pivot-based trendlines at three configurable timescales simultaneously and detects when each is broken. Each tier runs an independent state machine. Three tiers exist because breaks of micro-structure, intermediate structure, and major structure carry very different meaning.
2. ATR (Average True Range)
The volatility yardstick. Used to normalise break magnitude, pivot height, and range expansion across symbols and timeframes. ATR shows up in four of the seven Break Quality components.
3. Kaufman Efficiency Ratio (ER)
Computed as:
|close − close | / sum(|close − close |, N)
Detects pre-break compression: low ER (chop) followed by rising ER (release) = coiled-spring break setup. Answers a question no other component answers — what was the market doing in the bars leading up to this break?
4. Volume vs 20-bar SMA
Confirms participation at the break. A break with above-average volume is structurally different from a break on dead volume.
5. Session VWAP gradient
Standard session-anchored VWAP, plus the slope of VWAP normalised to ATR units. A pivot break aligned with a strongly trending VWAP is occurring within an established VWAP-axis trend; one against it is counter-trend.
6. Adaptive trailing stop, multi-timeframe composite bias
An adaptive trailing stop whose ATR length is dynamically set using Kaufman's Efficiency Ratio (the same adaptation mechanism used in KAMA). The stop is computed on chart, 3×, 5×, and 15× timeframes; each contributes a weighted ±1 to a composite directional score in the range −10 to +10. One number summarises whether four timeframes agree.
7. Chandelier-style trailing stop, multi-timeframe convergence
A second, independent multi-timeframe trend check. Standard Chandelier stops on chart / 3× / 5× / 15× are computed; the standard deviation of those four stop prices is measured and normalised to ATR. Low dispersion = all timeframes agree. The adaptive composite (#6) and the Chandelier convergence (#7) cross-check the same question via two different mechanisms.
8. Higher-timeframe pivot structure (HH+HL / LH+LL on 3×, 5×, 15×)
Direct HTF market-structure read using ta.pivothigh / ta.pivotlow on the HTF series. Independent of any moving-average / stop / VWAP framework — purely pivot-sequence based.
9. Chart-timeframe pivot structure
The same pivot-sequence test on the chart timeframe itself, using its own configurable pivot length, independent of the trendline engine.
10. Confluence-based support/resistance zone engine
A zone builder that combines volume profile (POC, VAH, VAL), high-activity bars (top-percentile volume and range), native swing pivots, and multi-HTF pivots into clustered, scored zones. Available as a visual layer and as an optional filter gate.
────────────────────────────────────
HOW THEY COMPOSE INTO ONE NUMBER
────────────────────────────────────
Break Strength = Break Quality (0–7) + (5 − Trend Context) (0–5)
Range: 0–12
Break Quality (0–7) is the sum of seven independent properties of the break event itself:
| # | Component | What it measures |
|---|---|---|
| 1 | ER compression-then-release | Coiled-spring pre-break setup |
| 2 | Break magnitude ≥ N × ATR | Decisiveness of the break |
| 3 | Volume ≥ N × 20-bar SMA | Participation at the break |
| 4 | ≥ N bars since prior same-dir pivot | Trendline duration / base length |
| 5 | Pivot height ≥ N × ATR | Quality of the trendline being broken |
| 6 | Range expansion (TR > N×ATR, ATR rising) | Range-based expansion at break |
| 7 | Anti-Wick check | Close in favourable 30% of bar |
Trend Context (0–5) measures whether the broader trend is already established:
| # | Component | What it measures |
|---|---|---|
| 1 | Recent same-dir Slow tier signal | Slowest tier already confirmed direction |
| 2 | Adaptive Trail aligned | Multi-TF adaptive-stop framework agrees |
| 3 | VWAP gradient strongly aligned | Session VWAP slope agrees |
| 4 | Chandelier stop convergence high | All TFs agree on trend state |
| 5 | Chart-TF HH+HL aligned | Chart pivot sequence agrees |
Why Trend Context is INVERTED:
When the broader trend is already firmly established, the break is occurring late in the move and receives a lower bonus. When the context is mixed or transitioning, the bonus is higher. The thesis: quality breaks occur AT structural inflection points, not after them. If you prefer with-trend breakouts to count fully, disable Trend Context in inputs (the composite then becomes Break Quality alone, range 0–7).
────────────────────────────────────
HOW TO USE IT (PRACTICAL WORKFLOW)
────────────────────────────────────
1. Apply to any chart and timeframe.
All defaults are sensible.
2. Read the on-bar arrow labels:
Tier length + direction + Break Strength score. The Status Panel summarises the most recent break.
3. Start with default filters:
VWAP Gradient Filter ON, Adaptive / HTF / LTF / Volume / Confluence gates OFF. Add gates one at a time to suit your trading style.
4. Higher score = stronger structural break,
read alongside the score-band guide above. Do not treat any score as a buy/sell signal on its own.
5. For lower timeframes,
consider the multi-instance stacking technique described above (8/21/34, 21/34/55, 34/89/144) to add higher-TF context without leaving your execution chart.
6. Use the Confluence S/R zones (if enabled)
to see where breaks line up with major confluence levels. Breaks at strong zones behave differently from breaks in empty space.
────────────────────────────────────
FILTER GATE QUICK REFERENCE
────────────────────────────────────
| Gate | When to enable |
|---|---|
| VWAP Gradient Filter | Default ON. Suppresses breaks against a strongly trending session VWAP. |
| Adaptive Trail Bias Gate | Enable if you want to see only breaks aligned with multi-TF directional consensus. |
| HTF Anchor (HH+HL / LH+LL) | Enable to require recent pivot sequence confirmation. |
| LTF Pivot Break | Enable to require the close to clear the opposing pivot. |
| Volume Surge | Enable to require top-percentile volume on the break bar. |
| Confluence Zone Gate | Enable to require the break to occur near a strong S/R zone. |
Each filter, when enabled, suppresses arrow labels for breaks that do not meet that criterion. Filters compose multiplicatively — turning on three filters at once will significantly reduce the number of breaks displayed.
────────────────────────────────────
WHAT IS ORIGINAL ABOUT THIS INDICATOR
────────────────────────────────────
• The inverted-context composite score — Break Quality summed with (5 − Trend Context) — is the novel contribution. Most multi-component scorers reward aligned context as a bonus; this one penalises it on the explicit thesis that early breaks score higher than late breaks.
• The seven Break Quality components are designed to be independent — no component overlaps with another on the same surface, and none measures established trend (that is the job of the inverted Trend Context score).
• Three pivot tiers run in parallel with independent state machines, rather than the more common single-tier approach.
• Two independent multi-timeframe trend reads (adaptive-stop composite + Chandelier convergence) cross-check rather than relying on a single MTF mechanism.
• The confluence S/R engine combines volume profile, percentile-and-consensus-based high-activity bar detection, native pivots, and up to three HTF pivot streams into a single 0–10 zone-strength score.
────────────────────────────────────
TECHNICAL NOTES
────────────────────────────────────
• Pine Script v6
• Non-repainting: structural break events confirm at bar close
• No lookahead: barmerge.lookahead_off on all request.security calls
• HTF reads are one-way: chart-TF computations never depend on HTF state in a way that would change historical bars
• Max line / label / box counts set high to handle dense trendline tiers
• Compatible with TradingView's House Rules and Pine publishing standards
────────────────────────────────────
IMPORTANT RISK DISCLOSURE
────────────────────────────────────
This indicator is provided for educational and informational purposes only. It is not financial advice, investment advice, a trading system, or a recommendation to buy, sell, or hold any financial instrument.
Trading and investing involve substantial risk of loss, including the possible loss of all invested capital. The structural break events highlighted by this indicator are observations of market behaviour, not predictions of future price movement. The Break Strength score is a descriptive summary of structural properties, not an indication of profitability, win rate, expected return, or risk-adjusted performance.
No backtested or hypothetical performance is claimed or implied by any element of this indicator or its description. Past structural break events identified by the indicator are not indicative of future results. The arrows, scores, and zones are analytical annotations, not trade signals.
You are solely responsible for any trading decisions you make. Always conduct your own research, use appropriate risk management, size positions according to your own risk tolerance, and consider consulting a licensed financial advisor before making investment decisions. Do not trade with money you cannot afford to lose.
By using this indicator you acknowledge that the author bears no responsibility for any losses, missed gains, or other consequences arising from its use. 指标

Global Position Sizing (R Based)Description:
Managing risk across different global markets, currencies, and timeframes can be a mathematical headache. The Global Position Sizing (R Based) indicator is designed to streamline this process, allowing you to focus on the trade setup rather than the calculator.
Built for traders who use fixed fractional risk (R-multiples), this open-source tool automatically calculates exactly how many shares you should buy based on your predefined risk, current exchange rates, and the specific stop-loss distance of your setup.
Whether you are trading US tech stocks, Indian equities, or Japanese indices, this indicator will automatically detect the active ticker's currency, pull live conversion rates, and seamlessly adjust your risk profile.
Key Features:
• Auto-Currency Detection & Conversion: No manual input is needed when switching between international assets. The script reads the chart's native currency automatically and uses native request.currency_rate logic to instantly convert your Base Risk (USD) into the Target Currency.
• Global Currency Support: The UI features custom symbol formatting for major markets, natively displaying USD (), CNY (¥), JPY (¥), KRW (₩), TWD (NT), and INR (₹). For all other global markets (such as EUR, GBP, AUD, CAD, etc.), the script features a smart fallback that simply displays the standard 3-letter currency code.
• Dynamic Timeframe Multipliers: Automatically scales your risk based on the chart timeframe. By default, it applies a 1.0x multiplier for Daily setups and scales up to a 2.5x multiplier for higher-conviction Weekly or Monthly setups. You can also easily override this with a custom multiplier in the settings.
• Smart Entry & Stop Loss Detection: If left at 0.0, the script automatically detects the current price (close) as your Entry and the current candle's low (low) as your Stop Loss. You can override these with specific manual price points for pending setups.
• Volatility Warning System (SL vs. ATR): The script calculates your Stop Loss distance as a percentage and compares it against the Average True Range (ATR %) of the asset. If your proposed SL % is wider than the ATR %, the row will highlight RED, warning you that your risk parameter is unusually wide for the asset's current volatility. ATR length is fully customizable (default 14 days).
• Modular & Clean UI: A highly customizable display widget that doesn't clutter your chart. • Toggle individual rows on or off (e.g., hide the exchange rate or ATR if you only want to see the final share count). • Anchor the widget to any of the 9 standard chart positions. • Adjust the custom "Margin Offset (%)" to push the widget away from the edges of your screen for a perfectly clean layout.
How to Use:
1. Open the indicator settings and set your Daily R (Base USD). This is your standard risk unit per trade.
2. When evaluating a setup, either let the script auto-detect the current price/low, or enter your specific Entry and Stop Loss prices.
3. The widget will instantly calculate your risk in the local currency, compare your stop distance to the ATR, and output the exact number of shares to buy.
Note: This script is open-source and intended for educational and workflow optimization purposes. Always double-check position sizes and exchange rates before executing live trades. 指标

Support & Resistance Threesome [Zofesu]Support & Resistance Threesome is an overlay indicator that tracks up to twelve simultaneous liquidity zones across two structural levels — major and minor — and combines zone interaction data with an RSI-based smart entry filter to produce high-probability reversal signals directly at institutional price levels.
The three components work as a system: zones define where price is expected to react, touch counting measures how many times the level has been tested and held, and the entry filter ensures signals fire only when momentum conditions align with the zone interaction.
─────────────────────────────────────
01 — What is S/R Threesome?
─────────────────────────────────────
S/R Threesome detects pivot-based support and resistance zones and tracks them dynamically across the chart. Each zone is built around a confirmed swing high or low, padded by a configurable buffer, and updated in real time as price interacts with it.
The indicator tracks two structural levels simultaneously:
Major zones — built from wider swing lookback (default 20 bars). These represent significant structural levels where institutional activity is more likely.
Minor zones — built from shorter swing lookback (default 8 bars). These represent recent, lower-timeframe levels within the larger structure.
Up to three zones per type are tracked simultaneously — three major resistance, three major support, three minor resistance, three minor support — twelve zones total.
─────────────────────────────────────
02 — Zone Lifecycle
─────────────────────────────────────
Each zone passes through three states:
Active — zone is intact, price has not closed beyond it. The zone extends forward in real time and darkens with each confirmed touch.
Confirmed — zone has been tested at least twice (touch count ≥ 2). Border changes to yellow. A confirmed zone is a higher-probability level — it has held under pressure more than once.
Filled — price closed beyond the zone boundary. The box turns gray with a dashed border, marking the zone as invalidated. A filled resistance that price returns to often acts as new support, and vice versa.
─────────────────────────────────────
03 — Touch Count and Visual Intensity
─────────────────────────────────────
Every time a confirmed bar closes with price interacting with a zone boundary, the touch counter increments (maximum 5). The zone responds visually:
Touch 1 — lightest fill, thinnest border
Touch 2 — zone confirmed, yellow border
Touch 3 — medium fill intensity
Touch 4+ — darkest fill, thickest border
This system makes the most tested zones immediately visible — heavier zones have held under more pressure and carry more institutional weight.
─────────────────────────────────────
04 — Buffer System
─────────────────────────────────────
Zones are not single price lines — they are areas with a configurable half-width on both sides of the pivot price. Three buffer modes are available:
ATR — zone width adapts to current volatility. Default multiplier: 0.5. Recommended for most markets.
Percent — fixed percentage of current price. Default: 0.15%.
Fixed — absolute tick-based value. Default: 500 ticks. Use for specific instruments with known pip structures.
Duplicate filter: zones that form within 3× buffer distance of an existing major zone, or 2× for minor zones, are suppressed to prevent visual clutter from overlapping levels.
─────────────────────────────────────
05 — Smart Entry System
─────────────────────────────────────
Entry signals fire when two conditions align simultaneously:
1. Price interacted with a major support or resistance zone on the previous bar (low touched support zone / high touched resistance zone)
2. RSI confirms momentum exhaustion — oversold for long entries (default below 35), overbought for short entries (default above 65)
A stop loss line is drawn automatically at the time of entry — positioned below the support zone bottom for longs, above the resistance zone top for shorts, with an additional SL buffer applied.
The zone must also be older than the maximum of both swing lookback periods — this prevents entries on zones that were just created and not yet validated by subsequent price action.
─────────────────────────────────────
06 — Settings
─────────────────────────────────────
Liquidity Zones
Major Swing Lookback — pivot detection window for major zones. Default: 20.
Minor Swing Lookback — pivot detection window for minor zones. Default: 8.
ATR Length — ATR lookback for buffer calculation. Default: 14.
Max Zone Age (bars) — zones older than this are replaced. Default: 300.
Buffer
Buffer Mode — ATR / Percent / Fixed. Default: ATR.
ATR Multiplier — zone half-width as ATR multiple. Default: 0.5.
Percent Buffer % — zone half-width as % of price. Default: 0.15%.
Fixed Buffer — zone half-width in ticks. Default: 500.
Entry — RSI
RSI Length — default: 14.
RSI Overbought — short entry filter threshold. Default: 65.
RSI Oversold — long entry filter threshold. Default: 35.
Entry — SL
SL Mode — ATR / Percent / Fixed. Default: ATR.
SL ATR Multiplier — SL distance as ATR multiple. Default: 1.5.
SL Percent % — SL as % of price. Default: 0.5%.
SL Fixed (pips) — SL in ticks. Default: 800.
Entry — Visual
Show Entry Signals — enable/disable arrows and SL lines.
SL Line / Long Arrow / Short Arrow — color settings.
Colors
Major Resistance / Support — zone fill color for major levels.
Minor Resistance / Support — zone fill color for minor levels.
Filled Zone — border color for invalidated zones.
Resistance / Support Border — active zone border color.
Confirmed Border — border color when touch count ≥ 2. Default: yellow.
─────────────────────────────────────
07 — How To Use
─────────────────────────────────────
Step 1 — Identify the active zones
Major zones (darker, thicker border) are the primary levels. Minor zones provide secondary context within the structure.
Step 2 — Watch for confirmed zones
Yellow border = zone has been tested and held at least twice. These are the highest-priority levels to trade from.
Step 3 — Wait for the entry signal
A triangle arrow appears when price touches a major zone with RSI confirming exhaustion. The SL line shows the invalidation level automatically.
Step 4 — Read zone fill intensity
Darker fill = more touches = stronger institutional interest at that level. Lighter fill = fresh zone, treat with less conviction.
Step 5 — Monitor filled zones
Gray dashed zones that price returns to after being filled often flip polarity — former resistance becomes support and vice versa. Watch for interaction at these levels even after they are invalidated.
Step 6 — Alerts
Two alert conditions are pre-configured:
S/R-3: LONG — long entry at support zone with RSI oversold
S/R-3: SHORT — short entry at resistance zone with RSI overbought
Works on all asset classes: Indices, Forex, Gold, Oil, Crypto.
Best timeframes: H1, H4, D1. 指标

Structure Delivery Radar [JOAT]Structure Delivery Radar
Introduction
SDR Structure Delivery Radar is an open-source market structure overlay that classifies short-term, intermediate-term, and long-term delivery using confirmed pivots, break events, sweep events, session position, and ATR compression.
The indicator is designed as a structural context layer. It does not try to predict every candle. Instead, it tracks whether price is delivering through meaningful structure levels and whether multiple structure tiers are aligned.
Core Concepts
1. Three-Tier Structure
The script tracks ST, IT, and LT swing highs and lows from confirmed pivots. Each tier keeps its own bias state.
2. Confirmed Breaks
A bullish break requires a confirmed close above the tracked swing high. A bearish break requires a confirmed close below the tracked swing low.
3. Sweep Detection
The script recognizes when price trades beyond a swing level but closes back through it, marking potential liquidity behavior without using future bars.
4. Delivery Score
The dashboard score blends structure alignment, break activity, sweep activity, session location, and ATR compression into a 0-100 reading.
5. Clean Structure Cloud
The visual output uses transparent clouds and dashboard states rather than cluttered arrows or excessive labels.
Features
ST/IT/LT structure tracking: Three independent confirmed-pivot layers
Break and sweep logic: Official events require confirmed bars
Delivery score: Quantifies structure alignment and current delivery state
Session cloud: Adds session range context
Structure cloud: Shades the active upper/lower structure region
Top-right dashboard: Shows tier bias, events, ranges, compression, ATR, and signal state
Alerts: Includes bullish and bearish delivery confirmations
Input Parameters
Structure:
ST Pivot Length
IT Pivot Length
LT Pivot Length
ATR Length
Session and Visuals:
Use Session Window
Show Session Cloud
Show Structure Cloud
Show Bias Tint
Cloud and background transparency
How to Use
Step 1: Check whether the dashboard shows BULL, BEAR, or NEUT for the dominant structure state.
Step 2: Read the delivery score. Higher scores indicate stronger alignment across the internal model.
Step 3: Treat sweep events as context for failed breaks or liquidity reactions.
Step 4: Use the structure cloud as a map of active structural boundaries.
Limitations
Pivot-based structure confirms after the pivot length has passed
The score is a context reading, not a guarantee of trade outcome
Compressed markets can delay structure continuation
The script should be combined with risk management and execution rules
Originality Statement
SDR is an original JOAT implementation combining multi-tier confirmed structure, sweep recognition, session context, ATR compression, and a delivery score into one Pine Script v6 overlay.
Disclaimer
This script is for educational and informational purposes only. It is not financial advice and does not guarantee future results. Trading involves risk, and users should apply their own risk management.
Made with passion by jackofalltrades
指标

MTF Structure & Bias [BETA] | OMSF This is a professional-grade market structure interface designed for Daytraders and Swingtraders . It provides a high-clarity view of market mechanics by filtering out noise and focusing on validated structural shifts across multiple timeframes.
Eliminate Emotional Decision-Making The core mission of the OMSF Framework is to solve the fundamental problem of trading: Emotion. By projecting clear, rules-based logic directly onto your screen , this interface removes the "guesswork" from your process.
Key Functionality:
Structural Interpretation: The script translates raw price action into defined market trends. It distinguishes between Uptrend, Downtrend, and Sideways ranges based on validated structural levels.
Bias Derivation: A rule-based trading bias is derived by aligning higher timeframe structure with a regime filter.
Calibration: Optional background colors visualize these internal decision rules. This allows for an objective check of how parameters affect the classification of market phases.
Core Logic & Bias Derivation
The script follows a systematic hierarchy to determine the market state and trading bias:
1. Structural Raw Bias (HTF)
The primary direction is derived from the Higher Timeframe (HTF) market phases. If the structure is in an expansion or correction phase, it is assigned a directional value:
• Long (+1): Bullish Expansion or Bullish Correction.
• Short (-1): Bearish Expansion or Bearish Correction.
• Neutral (0): No clear structural phase.
2. EMA Regime Filter
To ensure trend alignment, a "Regime Lock" is applied. A structural bias is only validated as an Uptrend or Downtrend if the price remains on the correct side of the EMA. If the structural bias and EMA alignment contradict each other, the market is classified as Sideways.
3. Trading Bias & Risk Assessment
The final trading bias (Long/Short) is then cross-referenced with the current price range:
• Trend Continuation: If the HTF is trending and the market is not overextended, the bias follows the trend.
• Counter-Trend Awareness: If the HTF is "Extended ⚠️" (overheated) and the Lower Timeframe (LTF) shows a correction, the bias reflects a potential mean reversion or temporary shift.
• Sideways Handling: In sideways markets, the bias remains neutral unless specific range conditions are met.
Configuration & Visual Feedback
The settings menu includes the standard parameters from the OMSF framework . To better understand their impact, it is recommended to use the Background Colors feature:
Real-time Calibration: Adjust parameters like ATR thresholds or momentum filters and observe how the background colors shift.
Visual Consistency: The background colors correspond directly with the status indicators on the Dashboard, providing a unified view of the current market phase.
Logical Mapping: This allows you to see exactly where the framework switches its interpretation based on your specific settings.
For a deep dive into the underlying logic of these variables, please refer to the core library documentation: 🔗https://www.tradingview.com/script/g1122Yj2/
Systematic Consistency (Educational Core)
The primary goal of this implementation is to demonstrate how a rule-based framework enables a trader to make the same decisions under the same market conditions.
Objective Strategy Testing: By using fixed structural definitions, you can test strategies on a foundation that does not change based on intuition or emotion.
Repeatability: Once a valid strategy is identified, the framework ensures that the entry and exit conditions remain objective and repeatable over any number of trades.
Condition-Based Execution: This approach shows that professional trading is not about predicting the future, but about reacting consistently to predefined market states.
Dashboard Logic & Layout
The dashboard acts as a real-time monitor for the Multi-Timeframe (MTF) analysis, organized into two primary data columns:
Left Column (Higher Timeframe):
◦ Market Stage: Displays the structural trend (Uptrend, Downtrend, or Sideways) derived from the HTF.
◦ Market State: Real-time feedback on the specific OMSF phase (Expansion/Correction).
◦ Price Range: Volatility-based assessment of the current price extension.
Right Column (Lower Timeframe & Confluence):
◦ Trading Bias: Shows the final confluence signal. It aligns the HTF structure with the internal regime filter and risk parameters to provide a clear directional bias.
◦ LTF Dynamics: Parallel monitoring of the execution timeframe's state and price range.
Visual Indicators: All colors on the dashboard are synchronized with the Visual Calibration (Background Colors). This ensures that the information on the dashboard is always reflected by the logic projected onto the chart.
Visual Structure Tools
Lines and boxes are rendered using functions from the Visual Structure Tools library:
Orange Box: Automatically drawn when compress.htf == true.
Logic: This highlights unconfirmed, tight structures (where omsfHigh is not yet a confirmed strHigh), which often mark the starting point of impulsive breakouts.
Documentation: For a detailed breakdown of how levels and boxes are calculated, refer to
the library documentation:
🔗https://www.tradingview.com/script/RYljd98y/
I release my frameworks to the community to validate the OMSF logic against real-world volatility. This live feedback loop is essential for refining the code and ensuring the framework remains resilient and reliable across all market conditions.
Made in Germany 🇩🇪 with a focus on logic and precision.
Disclaimer
For Educational Purposes Only. The information and tools provided in this script are for educational and demonstration purposes only and do not constitute financial, investment, or trading advice.
• No Guarantees: Past performance is not indicative of future results. Trading involves significant risk, and most individual traders lose money.
• Not a Signal Service: This script is a technical framework designed to assist in market structure analysis. It is not an automated trading system or a signal provider.
• Risk Responsibility: The author (arnipoer) assumes no liability for any financial losses resulting from the use of this script. Always perform your own due diligence and use a demo account before risking real capital.
• Beta Software: This is a demo/beta version. Logic and visual representations are subject to change and should be verified against your own analysis.
指标

指标

指标

Auto Swing Trade Set Up v1.0 by [Itto-Ryu]Auto Swing Trade Set Up v1.0 is a Pine Script indicator for TradingView, built for swing traders who have already decided their directional bias from external analysis and need a clean, math-consistent way to draw their entry, stop loss, take profit, and reversal levels on the chart.
Element Visual Purpose
Z1 (first fill) Solid amber box Primary entry zone
Z2 (averaging) Dashed amber box Secondary fill if price extends
Entry mid Dotted amber line The midpoint reference
SL Thick red line Stop loss (ATR-based)
TP1 Green dotted line Take 50% off here
TP2 Teal dotted line Take next 50% (or trail)
SFlip Purple dashed line Above this: Long thesis broken
LFlip Pink dashed line Below this: Short thesis broken
Direction badge Right of price ▲ LONG / ▼ SHORT + R:R ratio
Who This Is For
This tool is built for:
• Discretionary traders who form directional bias from fundamentals, news, sentiment, or proprietary analysis — and need a quick way to mark levels on the chart.
• CMT analysts who score setups using the 7-Pillar Rule-Based System and want the chart to reflect the decision, not make it.
• Crypto / FX / equity swing traders who think in pullback entries with averaging zones,
ATR-anchored stops, and R:R-based targets.
• Anyone who finds full-auto indicators noisy — too many false signals, too many ignored alerts,
too many overrides.
Who This Is NOT For
• Traders who want the indicator to tell them what to do.
• Algorithmic / fully automated systems
• Beginners who haven't yet developed a directional framework.
Principle One : Math, Not Judgment
All level calculations are pure formulas: entry midpoint, ATR multiples, R:R ratios. No conditional logic.No "if RSI is overbought then shift the stop." The same inputs always produce the same outputs.Why this matters: reproducibility. If you mark a Long on BTCUSD at 18:00 with these settings, then check the same chart tomorrow, the zones will be in the same place relative to that bar. There is no hidden state, no learned behavior, no drift.
Principle Two : One Decision, Many Outputs
The only decision you make is Long or Short. From that one bit of information, the indicator produces nine distinct visual elements (two zones, entry mid, SL, TP1, TP2, SFlip, LFlip, direction badge with R:R) each of them quantitatively derived
Why Manual Direction
The trader required to use other indicator for trend identifier and momentum such as EMA 20/50/100/200 , Ichimoku Cloud ,Price pattern and Dow theory , MACD, RSI ,ADX and etc. depend on their familiar or expertise in order to identify the whether they will open Long or Short . This indicator will help trader to get an outline instantly of action zone , entry , SL , TP and other critical point . However , manual decision for short or long might have an advantage because the auto detection or trend following signal might have a fall back as bellowing
• Chop kills auto signals. When price oscillates near the threshold, the indicator flips
Long-Short-Long, generating false setups every few bars.
• Late entries on real moves. When a strong trend breaks out, the indicator confirms only after the optimal entry zone has passed.
• Wrong side on news shocks. When fundamentals (CPI, FOMC, earnings) drive a sudden direction change, technicals lag the move by hours.
So , in practical especially swing trader who gain the profit from the gap might are required to doing the preemptive action such as open short 10% or a few portion when their consider it might be a peak so they can open in the good position before the signal is confirm
The Entry Midpoint
The entry midpoint (entryMid) is the single most important value the indicator computes. Everything else zones, SL, TP, flips — is derived from it.
Reference Selection
Two reference lines are pulled from the chart:
• EMA Fast (default length 20) — the standard short-term trend follower
• BB Basis (SMA-20) — the midline of the Bollinger Band system
The indicator then picks the appropriate one based on your chosen direction:
refHi = max(EMA20, BB_basis)
refLo = min(EMA20, BB_basis)
entryMid = isLong ? refHi : refLo
Rationale: For a Long, you want to enter on a pullback toward a support reference — the higher of the two candidates is usually closer to current price, making fills more likely. For a Short, the inverse.
ATR Clamping
Raw EMA/BB references sometimes sit too close to (or too far from) current price to be useful as entry zones. The indicator clamps the entryMid into a sensible band defined by ATR:
// LONG case
if entryMid > close: // too high
entryMid = close − ATR × 0.3
elif entryMid < close − ATR × 0.7: // too low
entryMid = close − ATR × 0.5
Dual Entry Zones
The indicator paints two zones stacked around the entryMid:
Zone Formulas
For a Long setup:
zone1Hi = entryMid + ATR × Z1_width // above mid
zone1Lo = entryMid // at mid
zone2Hi = entryMid // at mid
zone2Lo = entryMid − ATR × Z2_width // below mid
For a Short setup, the geometry inverts: Z1 sits below mid (first fill on a rally) and Z2 sits above
(averaging if rally extends).
Default Widths
Parameter Default Meaning
Z1 width 0.3 × ATR Slim zone for primary fill
Z2 width 0.6 × ATR Wider zone for averaging fills
How to Use Each Zone
Z1 (first fill, solid amber): Your primary entry. Allocate the larger portion of your intended position size here. Typical approach is 60-70% of position into Z1.
Z2 (averaging, dashed amber): Only triggers if price pushes past entryMid into the deep zone. Allocate the remaining 30-40% here. Beyond Z2, the next reference is SL — if price reaches SL without bouncing, the trade is invalidated and you accept the loss as planned.
Warning: Z2 is for averaging, NOT for unlimited adding. The math assumes total position cost basis falls between entryMid and Z2's deep edge. Adding outside Z2 voids the SL/TP geometry — your actual R:R will not match what's displayed.
Stop Loss (SL)
// LONG
slLevel = entryMid − ATR × SL_multiplier
// SHORT
slLevel = entryMid + ATR × SL_multiplier
risk = abs(entryMid − slLevel)
Default SL multiplier: 1.5 × ATR. This places the stop outside ordinary volatility, reducing premature stop-outs from noise while keeping the loss bounded.
Take Profit (TP1 & TP2) TPs are computed by R:R multiples of the calculated risk:
// LONG
tp1Level = entryMid + risk × TP1_RR // default RR = 1.5
tp2Level = entryMid + risk × TP2_RR // default RR = 2.5
// SHORT (subtract instead of add)
Execution playbook:
• TP1 hit: Close 50% of position. Move SL to breakeven (entryMid) for the remainder.
• TP2 hit: Close 25% of position. Trail the final 25% with EMA20 or a moving stop.
• Beyond TP2: You are now in a runner. The trade has paid its R, your downside is zero (breakeven SL). Let the winner work.
Flip Lines (SFlip & LFlip)
Flip lines mark the points where your directional thesis is broken. If price closes past a flip line, you should re-evaluate — possibly exiting and flipping direction.
// LONG case
shortFlip = entryMid + ATR × Flip_multiplier // upside flip
longFlip = slLevel // = SL
// SHORT case
shortFlip = slLevel // = SL
longFlip = entryMid − ATR × Flip_multiplier // downside flip
Default Flip multiplier: 2.0 × ATR. The asymmetry is deliberate: one flip line coincides with your SL(because if SL is hit, the thesis is dead by definition); the other sits one extra ATR's worth out, marking the point where the OPPOSITE trade would now make sense.
Settings & Configuration
All settings are accessible via the indicator's Settings dialog in TradingView. Defaults are tuned for swing trading on 1H-Daily charts; adjust per timeframe and instrument.
Trade Direction Group
Input Type Default Purpose
Direction Dropdown Long Pick Long or Short
Show Zones Checkbox True Master on/off for all visuals
Risk Settings Group
Input Default Purpose
SL = ATR x 1.5 Stop multiplier
TP1 R:R 1.5 First profit target ratio
TP2 R:R 2.5 Second profit target ratio
Flip = ATR x 2.0 Direction-flip threshold
Line Length 50 bars How far back lines/boxes extend
Zone 1 width 0.3 × ATR Slim entry zone
Zone 2 width 0.6 × ATR Wide averaging zone
Tuning Per Timeframe
The defaults are a balanced compromise. For your style, consider:
Timeframe SL TP1 TP2 Flip
Scalp (5-15m) 1.0 1.0 1.5 1.5
Intraday (1H) 1.2 1.5 2.5 2.0
Swing (4H-D) 1.5 (default) 1.5 2.5 2.0
Position (D-W) 2.0 2.0 3.5 3.0
Common Mistakes To Avoid
• Re-running the indicator after price has moved. The zones recompute live on each bar. If you
formed your thesis at one bar's close, place your orders at THOSE levels, not the levels the indicator shows three bars later.
• Flipping direction without exiting first. Toggling Long → Short while a Long position is open
generates new zones for the Short setup but does NOT close your Long. Close manually first.
• Trading both directions on the same chart. Don't load two instances. Use one chart per
directional view. If you need to see both, use chart layouts (vertical split).
• Ignoring the SFlip / LFlip lines. These are not decorative. When price breaks them on a closing
basis, your thesis is broken. Acknowledge it.
• Over-tweaking the ATR multipliers per trade. Pick a setting per timeframe and stick with it for at least 20 trades before adjusting. Frequent tweaking is curve-fitting.
Enjoy ! developed by Thiranat Ngamchitcharoen (Itto-Ryu)
( Itto-Ryu is derived from school of one cut , this inspired me to create the series of indicator that help the trader which often need to make a decision at a glance before a good position have passed . )
Protected script
This script is published as closed-source. However, you can use it freely and without any limitations – learn more here.
Thiranat
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
指标

Momentum Pulse | AnonycryptousMomentum Pulse | Anonycryptous
Description & user manual
Why this indicator is different
Standard momentum indicators give you one line. RSI tells you whether the market is overbought or oversold at one specific lookback period. MACD tells you whether one moving average is pulling away from another. One perspective. One answer.
The problem is that momentum does not exist at one lookback period. A 14-period RSI can be flat while a 7-period RSI is already reversing. A 21-period RSI can still be bullish while the fast momentum has already rolled over. By looking at one line you are always missing what is happening at adjacent timescales — and those are precisely where the early signals live.
Momentum Pulse works differently.
Instead of one RSI it runs twenty simultaneously, each at a different lookback period. The shortest strand captures the fastest momentum shifts. The longest strand reflects the slower, sustained trend. Together they form a ribbon — a fluid, living visualization of where momentum is coming from, where it is heading, and how much agreement exists across timescales.
The ribbon does not just show direction. It shows compression and expansion. When the strands fan out, momentum is building with conviction. When they compress, the market is coiling — and that compression often precedes the next directional move. When the fast strands lead the slow strands, the trend has energy behind it. When they cross or collapse toward each other, momentum is fading before it is visible in price.
This is momentum before the move.
Important notice
Momentum Pulse is provided for analytical and educational purposes only.
It does not generate trading signals.
It does not predict market direction.
It does not guarantee any outcome.
All trading decisions remain entirely with the user.
Always apply your own judgment and manage your own risk.
1. Overview
Momentum Pulse is a twenty-strand RSI ribbon oscillator built on RSI processed through zero lag EMA smoothing. It maps momentum across twenty simultaneous lookback periods and visualizes the full structure of momentum strength, direction, compression, and divergence in a single pane.
What it includes:
- Twenty RSI strands normalized to a −50 to +50 scale around a zero midline
- Zero lag EMA smoothing applied per strand to reduce response lag
- Fast and slow group averaging with spread-based trend detection
- Twist/Squeeze detection when fast and slow groups compress below the threshold
- Momentum histogram showing the distance between fast and slow group averages
- Ribbon slope line showing the rate of change of the fast group average
- Divergence detection comparing price pivots with fast group momentum pivots
- Three presets: default for swing, fast for scalping, smooth for position trading
- Live dashboard showing momentum state, averages, spread, twist, zone, slope, and divergence
- Six alert conditions covering state changes, compression, and divergence events
2. Core components
2.1 RSI strands
Twenty RSI calculations run simultaneously, each at a different lookback period. The first strand uses the base length. Each subsequent strand adds the length step, spreading the ribbon from fast to slow momentum perspectives. All values are normalized to a −50 to +50 scale around a zero midline, making every strand directly comparable regardless of its period.
2.2 Zero lag EMA smoothing
Each RSI strand is smoothed using a zero lag EMA. Standard EMA smoothing introduces lag because it weights recent bars less than current price. ZLEMA compensates by incorporating the momentum of recent change before applying the average — the ribbon reacts to momentum shifts on the current bar, before the move has confirmed on price.
2.3 Fast and slow group trend detection
The ribbon is divided into two groups. The fast group uses strands one through five — the shortest lookback periods. The slow group uses strands sixteen through twenty — the longest. When the fast group average is above the slow group average, momentum is bullish. When it is below, momentum is bearish. When the spread between the two groups falls below the twist threshold, the oscillator enters a Twist/Squeeze state.
This logic is independent of overbought and oversold levels and works reliably in all market conditions.
2.4 Momentum histogram
The histogram plots the distance between the fast and slow group averages near the zero midline. Wide bars indicate strong momentum separation — the trend has conviction. Narrow bars indicate the ribbon is compressing — momentum is fading or transitioning.
2.5 Ribbon slope
The slope line measures the rate of change of the fast group average over a configurable number of bars. A rising slope indicates momentum is accelerating into the trend. A falling slope indicates momentum is decelerating, a possible sign of exhaustion. A flat slope indicates consolidation or a transition that has not committed to a direction.
2.6 Divergence detection
The indicator compares recent price pivots against fast group average pivots over a configurable lookback window. A bullish divergence fires when price makes a lower low but the fast group average holds higher — hidden strength beneath the surface. A bearish divergence fires when price makes a higher high but the fast group average rolls over — hidden weakness. Both conditions trigger a background flash on the pane.
3. Presets
Three preset configurations are available. Selecting a preset overrides the core calculation parameters.
-Default — swing trading on 4H and daily charts
RSI base 10 | ZLEMA 5 | step 2 | twist threshold 1.5
Balanced ribbon for trend following and swing setups across most market conditions.
-Fast — scalping on 1 minute to 15 minute charts
RSI base 7 | ZLEMA 3 | step 2 | twist threshold 1.0
Shorter periods and a tighter twist threshold for early detection of momentum shifts and reversals before they appear in price.
-Smooth — position trading on daily and weekly charts
RSI base 14 | ZLEMA 8 | step 3 | twist threshold 2.5
Wider spread and longer periods. Only high-conviction momentum moves register. Filters out intraday noise.
4. Visual guide
Ribbon fanning upward — bullish momentum expanding across multiple timescales.
Ribbon fanning downward — bearish momentum expanding.
Ribbon compressing toward center — Twist/Squeeze state, potential breakout building.
Grey background shading — active Twist/Squeeze state.
Green background flash — bullish breakout bar, ribbon exiting compression.
Red background flash — bearish breakout bar.
Warm/orange flash — bullish divergence detected.
Red dim flash — bearish divergence detected.
Green circle at oversold — bullish signal condition.
Red circle at overbought — bearish signal condition.
Histogram bars — momentum strength between fast and slow groups. Wide = strong trend. Narrow = compression.
Slope line — acceleration or deceleration of fast group momentum.
5. Dashboard reference
The dashboard provides live readings across all components.
Momentum — current ribbon state: bullish, bearish, or twist.
Fast avg — average of the five fastest strands.
Slow avg — average of the five slowest strands.
Spread — distance between fast and slow group averages.
Twist — whether the ribbon is compressed below the twist threshold.
Zone — whether the ribbon is extended, compressed, or neutral relative to overbought/oversold levels.
Slope — momentum acceleration state: accel, decel, or flat.
Divergence — active bullish divergence, bearish divergence, or none.
Signal — last signal fired.
6. Alerts
Six alert conditions are available:
- Bullish: ribbon flips to bullish state.
- Bearish: ribbon flips to bearish state.
- Twist: ribbon enters Twist/Squeeze compression.
- Bullish divergence: price makes a lower low while momentum holds higher.
- Bearish divergence: price makes a higher high while momentum weakens.
- Any change: fires on any of the above transitions.
All alerts include exchange, ticker, and interval in the message.
7. Settings reference
Calculation parameters
- Source: price input for RSI calculations
- Base length: lookback period for the fastest ribbon strand
- Length step: increment between each subsequent strand
- RSI length: base RSI period for all strand calculations
- ZLEMA length: zero lag EMA smoothing period per strand
- Twist threshold: minimum spread required to declare a trend; below this = Twist/Squeeze
- Divergence lookback: window for comparing price and momentum pivots
- Slope length: bars used to calculate ribbon acceleration
- Preset: default, fast, or smooth
Visualization settings
- Color preset: classic (green/red) or custom
- Bullish, bearish, and twist/squeeze colors
- Min transparency: opacity of the fastest (leading) strand
- Max transparency: opacity of the slowest (lagging) strand
Level settings
- Overbought level: reference line (does not affect trend logic)
- Oversold level: reference line (does not affect trend logic)
Dashboard settings
- Show dashboard
- Dashboard size: tiny, small, or normal
8. How to use
8.1 Lower timeframes (1 minute to 15 minutes)
Use the fast preset. Monitor the ribbon for compression before expansion — Twist/Squeeze states often precede directional moves. A rising slope combined with bullish ribbon expansion confirms momentum is accelerating. A divergence forming while the ribbon is still in compression indicates a directional move is building before it appears in price.
Only take bullish setups when the ribbon is bullish or just exiting a Twist state with a rising slope and no active bearish divergence. Only take bearish setups with the reverse conditions.
8.2 Higher timeframes (1H, 4H, daily)
Use the default preset on 1H and 4H. Use the smooth preset on daily and weekly charts.
A wide, sustained ribbon fan on higher timeframes confirms momentum has conviction. Ribbon compression while price action narrows indicates trend exhaustion — consider reducing exposure and waiting for re-expansion. Divergence on daily charts carries significant weight and should be treated as a major reversal warning.
8.3 Dashboard reading guide
Slope accel + momentum bullish — trend strengthening, momentum building.
Slope decel + momentum bullish — trend weakening, watch for reversal.
Divergence bear + trend bullish — exit warning, confluence fading.
Twist yes + spread narrowing — breakout setup forming, wait for direction.
8.4 Standalone use
Momentum Pulse works as a standalone oscillator for any strategy or existing indicator setup. The ribbon provides directional momentum bias. The divergence detector flags hidden reversals before they appear in price. The slope line shows whether momentum is building or fading. The histogram confirms trend strength between fast and slow groups. No other indicator is required.
9. Disclaimer
This indicator is provided for educational and informational purposes only.
All outputs are based on historical price action calculations and do not guarantee future results.
Trading financial instruments involves significant risk of loss.
Past performance does not indicate future results.
Use at your own discretion.
指标

指标

Adaptive Swing Matrix | MouryaThis indicator provides a Multi-Timeframe (MTF) table matrix designed to display the real-time states of several standard momentum and trend indicators across 11 user-defined timeframes simultaneously.
The primary purpose of this script is to consolidate chart real estate. By organizing MTF data into a single table, it allows users to monitor higher-timeframe trends and oscillator states without needing to continuously switch chart intervals or clutter their screen with multiple lower panes.
Indicator Logic & Components:
This matrix tracks the following standard indicators across the user's chosen timeframes:
Trend (EMA Crossover): Evaluates a fast EMA crossing a medium or slow EMA, filtered by a macro 200-period baseline EMA.
RSI (Relative Strength Index): Displays the current RSI value, color-coded based on user-defined breakout/breakdown thresholds.
MFI (Money Flow Index): Displays volume-weighted momentum.
ADX (Average Directional Index): Evaluates trend strength to filter out sideways consolidation periods.
MACD (Moving Average Convergence Divergence): Evaluates the relationship between the MACD line and the Signal line relative to the zero-line. The matrix uses the following acronyms to display the exact MACD state:
AZPCO: Above Zero, Positive Crossover (MACD is > 0 and MACD > Signal)
AZNCO: Above Zero, Negative Crossover (MACD is > 0 and MACD < Signal)
BZPCO: Below Zero, Positive Crossover (MACD is < 0 and MACD > Signal)
BZNCO: Below Zero, Negative Crossover (MACD is < 0 and MACD < Signal)
VWAP (Volume Weighted Average Price): Displays the current VWAP value and highlights if the closing price is currently holding above or below the baseline.
NASDAQ:INTC Matrix Features:
Customizable Timeframes: Users are not restricted to default intervals. You can input custom minute, hour, day, week, or month intervals for all 11 rows via the settings menu.
Overall Consensus Score: The bottom row of the table evaluates a 7-timeframe core grouping. If a strict majority of these selected timeframes share the same trend direction, it outputs a unified directional signal.
Visual Chart Overlays: Users can optionally enable the EMA lines and VWAP bands on their main chart. These visual elements have been strictly segregated in the indicator's Style tab for easy toggling.
All backend settings—including lengths, source data, and trigger thresholds for the RSI, MFI, and ADX—are fully unlocked in the inputs menu for personal customisation. 指标

Smart Trader, Episode 07, ICS Geometric Buyers/Sellers Pressure🔶 Overview
ICS Geometric Buyer/Seller Pressure measures the real-time balance between buying and selling forces through a geometric framework built on triangle areas. Rather than relying on volume, oscillators, or moving-average crossovers, this indicator constructs two right triangles on every bar — one representing seller pressure above the current price, one representing buyer pressure below it — and computes their areas inside a normalized coordinate system called the Isotropic Coordinate System (ICS).
The ICS transforms raw price and time into a dimensionless plane using Yang-Zhang composite volatility as the scaling factor. Because both axes are divided by the same volatility estimate, the resulting triangle areas carry no unit — they are pure geometric ratios. This makes the pressure reading comparable across any instrument, any timeframe, and any price scale, without the trader needing to adjust parameters when switching charts.
From these two normalized areas, the indicator derives a single metric called B, which condenses the entire buyer-versus-seller balance into a value between −1 and +1. B is then converted into intuitive percentage readings (Red % for seller dominance, Blue % for buyer dominance) and visualized through a gradient barometer column, a triangle fan overlay, and data-window plots ready for alerts.
🔶 Conceptual framework
To measure the real-time balance between buying and selling forces, this indicator takes a geometric approach rather than relying on volume analysis, oscillator divergences, or moving-average crossovers. Two right triangles are constructed on every bar — one above the current price toward the range ceiling, one below toward the range floor — and their areas are compared to determine which side of the market currently dominates.
Computing triangle areas in raw price-versus-time coordinates, however, introduces a structural problem: the same price movement produces a different geometric shape depending on the chart's zoom level, time compression, or display resolution. A 30-point rally on a compressed weekly chart creates a steep, narrow triangle; the identical rally on a stretched intraday chart creates a flat, wide one. The areas differ even though the underlying market event is the same.
To eliminate this distortion, the indicator applies a normalization layer referred to here as the Isotropic Coordinate System (ICS). The principle behind it is dimensional analysis — a well-established technique in physics and engineering for removing unit-dependent artifacts from measurements. The horizontal axis (time) is rescaled by dividing bar offsets by sigma, and the vertical axis (price) is rescaled by dividing the natural logarithm of price by the same sigma. Because both axes share the same divisor, the resulting coordinate plane is isotropic: triangle areas reflect only the structural relationship between price and range boundaries, not how the chart happens to be displayed.
The sigma used for this normalization is the Yang-Zhang (2000) composite volatility estimator, a published academic method (Journal of Business, Vol. 73, No. 3). It combines three independent variance components — overnight (close-to-open), intraday (open-to-close), and the Rogers-Satchell high-low-close estimator — into a single unbiased measure with minimum-variance weighting. This makes sigma robust across instruments with overnight gaps (equities, futures) and those that trade continuously (forex, crypto).
The practical result: the normalization layer adapts to the volatility regime of each instrument, making triangle areas structurally comparable across different charts and timeframes and reducing the need for manual recalibration when switching instruments.
🔶 The B metric: from triangle geometry to a single number
The core output of this indicator is a single value called B, which captures the instantaneous buyer-versus-seller balance in one dimensionless number.
Picture any bar on your chart. The indicator draws two right triangles around it. The upper triangle sits between the bar's high and the range ceiling: its three vertices are (1) the current bar's high, (2) the range ceiling at the current bar, and (3) the range ceiling at the prime-offset bar, 101 bars back. This triangle represents seller territory — the geometric "room" that sellers occupy above the current price. The lower triangle mirrors this below: its vertices are the current bar's low, the range floor at the current bar, and the range floor at that same prime-offset bar. This is buyer territory — the room below the current price. The larger the seller triangle relative to the buyer triangle, the more the market is tilted toward selling pressure, and vice versa.
Why prime-numbered offsets?
The indicator uses the first 25 prime numbers (3, 5, 7, 11, ... 97, 101) as its sampling offsets. Prime numbers share no common factors with each other or with any periodic cycle in the data. When a signal is sampled at evenly spaced intervals (e.g. every 10, 20, 30 bars), there is a risk that the sampling grid locks onto a periodic pattern in the price — a weekly cycle, an options expiration rhythm, or any recurring structure — and either amplifies or masks it. This is a form of harmonic aliasing. Prime offsets avoid this: because no prime is a multiple of any other, the sampling set {3, 5, 7, ... 101} is maximally non-periodic, ensuring that each offset captures a structurally independent slice of the price range.
Two roles: measurement and visualization
For the B calculation itself, only the widest triangle is used — the one anchored at prime offset 101. This single pair of triangles (upper and lower) captures the broadest structural pressure across the entire lookback window. The remaining 24 primes serve a visual role: they generate the triangle fan overlay you see on the chart. But this visual layer is not merely decorative. Each triangle in the fan maps a pressure boundary at a different time horizon.
As the screenshot above illustrates, candles that approach the red triangle edges tend to encounter resistance and reverse — the fan effectively draws a multi-scale map of where selling pressure intensifies. The blue fan does the same for buyer pressure below. Taken together, the fan gives the trader a spatial reading of how pressure distributes across shorter and longer horizons.
A notable property observed during testing across multiple instruments and timeframes: regardless of triangle size or lookback period, B consistently produces values within the bounded range of -1 to +1. This is not a coincidence — it is a mathematical consequence of the symmetric ratio formula that derives B from the two triangle areas.
The formula
Both triangle areas are first computed using the Shoelace formula — a standard computational geometry method that yields the exact area of any polygon from its vertex coordinates. Then B is derived through a symmetric ratio:
r1 = A_hi / A_lo r2 = A_lo / A_hi B = (r1 - r2) / (r1 + r2)
When the seller triangle is much larger than the buyer triangle (A_hi >> A_lo), r1 grows large while r2 shrinks, and B approaches +1. When buyer pressure dominates, B approaches -1. When both areas are equal, B = 0 — balanced pressure. The formula is symmetric by construction, meaning it treats buyer and seller sides with identical mathematical weight.
Percentage conversion
To make B immediately readable on the chart, the indicator converts it into two percentage values:
Red % = (B + 1) x 50 seller dominance, scale 0 to 100
Blue % = (1 - B) x 50 buyer dominance, scale 0 to 100
Red % and Blue % always sum to 100. They are available in the Data Window for any bar and are exposed as alert-ready plots, allowing traders to set threshold-based alerts (e.g. "Red % crosses above 80") directly from TradingView's alert builder, without writing any code.
🔶 Features at a glance
🔸 Gradient barometer — A vertical column rendered to the right of the last bar. It splits the effective range into a red (seller) zone and a blue (buyer) zone, with the dividing line set by B. The gradient fades from full opacity at the split point to near-transparent at each range boundary, giving an immediate visual sense of which side is dominant and by how much.
🔸 Prime triangle fan — 25 filled triangles (one per prime offset from 3 to 101) overlaid on the chart. Upper triangles are colored red (seller pressure), lower triangles blue (buyer pressure). Together they form a fan that maps pressure intensity across multiple time horizons simultaneously. Optional dashed outlines can be enabled for each side independently.
🔸 Range lines with price labels — Horizontal lines marking the effective high and low of the lookback window. Each line carries a price label placed to the left of the range start. When the channel is frozen (see Freeze/Revival below), a snowflake icon (❄) appears on the labels.
🔸 Diamond markers and prime labels — At each prime-offset bar, a diamond marker is placed at both the range ceiling and the range floor. The corresponding prime number is displayed above the ceiling diamond, providing a visual ruler of the sampling structure.
🔸 Freeze / Revival system — When a confirmed close breaches the range boundary, the mother channel freezes and a child channel is born on the breach side. The child computes its own pressure metric (B'), and when the opposing force inside the child reaches a user-defined threshold, the mother channel revives. This mechanism tracks regime transitions without discarding the prior range context. A dedicated label at the breach candle shows the child's B' value in real time.
🔸 Live and Closed display modes — "Live" updates tick by tick using the current bar's data. "Closed" anchors all calculations on the last confirmed bar, eliminating intra-bar noise for traders who prefer signal stability.
🔸 Data Window and alert-ready plots — Three invisible plots (Red %, Blue %, raw B) are exposed in the Data Window and available for TradingView's alert condition builder. Traders can create threshold, crossover, or crossing alerts on any of these values without writing Pine Script.
🔸 Full visual customisation — Every visual element (triangle fill colors, line colors, diamond size, text size, barometer width, barometer offset, gradient steps) is independently configurable through the indicator's settings panel.
🔶 Deep dive: the barometer
The barometer is a vertical gradient column displayed to the right of the last bar on the chart. Its purpose is to translate the abstract B value into a shape that the eye can read instantly: a column split into a red zone (seller pressure) on top and a blue zone (buyer pressure) on the bottom.
The column spans the full effective range — from rangeLow at the bottom to rangeHigh at the top. The split point between red and blue is not placed at the midpoint of the range. Instead, it is calculated directly from B:
yMid = rangeHigh − (B + 1) × range / 2
When B = 0 (balanced), yMid sits at the exact center of the range. When B approaches +1 (full seller dominance), yMid drops toward the range floor, making the red zone fill nearly the entire column. When B approaches −1 (full buyer dominance), yMid rises toward the range ceiling, and the blue zone dominates.
The gradient is rendered using a configurable number of boxes (default: 50). In the red zone, opacity is strongest near yMid and fades to near-transparent at rangeHigh. In the blue zone, opacity is strongest near yMid and fades toward rangeLow. This creates a natural "heat" effect: the most intense color always concentrates at the boundary where the two forces meet.
At the top and bottom of the column, percentage labels display the Red % and Blue % values. These are the same percentages available in the Data Window, presented here as a quick visual reference.
The barometer responds to the selected display mode. In "Live" mode, it updates on every tick using the current bar's B value. In "Closed" mode, it uses the B computed from the last confirmed bar, providing a stable reading that does not flicker with intra-bar price movement.
Barometer settings
🔸 Show barometer — Toggle the entire barometer on or off. Default: on.
🔸 Offset (bars right) — How far to the right of the last bar the column is placed. Default: 11. Increase this if the barometer overlaps with other right-margin elements.
🔸 Width (bars) — The horizontal thickness of the column, measured in bars. Default: 5.
🔸 Gradient steps — The number of boxes used to render the gradient. Higher values produce a smoother fade. Default: 50.
🔶 Deep dive: the prime triangle fan
The triangle fan is the indicator's signature visual element. It renders 25 filled triangles on the chart — one for each prime offset from 3 to 101 — fanning out from the current bar toward the left side of the lookback window. Upper triangles are shaded red (seller pressure) and lower triangles are shaded blue (buyer pressure), each with high transparency so the underlying candlesticks remain clearly visible.
Every triangle in the fan shares two of its three vertices with the current bar: the bar's high (for upper triangles) or the bar's low (for lower triangles), and the corresponding range boundary at that bar. The third vertex sits at the range boundary at the prime-offset bar. Because each prime offset is a different distance back in time, the triangles vary in width — the smallest is narrow and captures very short-term pressure, while the largest stretches across the full lookback and captures the broadest structural picture.
Reading the fan as a pressure map
The fan functions as a multi-scale pressure map. Each triangle edge represents a boundary where one side's territory begins. When price approaches a cluster of red triangle edges from below, it is entering a zone where seller pressure intensifies across multiple time horizons simultaneously. The denser the overlap of red edges at a given price level, the stronger the structural resistance at that level. The same logic applies in reverse for blue edges and buyer support.
This is visible in practice: candles that push into the red fan often stall or reverse at the triangle boundaries, while candles that drop into the blue fan tend to find support. The fan gives the trader a spatial sense of how much room each side has — a wide blue zone with thin red edges suggests buyers have structural space to move, and vice versa.
Color flipping during freeze
When the Freeze/Revival system is active and price moves beyond the frozen range boundary, the triangle colors on the breached side flip to reflect the new structural reality.
Consider a downward breach: price closes below the frozen rangeLow and continues falling. The lower triangles — which normally appear blue to represent buyer territory — switch to red. This signals that what was once the buyer's domain has been structurally penetrated; the geometry now measures selling pressure extending below the old floor. At the same time, the upper triangles remain red as they always are, and because the distance between the current price and the frozen rangeHigh has grown dramatically, the seller area expands. The visual result: the entire fan turns uniformly red, reflecting overwhelming seller dominance across every time horizon in the fan.
The mirror case works identically. During an upward breach, price closes above the frozen rangeHigh and continues rising. The upper triangles flip from red to blue, signaling that seller space has been penetrated from below. The lower triangles remain blue, and because the gap between the current price and the frozen rangeLow is now vast, buyer area dominates. The entire fan turns uniformly blue, reflecting overwhelming buyer dominance.
The color flip is automatic and requires no user intervention. It is driven entirely by the relationship between the current price and the frozen boundaries — when price returns inside the frozen range, colors revert to their normal assignment.
Diamond markers and prime labels
At each prime-offset bar, the indicator places diamond-shaped markers at both the range ceiling and the range floor. Above the ceiling diamond, the prime number itself is displayed as a label. These markers serve as a visual ruler: they show the trader exactly where each sampling point falls in time and make the non-periodic spacing of the primes immediately visible on the chart.
Fan settings
🔸 Show lower triangle lines / Show upper triangle lines — Toggle dashed outlines for each side. Default: off. When enabled, the outlines make individual triangle edges more distinct, which can be helpful when reading overlapping edges at specific price levels.
🔸 Lower / Upper line color — Stroke color for the dashed outlines.
🔸 Lower / Upper fill color — Fill color and transparency for the triangle bodies. Default: high transparency so candles remain readable.
🔸 Show vertical lines — Draws a vertical line at each prime-offset bar. Default: off.
🔸 Show prime labels — Displays the prime number and diamond at each offset. Default: on.
🔸 Diamond color / Diamond size — Visual styling for the diamond markers.
🔸 Label text size — Font size for the prime number labels.
🔸 Deep dive: Freeze / Revival
Markets do not stay inside ranges forever. When price breaks out, most range-based indicators simply reset and start a new range from scratch, discarding whatever structural context existed before the breakout. The Freeze/Revival system takes a different approach: it preserves the prior range as a frozen reference while simultaneously tracking the new regime that emerges beyond it.
How a freeze is triggered
A freeze occurs when a confirmed close — not a wick, not an intra-bar spike — breaches the effective range boundary. The indicator compares the previous bar's close against the range that existed one bar before it, so the breach signal is fully confirmed and cannot repaint. Once a breach is detected:
🔸 The mother channel freezes — its high and low are locked at the values they held just before the breach.
🔸 A child channel is born on the breach side. For an upward breach, the child's floor is the frozen rangeHigh and its ceiling expands with each new high. For a downward breach, the child's ceiling is the frozen rangeLow and its floor drops with each new low.
🔸 A snowflake icon (❄) appears on the range price labels, and the triangle colors flip as described in the section above.
The child channel and B'
While the mother channel is frozen, the child channel computes its own independent pressure metric called B'. B' uses the same ICS triangle formula as the mother's B, but measured against the child's own boundaries. This means B' tracks the buyer/seller balance exclusively inside the new regime — the territory beyond the old range.
A dedicated label appears at the breach candle showing the current B' value, converted to the percentage of the opposing force. For a downward breach, the label displays the buyer percentage inside the child; for an upward breach, it displays the seller percentage. This tells the trader how much counter-pressure is building inside the breakout zone.
B' as a structural overbought / oversold reading
When B' shows a very low opposing-force percentage shortly after a breach, the breakout side is structurally dominant — price has moved aggressively beyond the old range with minimal resistance. This condition is analogous to what traders call an overbought or oversold state, but derived from geometry rather than from momentum oscillators. The reading reflects the spatial imbalance between the two forces inside the child channel: one side occupies nearly all the geometric territory.
As time passes, if the opposing force gradually builds — the B' percentage climbs — it signals that the breakout is losing its structural one-sidedness. The market is beginning to rebalance inside the new territory. Watching B' evolve over successive bars gives the trader a real-time gauge of whether the breakout retains its structural conviction or is approaching exhaustion.
Revival: when does the freeze end?
The freeze lifts when the opposing force inside the child channel reaches a user-defined threshold (default: 50%). At that point, the indicator interprets this as the exhaustion of the breakout: the force that drove the breach is being met by equal or greater counter-pressure. The freeze is lifted, all freeze state is reset, and the mother channel resumes normal range tracking. The snowflake icons, B' label, and color flips are removed.
The revival threshold is configurable. A lower value makes the system more sensitive — it revives sooner, treating even moderate counter-pressure as a regime reset. A higher value makes it more patient — it waits for stronger opposition before releasing the freeze. The default represents balanced equilibrium: the freeze ends when the opposing side has matched the breach side.
Why this matters
The Freeze/Revival cycle gives the trader a structured way to observe regime transitions. Rather than watching a range silently reset after a breakout, the trader sees the old range preserved as context (frozen lines with ❄), the new regime measured in real time (B' at the breach candle with its overbought/oversold implication), and a clear signal when the transition is complete (revival). This makes it possible to distinguish between a genuine regime change and a brief spike that reverts — without relying on arbitrary time delays or fixed-bar re-entry rules.
🔸 Reading the indicator
This indicator does not generate buy or sell signals. It is a measurement tool that quantifies the geometric balance between buyer and seller pressure. How that measurement is incorporated into a trading decision is entirely up to the trader. The following observations describe what the indicator shows, not what the trader should do.
The barometer as a quick-glance gauge
The barometer provides the fastest reading. A column dominated by red indicates that seller pressure is structurally larger than buyer pressure across the lookback window. A column dominated by blue indicates the reverse. When the split point sits near the center, pressure is approximately balanced. Watching how the split point migrates over successive bars reveals whether the pressure balance is shifting gradually or remaining stable.
The fan as a spatial context layer
The triangle fan adds spatial depth to the barometer's single-number reading. While the barometer tells you the current balance, the fan shows you where that balance is concentrated in price space. Areas where multiple triangle edges converge represent zones of intensified pressure — structural resistance above (red edges) or structural support below (blue edges). When price trades inside a region with sparse triangle coverage, it has more structural room to move before encountering the next pressure boundary.
Freeze events as regime markers
When a freeze occurs, it marks a structural event: price has left the established range. The frozen lines (marked with ❄) preserve the old context, and B' at the breach candle provides a real-time measure of how one-sided the new regime is. A very low opposing-force reading in B' indicates a structurally extended condition — the breakout side has occupied nearly all geometric territory. As B' climbs toward the revival threshold, it indicates increasing counter-pressure. The moment of revival itself marks the point where the new regime's one-sidedness has been structurally neutralized.
Combining readings
The three visual layers — barometer, fan, and freeze state — work together. For example, a barometer showing strong seller dominance combined with a fan whose red edges are densely clustered near the current price suggests concentrated structural resistance. If a freeze is also active with a low B', the structural picture is one of strong directional conviction on the breach side. Conversely, a barometer near balance with widely spaced fan edges and no active freeze suggests a structurally neutral environment.
Data Window and alerts
The Red %, Blue %, and raw B values are available in TradingView's Data Window for any bar by hovering over it. These same values are exposed as alert-ready plots, meaning traders can set alerts directly from TradingView's alert builder — for example, triggering when Red % crosses above or below a chosen level, or when B crosses zero. No Pine Script knowledge is required to create these alerts.
🔸 Open-source structure and reusability
This script is published open-source under the Mozilla Public License 2.0. The full computation pipeline — the Yang-Zhang volatility estimator, the ICS coordinate transformation, the Shoelace area calculation, and the symmetric ratio that produces B — is readable, auditable, and reusable.
B is a bounded output: it always falls between −1 and +1, carries no unit, and is computed from normalized geometry. These properties make it suitable as an input for other scripts. Examples of how B can serve as input to further analysis include:
🔸 Plotting B as a standalone oscillator with its own zero line and structural extremes.
🔸 Applying moving averages of different periods to B and studying their crossovers as indicators of shifting pressure regimes.
🔸 Using B as a weighting coefficient to scale other measurements by the current geometric pressure balance.
🔸 Comparing B across timeframes, since the ICS normalization makes the metric structurally comparable regardless of the chart resolution.
🔸 Testing for divergences between B and price action.
🔸 Using B as a filter condition for entry or exit logic in other strategies.
The code is available for study and extension under MPL 2.0. Traders and developers who wish to build on this metric have full access to its derivation.
🔸 Settings reference
Range Lines
🔸 Lookback length — Number of historical bars used to compute the high/low range. Default: 101.
🔸 Line width — Pixel width of the horizontal range lines. Default: 1.
🔸 Display mode — "Live" updates tick by tick using the current bar. "Closed" anchors on the last confirmed bar, eliminating intra-bar noise. Default: Live.
ICS
🔸 ICS Window — Number of bars fed into the Yang-Zhang volatility estimator. Controls how much historical data shapes the normalization sigma. Default: 101.
Prime Verticals and Labels
🔸 Show vertical lines — Draws a vertical line at each prime-offset bar. Default: off.
🔸 Show prime labels — Displays the prime number and diamond marker at each offset. Default: on.
🔸 Vertical line color — Color for vertical lines at prime offsets.
🔸 Diamond color — Color of diamond markers and their labels.
🔸 Label text size — Font size for prime number labels, in points.
🔸 Diamond size — Size of the diamond-shaped markers, in points.
Prime Triangles
🔸 Show lower triangle lines — Toggle dashed outlines for lower (buyer) triangles. Default: off.
🔸 Show upper triangle lines — Toggle dashed outlines for upper (seller) triangles. Default: off.
🔸 Lower line color — Stroke color for lower triangle dashed outlines.
🔸 Upper line color — Stroke color for upper triangle dashed outlines.
🔸 Lower fill color — Fill color and transparency for lower (buyer) triangle bodies.
🔸 Upper fill color — Fill color and transparency for upper (seller) triangle bodies.
Barometer
🔸 Show barometer — Toggle the barometer column on or off. Default: on.
🔸 Offset (bars right) — Horizontal distance from the last bar to the barometer column. Default: 11.
🔸 Width (bars) — Horizontal thickness of the barometer column. Default: 5.
🔸 Gradient steps — Number of boxes used to render the gradient. Higher values produce a smoother fade. Default: 50.
Freeze and Revival
🔸 Revival threshold (B') — When the opposing force inside the child channel reaches this percentage, the freeze ends and the mother channel resumes. A lower value revives sooner; a higher value waits for stronger counter-pressure. Default: 50.
🔸 Disclaimer
This indicator is a technical analysis tool designed for educational and informational purposes. It measures the geometric balance between buyer and seller pressure using the methodology described above. It does not predict future price movements, does not guarantee any outcome, and does not constitute financial, investment, or trading advice.
The B metric, the barometer, the triangle fan, and the Freeze/Revival system are structural measurements derived from historical price data. Like all technical indicators, they reflect past and present conditions and carry inherent limitations. Market conditions can change rapidly, and no single measurement tool can account for all factors that influence price.
Traders should use this indicator as one component within a broader analytical framework, always in combination with their own research, risk management practices, and judgment. Past performance of any reading or pattern observed through this indicator is not indicative of future results.
Use this tool at your own risk. The author assumes no liability for any trading decisions made based on the information provided by this indicator. 指标

Cody Zig ZagCody Zig Zag Indicator - Complete Explanation
This is a Zig Zag indicator that replicates the MetaTrader 4 (MT4) version, which works differently than TradingView's built-in Zig Zag. Here's what it does:
🎯 What is a Zig Zag Indicator?
It filters out minor price movements to show only significant swing highs and swing lows, helping you identify trends and chart patterns (head & shoulders, double tops/bottoms, etc.).
⚙️ User Settings (Inputs)
Setting Default What It Does
Depth 6 Lookback period to find local highs/lows
Deviation 5 Minimum price change (in ticks) to form a new swing point
Backstep 2 Minimum bars between swing points
Line Thickness 2 Zig Zag line width
Bull Color Lime Color for upward moves
Bear Color Red Color for downward moves
Repaint Levels true If ON, lines/labels adjust real-time; if OFF, they lock on close
🔍 How It Works (The "Bake" Section)
Step 1: Find Potential Pivot Points
p_lw = Most recent low within Depth bars
p_hg = Most recent high within Depth bars
Checks if price moved enough (Deviation * tick size) to qualify
Step 2: Determine Direction
down = Boolean (true = bearish/downward leg, false = bullish/upward leg)
Tracks whether we're connecting a high→low (down) or low→high (up)
Step 3: Draw Zig Zag Lines
Connects alternating swing highs and swing lows
Labels each point as:
HH = Higher High
LH = Lower High
LL = Lower Low
HL = Higher Low
🏷️ Labels Explained
When price makes a new swing point, you'll see:
HH (Higher High) - Bullish continuation signal
LH (Lower High) - Bearish reversal signal
LL (Lower Low) - Bearish continuation signal
HL (Higher Low) - Bullish reversal signal
📊 Visual Features
Colored Zig Zag lines: Green for up-legs, Red for down-legs
Background color: Green during bullish legs, Red during bearish legs (90% transparent)
Labels: Tiny triangles pointing up/down with text
⚠️ Repaint Behavior (Important!)
Repaint = ON (default) Repaint = OFF
Lines/labels update in real-time Locks on bar close
Can "repaint" history More reliable for backtesting
Good for real-time trading No historical repainting
Warning: Zig Zag indicators naturally repaint because they need future bars to confirm pivot points. The repaint option controls HOW they repaint.
🚨 Alerts
This script triggers alerts when:
Direction Changed - Zig Zag switches from up to down or down to up
Bullish Direction - Switches from down to up
Bearish Direction - Switches from up to down
📈 How to Use
Identify Trend: Upward Zig Zag = Uptrend; Downward = Downtrend
Find Patterns: Look for HH/HL patterns (bullish) or LH/LL patterns (bearish)
Divergence: Compare Zig Zag swings with oscillator indicators
Support/Resistance: Swing points act as natural S/R levels
⚡ Quick Summary
This indicator draws a line connecting significant price swings, ignoring small noise. It's great for:
Visualizing trend structure
Identifying chart patterns
Finding entry/exit levels
Spotting trend reversals 指标

Big Order Candle DetectorBig Order Candle Detector (BOCD) – Explanation & Usage
The Big Order Candle Detector (BOCD) is an indicator designed to identify potential large institutional order activity in the market. It focuses on detecting strong price displacement, which may signal the early stage of a trend.
This structure allows the indicator to capture moments where price moves aggressively, often without overlap with previous price ranges. Such behavior can indicate the presence of strong buying or selling pressure.
How Big Order is Detected
A Bullish Big Order is identified when the current candle’s low is higher than the high of Candle A. This indicates a clear gap or displacement upward, suggesting strong buying interest.
A Bearish Big Order, on the other hand, occurs when the current candle’s high is lower than the low of Candle A, reflecting strong downward pressure.
To reduce noise, the script only marks the first Big Order signal when multiple signals appear consecutively. This ensures cleaner and more meaningful signals.
Visual Representation on Chart
The indicator provides several visual elements to assist analysis:
Triangle Signals
Green triangle → Bullish Big Order
Red triangle → Bearish Big Order
→ Represents early momentum or possible trend initiation
Highlighted Candle (Orange)
→ Considered the origin of the move or liquidity zone
Support & Resistance Box
Drawn based on the high and low of Candle A
→ Acts as a reaction zone for future price movement
Strategy & How to Use
This indicator is best used as a supporting tool for price action analysis, not as a standalone trading signal.
BUY Scenario (Bullish Setup)
When a bullish Big Order appears, it suggests that strong buying momentum has entered the market. Instead of entering immediately, traders typically wait for price to retrace.
Approach:
Wait for price to pull back into the support box, Look for confirmation signals before entering
Confirmation Examples:
Bullish candlestick pattern (e.g., engulfing, pin bar)
Minor break of structure
Increase in volume
Trade Plan:
Entry: Inside the support box (after confirmation)
Take Profit: Nearest resistance zone or previous high
Stop Loss: Below the support box
SELL Scenario (Bearish Setup)
In a bearish setup, the indicator signals strong selling pressure. Similar to the bullish case, traders wait for a retracement rather than chasing the move.
Approach:
Wait for price to move back into the resistance box, Look for signs of rejection
Confirmation Examples:
Bearish rejection candle
Formation of lower high
Weak bullish momentum
Trade Plan:
Entry: Inside the resistance box (after confirmation)
Take Profit: Nearest support zone
Stop Loss: Above the resistance box
Key Concept Summary
Big Order = Strong displacement (possible institutional activity)
Triangle = Signal of momentum
Orange Candle = Origin zone
Box = Key support/resistance area
Retracement = Entry opportunity
Confirmation = Risk control
Important Considerations
This indicator:
Does not guarantee winning trades
Should not be used alone
Always combine with:
Risk management
Market structure analysis
Additional confirmation tools
In practice, BOCD works best as:
A decision-support tool to identify high-probability zones, rather than a direct buy/sell system. 指标

Liquidity Fracture [JOAT]Liquidity Fracture
Introduction
Liquidity Fracture is an open-source stop-hunt and liquidity sweep detection engine that identifies, classifies, and visualizes four distinct types of liquidity events in real time. The four types are: Swing Cluster Zones where retail stop orders accumulate, Wick Rejection Traps where engineered wick candles are designed to trigger stops, Sweep Events where price spikes through a level and recovers inside, and Volume Reversal Zones where institutional footprints appear as high-volume directional rejections.
The problem liquidity analysis solves is that the most reliable entry locations are not at obvious support and resistance levels — they are just beyond them, at the price points where the greatest concentration of stop-loss orders sit. When institutional order flow needs to fill large positions, it engineers moves into those stop clusters to provide the liquidity required. Liquidity Fracture maps those clusters, labels the sweep events when they occur, and records volume-backed reversal zones where the institutional absorption is visible in the data.
Core Concepts
1. Four Zone Types and Their Rationale
Each zone type targets a different category of liquidity event:
Swing Cluster Zones mark recent pivot highs and lows — the locations where the majority of retail stop-loss orders are placed. Price regularly engineers moves into these clusters to trigger stops before reversing. These zones are drawn as boxes above pivot highs (sell-side liquidity above) and below pivot lows (buy-side liquidity below).
Wick Rejection Traps identify candles where the wick-to-body ratio exceeds a configurable threshold. A candle with a dominant upper wick closing near its lows is an engineered candle designed to trigger buy stops above the high before rejecting. The wick ratio determines whether a candle qualifies as a trap:
wickUp = high - math.max(open, close)
bodySize = math.abs(close - open)
isWickTrap = wickUp / (high - low) > wickThreshold
Sweep Events capture the core liquidity hunt pattern: price wicks through a tracked zone level and closes back inside. The sweep label fires at the closing bar of the event with a styled label indicating the direction (SWEEP up or down).
Volume Reversal Zones identify bars where volume exceeds a configurable multiple of the 20-bar average volume, price reversal is confirmed by a close in the opposite half of the candle, and the move represents a statistically significant displacement. These are the bars where institutional absorption of the sweep is most likely visible.
2. Zone Distance and Deduplication
To prevent the chart from becoming cluttered with overlapping zones at the same price level, a minimum zone distance filter measured in ATR multiples prevents new zones from being drawn within that distance of an existing zone of the same type:
minDist = atr * minZoneDist
// New zone only drawn if > minDist from any existing zone
The maximum zones per type setting caps how many of each zone type can exist simultaneously. When the cap is reached, the oldest zone is automatically removed as new ones are added.
3. Heatmap Intensity
Each zone carries a heat intensity value based on how many times price has revisited it without sweeping through. Zones that price has respected multiple times increase in visual intensity — a darker, more opaque zone represents a higher-tested liquidity cluster that has proved significant. This provides immediate visual ranking of zone importance without requiring the trader to manually assess each zone.
4. Sweep Event Detection and Labeling
A sweep is detected when price penetrates a zone's boundary and closes back inside during the same bar. The sweep label appears directly at the sweep bar using styled labels (SWEEP) with directional styling — label pointing up for bullish sweep (price wicked below a low zone and closed above it), label pointing down for bearish sweep (price wicked above a high zone and closed below it):
bullSweep = low < zoneBottom and close > zoneBottom
bearSweep = high > zoneTop and close < zoneTop
5. Zone Type Labels
Each box drawn on the chart receives a text label in its upper corner identifying its zone type: SWING HI, SWING LO, WICK TRAP, or VOL REV. This allows traders to immediately understand what category of liquidity event they are looking at without needing to remember color assignments.
Features
Four liquidity zone types: Swing Cluster Zones, Wick Rejection Traps, Sweep Events, and Volume Reversal Zones — each independently togglable
Styled sweep labels: SWEEP labels with directional pointing arrows at the exact bar where the wick-and-close confirmation occurs
Zone type text labels: Every box labeled with its zone type (SWING HI, SWING LO, WICK TRAP, VOL REV) in the upper corner
Heatmap intensity: Zone color opacity increases with each price revisit, visually ranking zone significance
ATR-based zone distance filter: Minimum ATR distance between zones of the same type prevents overlapping or duplicate zones
Volume spike detection: Configurable volume multiplier threshold for Volume Reversal Zone qualification
Wick ratio threshold: Configurable wick-to-candle-range fraction for Wick Rejection Trap qualification
Maximum zones per type: Cap on simultaneous zones per category with automatic oldest-zone removal
Zone base transparency: Configurable transparency for all zone fills simultaneously
Institutional dashboard (top right): Sweep count, active zone counts by type, ATR, and volume ratio
Fully configurable colors: Each zone type has its own independent color input
Sweep alerts: Separate alertconditions for bullish and bearish sweep events
Input Parameters
Detection:
Swing Lookback: Left/right pivot bars for swing zone detection (default: 20)
Swing Threshold %: Minimum price move % for swing qualification (default: 2.0)
Volume Spike Multiplier: Multiple of average volume required for Volume Reversal Zone (default: 2.0)
Wick Ratio Threshold: Wick-to-range fraction for Wick Trap qualification (default: 0.6)
ATR Length: ATR period for buffer and distance calculations (default: 14)
ATR Buffer Multiplier: Zone size extension as ATR multiple (default: 0.5)
Max Zones Per Type: Maximum simultaneous zones of each type (default: 5)
Min Zone Distance (ATR): Minimum ATR distance between same-type zones (default: 2.0)
Display:
Individual zone type toggles: Swing Cluster Zones, Wick Rejection Traps, Sweep Events, Volume Reversal Zones
Heatmap Intensity toggle
Show Zone Labels toggle
Show Dashboard toggle
Zone Base Transparency: 30-92 (default: 75)
How to Use This Indicator
Step 1: Identify Active Liquidity Clusters
Swing Cluster Zones (red above, green below) mark where the nearest stop clusters sit. The most saturated (darkest) zones have been tested most frequently and represent the highest-concentration liquidity pools. These are the primary targets for engineered price moves.
Step 2: Watch for Wick Trap Formations
Wick Rejection Trap zones appear when a candle forms with a disproportionately large wick. These candles are the mechanism by which stops are triggered — the wick penetrates the stop cluster while the close retreats. A Wick Trap zone followed by a Sweep event on the same level is a high-probability combination.
Step 3: React to Sweep Labels
When a SWEEP label appears, a stop cluster has been penetrated and price has recovered inside in a single bar. This is the liquidity hunt completion pattern. A bullish sweep (below a low zone, close above) suggests buy-side liquidity was provided and a reversal is possible. Confirm with volume.
Step 4: Use Volume Reversal Zones as Confirmation
Volume Reversal Zones mark where institutional absorption is most likely visible. A sweep into a cluster followed by a Volume Reversal Zone on the recovery bar provides the highest-confidence combination this indicator can produce.
Step 5: Assess Zone Freshness
Freshly created zones (lighter color) have not been tested. Heavily revisited zones (darker) have withstood multiple price touches. Focus attention on the darkest zones — they represent the most significant concentration of resting orders.
Indicator Limitations
Swing zone detection uses pivot logic with a right-bar offset. Zones are confirmed several bars after the actual pivot, creating a slight lag in zone creation
The volume spike filter relies on exchange-reported volume. On synthetic instruments, indices, or assets with thin or unreliable volume reporting, Volume Reversal Zones will not be accurate
Zone distance filtering prevents duplicate zones, but in volatile, fast-moving markets, zones can form rapidly and crowd the chart before the maximum zone cap removes old ones
Sweep detection requires the close to recover inside the zone on the same bar as the wick penetration. Multi-bar sweeps (where recovery takes multiple bars) are not detected as sweep events — the level simply becomes the new zone boundary
This indicator identifies liquidity events. It does not provide directional entry signals or determine the probability that a reversal after a sweep will be sustained
Originality Statement
Liquidity Fracture is original in its simultaneous, unified detection and visualization of four distinct liquidity event types within a single indicator with a unified heatmap intensity system. This indicator is published because:
The classification of four independent liquidity event types (swing cluster, wick trap, sweep, volume reversal) — each with its own detection logic, independent toggle, and color — into a single, unified zone management system is uncommon in published open-source Pine Script
The heatmap intensity system that increases zone visual weight with each price revisit provides automatic, data-driven zone importance ranking without any manual assessment
The zone deduplication system using ATR-based minimum distance prevents the false signal accumulation that occurs in naive pivot-based zone indicators that draw every pivot regardless of proximity
The zone type labeling system (SWING HI, SWING LO, WICK TRAP, VOL REV) inside each box allows instant identification of event type without relying solely on color memory
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss. Liquidity zone detection and sweep signals are based on historical price and volume patterns. The identification of a sweep event does not guarantee a reversal, and zone levels can be violated without producing the expected reaction. Always use proper risk management. The author is not responsible for any trading losses resulting from the use of this indicator.
-Made with passion by jackofalltrades
指标

Market Phase Detector [JOAT]Market Phase Detector
Introduction
Market Phase Detector is an open-source market structure classification engine that continuously identifies whether price is operating in a Bullish Trend, Bearish Trend, or Range state. The classification uses three independent inputs that must align simultaneously before a regime is confirmed, making the output robust against single-factor noise and false positives that plague simpler trend detectors.
The problem Market Phase Detector solves is context. Trend-following entries during range conditions produce whipsaws. Mean-reversion entries during strong trending moves produce losses against the dominant flow. Knowing the regime before interpreting any other signal improves the relevance of every decision made from it. Market Phase Detector makes that determination automatically, updates it bar by bar, and visualizes both the current regime and every structural event that contributed to it — including labeled BOS and CHoCH events with horizontal level lines, live swing extension lines at the right edge, and an institutional-grade dashboard.
Core Concepts
1. Swing Detection and Pivot Tracking
Price structure is derived from pivot highs and lows confirmed using ta.pivothigh() and ta.pivotlow() with a configurable symmetric lookback. The lookback controls sensitivity — a value of 5 requires 5 bars on each side of the pivot to confirm it, producing only the most structurally significant swings. Each confirmed pivot updates the tracked level and resets its broken flag to allow new break detection on the next cycle:
pivHi = ta.pivothigh(high, swingLen, swingLen)
pivLo = ta.pivotlow(low, swingLen, swingLen)
if not na(pivHi)
topLevel := pivHi
topBroken := false
2. Break of Structure vs Change of Character
Two structural event types are distinguished and tracked independently. A Break of Structure (BOS) occurs when price closes through the previous swing extreme in the same direction as the current structural bias — confirming continuation. A Change of Character (CHoCH) occurs when price closes through the previous swing extreme against the current structural bias — signaling a potential regime flip:
bosBull = bullBreak and structureBias == 1
chochBull = bullBreak and structureBias != 1
Every event is labeled directly on the chart with a horizontal line at the break level and a text label (BOS +, BOS -, CHoCH +, CHoCH -). Running counts of each type are tracked and displayed in the dashboard.
3. Three-Factor Regime Gate
The regime classification evaluates all three inputs simultaneously before assigning a state. Structure bias is set by BOS and CHoCH events. The volatility gate compares current ATR to a moving average of ATR multiplied by a contraction threshold — when ATR falls below this level the market is classified as compressed and the regime defaults to Range regardless of structure or momentum. Momentum uses a smoothed rate-of-change that must confirm the structural direction:
if isLowVol
regime := 0 // Range — volatility gate overrides everything
else if strBias == 1 and roc > 0
regime := 1 // Bullish
else if strBias == -1 and roc < 0
regime := -1 // Bearish
else
regime := 0 // Inconclusive — range
A confidence score (1-3) counts how many of the three factors currently agree and is displayed in the dashboard, allowing the trader to distinguish a fully confirmed 3/3 regime from a weaker 2/3 reading.
4. Swing Level Extension Lines
The current unbroken swing high and swing low are extended as dotted horizontal lines to the right edge of the chart with price labels. These serve as the nearest structural reference levels — the next points where a BOS or CHoCH could occur. They are deleted and redrawn each bar using barstate.islast so they remain current without consuming the indicator's line budget:
if barstate.islast and showSwingExt
line.delete(swingHiLine)
swingHiLine := line.new(topBar, topLevel, bar_index + 4, topLevel,
color=color.new(#E65100, 45), style=line.style_dotted, width=2)
5. Regime Background Shading
The chart background is tinted according to the current regime — faint teal for Bullish, faint orange for Bearish, neutral gray for Range. This gives immediate context at a glance without adding visual noise to the price action.
Features
Three-state regime output: Bullish, Bearish, and Range states derived from structure, volatility, and momentum alignment
BOS and CHoCH event labels: Every structural break labeled on-chart with event type, direction, and horizontal level line
Independent BOS and CHoCH counters: Running totals of each structural event type in the dashboard
Swing level extension lines: Dotted right-edge lines at the current unbroken swing high and low with price labels
ATR-based volatility gate: Low-volatility contraction forces a Range classification regardless of structure or momentum
Smoothed momentum confirmation: Rate-of-change must align with structure before a trending regime is confirmed
Confidence scoring (1/3 to 3/3): Quantifies how many of the three classification factors are currently aligned
Regime background shading: Chart background tint reflects the current regime in real time
Institutional dashboard (top right): 15-row table with regime state, confidence, last break direction and age, BOS and CHoCH counts, swing levels, and ATR
Fully configurable colors: Bullish, bearish, and ranging tints plus structure line colors are independently adjustable
All signals confirmed bar only: No repainting — all structural events fire on barstate.isconfirmed
Input Parameters
Structure Detection:
Swing Lookback: Left/right bars required for pivot confirmation (default: 5)
ATR Period: ATR calculation length (default: 14)
Regime Classification:
Volatility MA Length: MA length for ATR comparison (default: 20)
Range Contraction Multiplier: ATR fraction below which the market is classified as ranging (default: 0.7)
Momentum Lookback: Rate-of-change lookback and EMA smoothing period (default: 10)
Display:
Regime Background Shading toggle
Show Dashboard toggle
Show Structure Lines toggle
Show Swing Level Extensions toggle
How to Use This Indicator
Step 1: Read the Current Regime
Check the REGIME row in the dashboard. BULLISH, BEARISH, or RANGE appears in its corresponding color. This is the primary output. Use it to establish directional bias before consulting any other signal source.
Step 2: Check Confidence Score
The Confidence row shows how many of the three inputs align (e.g., 2/3). A 3/3 reading means structure, volatility, and momentum all agree. A 2/3 reading means one factor is diverging. Weight directional decisions higher during full 3/3 alignment.
Step 3: Monitor CHoCH Events
Each CHoCH label marks a structural break against the current bias — a warning that the regime may be shifting. When a CHoCH appears, watch whether subsequent bars confirm a new opposing BOS or whether the previous regime resumes.
Step 4: Use Swing Extension Lines as Forward Reference
The dotted right-edge lines mark the current unbroken swing levels — the nearest structural break zones. Knowing how close price is to these levels frames where the next BOS or CHoCH could occur.
Step 5: Apply Regime as a Filter
Market Phase Detector is designed as a context layer, not a standalone signal generator. Apply the regime output as a filter to your existing tools: only take long signals when the regime is Bullish, only take short signals when Bearish, and step aside or apply mean-reversion logic when Range is active.
Indicator Limitations
Pivot detection confirms swingLen bars after the pivot forms, creating a natural offset between the candle where the swing occurred and when it is labeled. This is intentional non-repainting behavior
The volatility gate may temporarily classify a new trend as Range immediately after a volatility expansion if ATR has not yet risen above the threshold. This resolves within a few bars as ATR normalizes
In slow, grinding markets, momentum may repeatedly lag structure, resulting in extended Range readings during mild trends
Market Phase Detector classifies current market state. It does not predict future price direction or generate entry/exit signals
Originality Statement
Market Phase Detector is original in its three-factor gate requiring independent alignment of structure, volatility, and momentum before any regime is confirmed. This indicator is published because:
The combination of CHoCH and BOS structural logic, an ATR contraction gate, and a smoothed momentum filter into a single lightweight classifier that produces a confidence score is uncommon in published open-source Pine Script v6
Distinguishing BOS from CHoCH within the same indicator — with independent event counts and labeled historical events — provides structural context that standalone trend indicators do not offer
The confidence scoring system (1-3) quantifies the strength of the current regime reading across three independent analytical dimensions, not just a single oscillator value
Swing level extension lines provide live structural reference at the right edge of the chart without requiring the user to manually draw levels or add a separate pivot indicator
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss. Regime classifications are based on historical price data and do not guarantee any future market behavior. All three factors can produce inaccurate readings in atypical market conditions. Always use proper risk management. The author is not responsible for any trading losses resulting from the use of this indicator.
-Made with passion by jackofalltrades
指标

Apex Reversal Engine💥Apex Reversal Engine: S&R and Momentum Exhaustion💥
⚙️Apex Reversal Engine is an advanced analytical script built specifically for Forex swing traders and position traders operating on higher timeframes (1H to 1D). Its primary objective is to identify high-probability market reversal zones by finding the exact point where structural price levels intersect with extreme momentum exhaustion.
⚙️ The Core Concept & Algorithmic Logic
Many traders struggle with false breakouts or entering reversal trades too early because they rely solely on isolated technical concepts. Trading pure Support/Resistance often leads to getting stopped out by fakeouts, while trading pure RSI often leads to catching "falling knives" in strong trends.
⚙️This script is built on a deliberate mashup of two distinct technical concepts to filter out these low-probability setups:
🚀Automated Support & Resistance (Structural Analysis): The algorithm dynamically maps the chart to identify key historical liquidity zones. It calculates significant pivot highs and pivot lows over a specific lookback period to draw objective Support and Resistance (S&R) lines. These lines represent areas where the market has previously shown strong rejection, indicating institutional interest or historical supply/demand imbalances.
🚀RSI Momentum Validation (Velocity Analysis): To validate these structural levels, the script integrates a calibrated Relative Strength Index (RSI). The RSI measures the velocity and magnitude of recent price changes to evaluate overvalued or undervalued conditions.
⚙️The Mashup Justification:
🚀The true originality of the Apex Reversal Engine lies in its stringent confluence engine. The script will not generate a buy signal just because the price hits a support line, nor will it fire a signal just because the RSI is oversold. An entry signal is printed only when the price tests a recognized Support/Resistance line simultaneously with an extreme RSI reading. This specific algorithmic gating ensures that we only look for reversals when structural barriers are met with mathematical momentum exhaustion.
⚙️ How to Use the Indicator
For optimal performance, this script is calibrated for the Forex market and should be applied to higher timeframes, specifically ranging from 1-Hour (1H) to 1-Day (1D) charts. Using it on lower timeframes may introduce unwanted market noise.
⚙️The script is designed with a clean UI, avoiding unnecessary chart clutter, and outputs clear, actionable labels:
📈Long Entry (Bullish Setup): Wait for a bullish signal label to appear. This signifies that the price is currently testing a major Support Line AND the internal RSI module has registered an extreme oversold condition, suggesting downside exhaustion and a potential upward reversal.
📉Short Entry (Bearish Setup): Wait for a bearish signal label. This confirms that the price is testing a major Resistance Line AND the RSI is heavily overbought, indicating upside exhaustion and a high probability of a downward reversal.
⚠️Risk Management:
These automated S&R lines double as excellent risk management tools. Stop Loss (SL) orders can be placed logically just outside the tested Support or Resistance zone to invalidate the setup if the level breaks. Take Profit (TP) targets can be scaled out at the next opposing S&R level.
🔒 Note on Script Originality
(Include this section if you are publishing as Closed-Source / Invite-Only)
The source code is protected because the specific lookback algorithms used for dynamic S&R generation, the specific calibration of the momentum oscillator for 1H-1D Forex charts, and the precise logical confluence rules are proprietary. The underlying logic described above empowers users to fully understand the mechanics of the trade setups without exposing the raw, backtested parameters that make the script unique.
⚠️Disclaimer: This script is for educational and analytical purposes only. Trading Forex on any timeframe carries a high level of risk and may not be suitable for all investors. Past performance is not indicative of future results. Always use proper risk management and never risk more than you can afford to lose. 指标

Adaptive Volume-Delta Score (VDS) | Order-Flow & DivergenceThe Adaptive Volume-Delta Score (VDS) is a technical analysis tool for the statistical classification of volume-delta activity. It utilizes an Adaptive-Switch Logic that toggles between historical bar reconstruction (request.security_lower_tf) and a real-time Rolling-Window Live-Tracker.
🛠 Core Functionality
1. The VDS Engine (Statistical Mapping)
Wick-Weighted Delta: The calculation is based on wick-weighting: (close-open)/range * volume. This weights the delta according to price displacement within the bar.
Symmetrical Mapping (-4.5 to 4.5): Raw values are statistically categorized via ta.percentrank and mapped onto a fixed scale.
+4.5 (100% Rank): The absolute maximum within the chosen lookback period.
+2.25 (75% Rank): Significant activity relative to the period.
0 (Median): The statistical midpoint (50% Rank).
-4.5 (0% Rank / Min.): The absolute floor of activity for the period.
Visualization Logic: This mapping is primarily used to plot volume activity and delta aggression within the same visual space, providing a consistent reference frame for comparing relative dominance.
Context Dependency: Signals are not absolute recommendations. The significance depends heavily on the Lookback Period, Thresholds, and the specific market environment.
2. Adaptive Logic & Data Integrity
Signal-Bridge: On lower timeframes (LTF), the indicator simulates the behavior of the Main Timeframe (Main-TF) using a rolling window. This allows for the observation of delta development while the bar is still forming.
🛡️ Integrity Dashboard: Visualizes the statistical consistency between live data and the historical baseline. Deviations (e.g., due to Pine Script's 5000-bar limit) are displayed transparently as warnings.
3. Dynamic Alert System
Automation: Alerts utilize the alert() function with the "Any function call" setting.
Intelligence: Messages are fully dynamic, reporting the mode (Live vs. History), signal type, safeguard status, and data integrity.
🚀 Quick Calibration Guide
Sensitivity: A longer Lookback Period stabilizes the statistics; a shorter period makes the score more reactive to short-term volume spikes.
Threshold Setup: Calibrate the Dominance Threshold (default 3.0) to isolate extreme aggression. Use the Volume Threshold to ensure a minimum level of market participation.
Visual Match: Activate the Price Chart Overlays and adjust your thresholds until the markers (Diamonds) correspond with your individual market interpretation.
Dashboard Check: Monitor the Confidence Score. If red warning values appear, consider adjusting your Lookback or Timeframe to maintain a stable statistical foundation.
🎨 Visual Guide: Understanding the Scale
Navy/Blue Columns: Standard activity within the selected statistical window.
Gray Columns: Phases below the Low Volume Threshold, indicating low relative market participation.
Lime/Fuchsia (Dominance): Occurs when volume and delta simultaneously exceed the defined thresholds (Aggression).
Olive/Maroon (Divergence): Period delta is positive/negative while price action is opposite (Decoupling/Absorption).
Diamonds: Optional projection of oscillator signals directly onto the candles in the price chart.
⚠️ Important Technical Notifications
The "Signal Bridge" (Rolling vs. Fixed Window):
HTF-Request Mode (Fixed): Measures delta starting from the candle open (e.g., 12:00 PM).
Live-Transfer Mode (Rolling): Analyzes a sliding window (e.g., the last 120 minutes). This provides a Lead-Time Advantage, detecting aggression as it happens regardless of the HTF clock. Both modes converge at the HTF bar close.
Data Integrity & Anomalies:
Session Gaps: High Main-TFs (like D1) can be affected by irregular session hours (e.g., Forex Sunday). Always monitor the Confidence Score (🛡️).
Replay Mode:
Displays "No Stat. Control" if historical LTF data is unavailable. We prioritize data honesty over estimated data.
🔔 How to set Alerts (Smart Signals)
Preparation: Open the VDS settings. Under "Alert Settings", choose which signals should trigger: Dominance, Divergence, or both.
Condition: Select "Adaptive Volume-Delta Score...".
Trigger Logic: Change setting to "Any alert() function call".
Frequency: Managed by the script (once_per_bar_close) to ensure statistical honesty.
Timeframe Choice: Use the Main-TF for final confirmed signals, or a Lower-Timeframe for Live-Tracker early warnings.
📊 Statistical Transparency (Data Window)
Raw metrics are displayed exclusively in the TradingView Data Window to keep the chart clean:
Runtime-Safe LTF: The analysis interval currently in use.
Max Safe Lookback: The mathematical limit for your current setup (5,000-bar ceiling).
Active Bar Limit: The actual usable data foundation.
Converted Sum of LTF Request Bars: The historical baseline used as an anchor for the Live-Tracker.
Relative Live-Data Size: Numerical basis of the Confidence Score (100% = Perfect Integrity).
Overall Requested Bars: Total data points analyzed within your Lookback Period. 指标

Solstice Fibonacci Engine [JOAT]Solstice Fibonacci Engine
Introduction
The Solstice Fibonacci Engine is a fully automatic Fibonacci retracement and extension tool built for traders who want institutional-grade price levels drawn on their chart without the tedium of manually dragging anchor points. It detects the dominant swing high and swing low within your currently visible chart range, recalculates every time you scroll or zoom, and renders the complete Fibonacci suite — retracements from 0% to 100% and extensions to -100% — in a single, clean overlay.
The engine is purpose-built around two price zones that institutional order flow traders treat as highest-probability areas: the OTE (Optimal Trade Entry) zone from 61.8% to 78.6% retracement, and the Target Zone from -50% to -61.8% extension. These zones are shaded and labeled automatically, with TP1 through TP4 labels placed at the key confluence levels that align with those areas, giving you a ready-made trade management framework the moment any new swing is established.
Core Concepts
Visible Range Swing Detection
Unlike most Fibonacci tools that require manual anchoring or use fixed lookback lengths, Solstice tracks the swing high and swing low within the portion of the chart you are actually looking at:
int visLeft = int(chart.left_visible_bar_time)
int visRight = int(chart.right_visible_bar_time)
bool isVis = time >= visLeft and time <= visRight
if isVis
if na(swHi) or high > swHi
swHi := high
swHiBar := bar_index
if na(swLo) or low < swLo
swLo := low
swLoBar := bar_index
When you scroll left or right the swing resets instantly to reflect your new visible window. This makes the tool behave like a dynamic Fibonacci that always measures the most contextually relevant move — the one you are actually analyzing.
Trend Direction from Swing Sequence
The engine determines whether price is in an uptrend or downtrend by comparing the bar index of the swing high against the bar index of the swing low:
bool trendUp = nz(swLoBar, 0) < nz(swHiBar, 0)
If the swing low came first (left) and the swing high came after (right), price moved up — so retracement levels are drawn from the top down. If the swing high came first, price moved down and levels are drawn from the bottom up. This single boolean drives whether TP1–TP4 labels are placed above or below current price.
OTE Zone — 61.8% to 78.6%
The Optimal Trade Entry zone marks the golden pocket of Fibonacci retracement theory. Price returning into this band after a clean impulsive move often finds the institutional order flow that originally created the swing:
if showOTE
fibZone(color.new(oteClr, 90), 61.8, 78.6, trendUp,
bar_index - 2, lx, swHi, swLo, "OTE ZONE")
The zone is rendered as a shaded box extending to the right of the last visible bar, keeping it visible as new bars form. An alert fires on bar close the first time price enters this zone after it was outside it.
Target Zone — -50% to -61.8% Extension
The Target Zone marks the take-profit extension area beyond the 0% level:
if showTgt
fibZone(color.new(tgtClr, 90), -50.0, -61.8, trendUp,
bar_index - 2, lx, swHi, swLo, "TARGET ZONE")
When price has retraced into the OTE and reversed, the -50% to -61.8% extension zone becomes the natural profit target objective — where the move typically exhausts before the next consolidation.
TP1–TP4 Trade Management Labels
Four take-profit labels are placed at the levels that define a complete trade management plan from entry to full profit-taking:
| Label | Level | Meaning |
|-------|-------|---------|
| TP1 | 38.2% | First objective — scalp or partial close |
| TP2 | 0% | Full return to the original swing point |
| TP3 | -27.2% | First extension beyond the swing |
| TP4 | -61.8% | Deep extension — full target zone |
Features
Auto swing detection from visible chart range — no manual anchoring required
Dynamic recalculation on every chart scroll or zoom
Full Fibonacci suite: 0%, 23.6%, 38.2%, 50%, 61.8%, 70.6%, 78.6%, 100%, -27.2%, -50%, -61.8%, -100%, 150%, 200%
Per-level toggle switches — show only the levels you want
OTE Zone (61.8%–78.6%) shaded box with right-extension
Target Zone (-50% to -61.8%) shaded box with right-extension
TP1–TP4 labels with optional percentage labels on every level
Optional swing diagonal line from anchor to anchor
Dashboard showing swing trend, zone touch status, swing high/low, and range
Auto dark/light theme detection
Alerts fire on confirmed bar close when price enters OTE or Target Zone
Webhook JSON alert format for automation
Watermark
Input Parameters
Main Settings
Show All Elements — master toggle for all drawing objects
Show Swing Diagonal Line — draws a line connecting the two swing anchor points
Line Width — 1 to 5 pixels
Line Style — Solid, Dashed, or Dotted
Label Offset (bars) — how far to the right labels are placed beyond the last bar
Fibonacci Levels
Individual toggles for each level: 0%, 23.6%, 38.2%, 50%, 61.8%, 70.6%, 78.6%, 100%, -27.2%, -50%, -61.8%, -100%, 150%, 200%
Zones and Targets
Show OTE Zone — toggles the 61.8%–78.6% shaded box
Show Target Zone — toggles the -50% to -61.8% shaded box
Show Zone Labels — text inside zone boxes
Show TP1–TP4 Labels — take-profit label markers
Show Level % Labels — percentage text on every drawn level line
Visual Settings
Theme — Auto (reads chart background), Dark, or Light
Show Dashboard — compact panel showing current swing readings
Dashboard Position — Top Left, Top Right, Bottom Left, Bottom Right
Show Watermark
Webhook JSON — switches alerts to machine-readable JSON format
Colors
Fib Lines — color for all retracement/extension level lines
OTE Zone — fill color for the OTE box
Target Zone — fill color for the Target Zone box
How to Use
Add the indicator to any chart on any timeframe — it automatically maps to your current visible range.
Zoom or scroll your chart to frame the impulsive swing you want to analyze. The Fibonacci grid recalculates to match.
Look for price to retrace into the OTE Zone (gold band between 61.8% and 78.6%). This is the institutional entry area.
When price reverses out of the OTE zone, monitor the TP1 label at 38.2% for partial profits, TP2 at 0% for full return to the swing origin, and TP3/TP4 in the Target Zone for extended runners.
Set the OTE Zone and Target Zone alerts to receive notifications when price enters either area on bar close.
Enable percentage labels if you need to confirm exact level values for manual entries.
Indicator Limitations
The swing is determined by the highest high and lowest low within the visible range only — it does not use a structural pivot detection algorithm. On heavily zoomed-out charts, the swing might span an unusually long period.
Fibonacci levels are mathematical retracements of the detected swing range. They are areas of interest, not guaranteed reversal zones. Always combine with your own confluence analysis.
The OTE and Target Zone alerts trigger only on the first bar close when price enters the zone from outside. If price exits and re-enters, a new alert fires.
Retracement drawing regenerates on every bar close at the last bar. On very high-resolution timeframes with large numbers of active objects, this can approach TradingView drawing limits.
Originality Statement
The Solstice Fibonacci Engine is an original Pine Script v6 implementation. Its use of chart.left_visible_bar_time and chart.right_visible_bar_time for dynamic visible-range swing detection is a novel approach that produces a self-adjusting Fibonacci tool with no manual intervention. The OTE and Target Zone framework, TP1–TP4 label system, and scroll-responsive recalculation are original design decisions made specifically for this publication.
Disclaimer
This indicator is for educational and informational purposes only. It does not constitute financial advice. Fibonacci levels are areas of potential price reaction, not certainties. Past Fibonacci confluence does not guarantee future performance. Always use proper risk management and consult a licensed financial professional before trading.
-Made with passion by jackofalltrades
指标

In1 + In2 Dual Confirmation SignalsIn1 + In2 Dual Confirmation Signal Indicator
What It Tracks
This indicator is essentially a two-filter confirmation system designed to keep you out of low-quality trades. It combines two completely different approaches to reading the market — one tracks momentum and trend direction, the other tracks buying/selling pressure — and only fires a signal when both agree at the same time. Think of it like needing two different analysts to sign off on a trade before you take it.
The Two Engines
In1 — Stochastic SuperTrend
The first engine is a hybrid of two classic tools: the RSI and the Stochastic oscillator, fed into a SuperTrend framework.
Here's what it's doing under the hood:
It calculates the RSI of price, then runs a Stochastic calculation on that RSI (not on price directly). This smooths out a lot of noise.
That Stochastic RSI value is then used as the "price" input for a SuperTrend algorithm, which dynamically plots upper and lower bands and flips direction when the value breaks through them.
When the SuperTrend flips bullish and the Stochastic RSI is below 50 (not overbought), you get an In1 Buy arrow. When it flips bearish and the Stochastic RSI is above 50 (not oversold), you get an In1 Sell arrow.
The below/above 50 filter is important — it prevents the indicator from calling a bullish flip when momentum is already stretched high, and vice versa.
In2 — EVEREX (Engineered Volume & Price Flow)
The second engine is more sophisticated. It's measuring the quality and direction of buying vs. selling pressure on each candle by looking at multiple factors simultaneously:
How the candle closed relative to its range
The spread between open and close
How much price actually shifted
Volume weighting on all of the above
It normalizes all of these inputs and produces a single oscillator line. When that line flips from falling to rising, the background goes green (bulls taking over). When it flips from rising to falling, it goes red (bears taking over). The signal fires on those flip moments specifically — not while it's already trending in one direction.
How the Dual Confirmation Logic Works
This is where it gets smart. The indicator doesn't require both signals on the exact same candle — that would be too restrictive and you'd miss a lot of valid setups. Instead, it uses a lookback window:
For a BUY signal to fire:
In1 must have printed a bullish arrow on this candle OR within the last 1–2 candles
AND if In1 fired 1–2 bars ago (not this candle), the Stochastic RSI line must still be rising — confirming the momentum hasn't already reversed
AND In2 must flip green on this candle (that's the confirmation trigger)
For a SELL signal to fire:
Same logic in reverse — In1 bearish arrow within 1–2 candles, Stoch RSI still falling, In2 flips red
The B/S label prints on the candle where In2 flips — that's your entry candle.
Adjusting Signal Frequency
To get MORE signals (more sensitive, more trades, more false positives):
Lower the ST Multiplier (default 10) — a smaller multiplier makes the SuperTrend flip more often
Lower the RSI Length (default 10) or K (default 7) — shorter lookbacks react faster
Lower the EVEREX Length (default 10) or Signal Length (default 5) — the EVEREX oscillator will flip more frequently
To get FEWER signals (more selective, higher quality, fewer trades):
Raise the ST Multiplier — SuperTrend becomes harder to flip, only strong moves qualify
Raise the RSI Length and K — smoother, slower momentum readings
Raise the EVEREX Lookback (default 20) — the volume normalization uses a longer baseline, making it harder for a single candle to register as significant
Raise the EVEREX Length and Smooth — the oscillator becomes less twitchy
The Timeframe input is also huge — running In1 on a higher timeframe than your chart while watching In2 on the current chart creates a natural multi-timeframe filter that dramatically reduces noise.
How Alerts Work
There's a single alert condition called "In1+In2 Signal" that fires on either a Buy or Sell signal. When you set up the alert in TradingView, set it to "Once Per Bar Close" for confirmed signals, or "Once Per Bar" if you want real-time notification (more on that below). The message simply tells you a dual confirmation signal fired and to check the chart for the B/S label.
Real-Time vs. After Close — The Repainting Question
This is the most important thing for any trader to understand about this indicator.
In2 (EVEREX) is fully real-time and does NOT repaint. It's calculated purely from current bar data — price action, spread, volume — so what you see on the forming candle is what you get. If it flips green mid-candle, that flip is real.
In1 has a setting called "Wait for Timeframe Close." This is critical:
When turned ON — In1 only updates when the selected timeframe candle fully closes. The SuperTrend flip is confirmed and will not repaint. This is the safer setting for signal reliability.
When turned OFF — In1 updates in real time using lookahead. You'll see signals earlier, but if the higher timeframe candle closes differently than it looked mid-bar, the signal can vanish. This is the classic repainting scenario.
The 1–2 bar lookback window for In1 is also non-repainting because it uses dir , bars_since_up, and direction tracking that are all based on closed bar values — once a bar closes, those values are locked. So a signal that printed on a closed candle will stay there.
Bottom line for your workflow: Run "Wait for Timeframe Close" set to ON and set your alert to "Once Per Bar Close" — every signal you see on a closed candle is confirmed and won't disappear on you. 指标
