GProf - Break & RetestGProf - Break & Retest
═══════════════════════════════════════════
OVERVIEW
This indicator detects one complete sequence: consolidation against a key level, a breakout WITH momentum, and the retest of the broken level. It watches the levels for you, stays silent through weak drifts and fakeouts, and speaks at the two moments that matter — when a level breaks with force, and when price comes back to test it.
The core idea is polarity: a level that held for hours gets violated with conviction, and the trade is the market returning to confirm the flip — old support rejecting as new resistance, or old resistance holding as new support.
───────────────────────────────────────────
TWO CONSOLIDATION PATTERNS, ONE CONFIRMATION GATE
PATTERN 1 — TIGHT COIL: a short compressed window pressing directly against the level, with zero closes beyond it. Price knocking on a door.
PATTERN 2 — RANGE-SIT: price spends an extended window entirely on one side of the level, the whole range within a capped height of it, then breaks the boundary. This captures the classic premarket-range breakout or breakdown, where the premarket high or low is the boundary of the consolidation itself.
Either pattern must then be CONFIRMED. A break with no force is fully silent — no label, no alert:
• MOMENTUM CANDLE — the breakout (or a continuation candle within a few bars) has a body of at least a set percentage of the daily ATR; OR
• QUALIFIED FVG — a Fair Value Gap of a set minimum size prints within the confirmation window.
Whichever arrives first arms the setup, and the alert tells you which one it was.
───────────────────────────────────────────
LEVELS AND THE ONE-BREAK DOCTRINE
Tracked levels: PMH/PML, YH/YL, PDC, WH/WL — computed internally, non-repainting, with session boundaries read in exchange time so they hold up through daylight-saving changes and holiday-shortened weeks.
LIFETIME VIRGINITY: a level may signal ONE break per lifetime. The first close beyond it consumes the level; wicks never spend it — sweeps that close back are probes, not violations. A spent level renews when its value changes or at the session roll. This kills re-break noise: a level violated at midday cannot fire again in the evening.
LIVE-LEVEL MATURITY: running levels (WH/WL always; PMH/PML while the premarket window is open) must rest untouched for a set number of bars before they can arm — every new weekly high is technically a "break of WH," and this suppresses that churn while keeping the first quality break.
WHEN "YESTERDAY" ROLLS: Roll Mode is Auto by default — futures roll at the 18:00 ET session open, equities at the next regular-session open — so evening and overnight sessions trade against the levels of the session that just completed.
The full doctrine in one sentence: a level may signal one break per lifetime, provided it has aged while live and is broken with momentum.
───────────────────────────────────────────
THE RETEST — TWO SPECIES
IMMEDIATE KISS-BACK: while the breakout leg is still building, a return to within tolerance of the broken level fires the retest — the fast test-and-reject, often within a bar or two of the break.
SWING 50% RETEST: if price runs instead, the swing confirms, the leg's 50% level is drawn, and the deeper retracement to the 50% or the level — whichever price reaches first — fires the retest.
A+ FLAG: when the leg's 50% coincides with the broken level itself, the retest is tagged A+ — two independent trade logics agreeing on one price.
───────────────────────────────────────────
SIGNALS AND ALERTS
On the chart: the consolidation box, a "B&R " label on the confirmed break, a dotted 50% line once the swing confirms, and a "RETEST " label (with A+ when earned). Breaks that armed but failed are marked with a small x; unconfirmed breaks leave no trace.
Two independent alert stages, each toggleable:
• CONFIRMED BREAKOUT — the level, the direction, and which confirmation fired.
• RETEST ENTERED — the level and price, with the A+ tag when the 50% sits on the level. Off by default; many traders use the breakout alert to get to the chart and watch the retest form.
Alert setup: ONE alert per chart, condition "Any alert() function call", expiration Open-ended. The toggles in settings control what fires. Note: TradingView alerts snapshot settings at creation — after changing settings, recreate the alert.
───────────────────────────────────────────
HOW TO USE IT
Traders who study break-and-retest setups typically treat the breakout alert as the heads-up and the retest as the decision point — watching for a confirmation candle at the retest before acting. The consolidation box shows you what broke; the tags tell you how it was confirmed.
This indicator identifies structure and sequence. It does not generate buy/sell recommendations, does not place trades, and does not replace your own analysis and risk management.
───────────────────────────────────────────
TECHNICAL NOTES
• Non-repainting: every state transition confirms on bar close; ATR uses completed daily bars; no lookahead anywhere.
• Intraday timeframes only. Built for index and commodity futures but works on any liquid symbol; thresholds are a percentage of daily ATR with tick floors, so they travel across instruments and volatility regimes.
• Coil and range windows, momentum and FVG thresholds, maturity, timeouts, retest tolerance, and session times are fully configurable.
───────────────────────────────────────────
DISCLAIMER
This script is for informational and educational purposes only. It does not constitute financial, investment, or trading advice. A broken level retesting is a pattern, not a guarantee of future price behavior. All trading decisions made using this tool are solely the responsibility of the user. Wskaźnik

GProf - Kangaroo TailGProf - Kangaroo Tail
═══════════════════════════════════════════
OVERVIEW
This indicator detects a single, specific reversal event: a liquidity-sweep candle at a meaningful level — the Kangaroo Tail. Price runs an extreme, sweeps through a level where liquidity rests, and is rejected hard within one candle, closing back on the other side.
It is deliberately quiet. Most sessions it prints nothing. It speaks only when a candle sweeps a genuine multi-hour extreme, shows textbook rejection anatomy, and does so at a nameable level. The Kangaroo Tail is not a candle pattern that happens to be near a level — it is a level rejection whose evidence is a candle.
───────────────────────────────────────────
THE CANDLE (KT Short shown — KT Long is the mirror)
1. THE SWEEP — the candle's high prints a new high versus a long lookback (default 78 bars, about 6.5 hours on the 5m). Room to the left, measured in time: the extreme must be genuinely fresh, which excludes signals from inside congestion — you cannot sweep a multi-hour high from within chop.
2. REJECTION ANATOMY — the entire body sits in the bottom third of the range (body position is the filter; color is reported, not required). The opposite wick is capped tightly, and the sweep wick itself must be significant: at least a set percentage of the daily ATR, with a tick floor, so the threshold scales across instruments.
3. CONTEXT — the body sits inside the previous candle's range (toggleable), and a large prior same-direction candle raises a caution tag on the signal rather than suppressing it: the thrust into a level is often strong, and that thrust-sweep-reject sequence is the pattern at its best.
───────────────────────────────────────────
THE LEVEL — REQUIRED, AND MEASURED CORRECTLY
No level, no signal. The confluence set:
• Session levels: PMH/PML, YH/YL, PDC, WH/WL — computed internally, non-repainting.
• Camarilla pivots: R3/R4 for shorts, S3/S4 for longs, from yesterday's RTH high/low/close, DRAWN on the chart (S3/S4 green, R3/R4 red, central pivot marked).
• Up to three custom levels — enter your own higher-timeframe lines and they become part of the confluence set.
Two details most level tools get wrong:
LEVEL-IN-WICK GEOMETRY: the level must lie within the sweep wick's span. A deep sweep THROUGH the level is the pattern at its strongest, not a disqualification. When the wick spans more than one level, the nearest to the wick tip is named.
LIVE-LEVEL MATURITY: a running level (WH/WL always; PMH/PML while the premarket window is open) must rest untouched for a set number of bars before it counts — a sweep candle's own extreme IS the newborn premarket high, and a level seconds old is not structure.
WHEN "YESTERDAY" ROLLS: Roll Mode is Auto by default — futures roll at the 18:00 ET session open, equities at the next regular-session open — so evening and overnight signals test the session that just completed and the Camarilla levels derived from it. Session boundaries are read in exchange time, correct year-round through daylight-saving changes.
───────────────────────────────────────────
SIGNALS AND ALERTS
A qualifying candle prints one label — "KT ▼" or "KT ▲" — carrying its context: the level swept, whether the wick landed inside an unfilled qualified Fair Value Gap, and a caution tag when the prior candle was large.
The alert message includes everything needed to assess without opening the chart: sweep depth in points, the level, FVG confluence, body color, and reference trade geometry — trigger one tick beyond the KT extreme, stop one tick beyond the wick, and the 1:1 target.
Alert setup: add the indicator, create ONE alert with condition "Any alert() function call", expiration Open-ended. Direction is controlled in settings. Note: TradingView alerts snapshot settings at creation — after changing settings, recreate the alert.
A near-miss diagnostics mode (off by default) is available for investigation: candles at a level that fail exactly one anatomy check print a small marker naming it.
───────────────────────────────────────────
HOW TO USE IT
The Kangaroo Tail marks a completed liquidity event at structure. Traders who study these typically look for entry on a break of the candle's extreme in the rejection direction, with the stop beyond the sweep wick — the geometry the alert pre-computes. Keep your own higher-timeframe levels current in the custom slots: the level set is the heart of the tool.
This indicator identifies a candle pattern at a level. It does not generate buy/sell recommendations, does not place trades, and does not replace your own analysis and risk management.
───────────────────────────────────────────
TECHNICAL NOTES
• Non-repainting: all detection confirms on bar close; ATR uses completed daily bars; levels are built from session windows with no lookahead.
• Intraday timeframes only. Built for index and commodity futures but works on any liquid symbol; size thresholds are a percentage of daily ATR with tick floors, so they travel across instruments.
• Sweep lookback, anatomy thresholds, proximity band, maturity, and session times are fully configurable.
───────────────────────────────────────────
DISCLAIMER
This script is for informational and educational purposes only. It does not constitute financial, investment, or trading advice. A rejection candle at a level is a pattern, not a guarantee of future price behavior. All trading decisions made using this tool are solely the responsibility of the user. Wskaźnik

GProf - Levels, RVOL, ATRGProf - Levels, RVOL, ATR
═══════════════════════════════════════════
OVERVIEW
This indicator answers the three questions an intraday trader asks before and during every session, in one tool:
1. LOCATION — Where is price relative to the structure that matters?
2. PARTICIPATION — Who showed up today, compared to a normal day?
3. RANGE — How much movement is statistically normal, and how much has already been spent?
It combines key session levels, time-of-day Relative Volume (RVOL), and a 14-day ATR with a live Range/ATR reading, shown as clean level lines plus a compact on-chart dashboard. Built with index and commodity futures in mind (NQ, ES, YM, RTY, GC, CL and their micros), it works on any intraday symbol with volume data, and adapts its session logic automatically between futures and equities.
───────────────────────────────────────────
LAYER 1: LOCATION — SESSION LEVELS
• YH / YL — Yesterday's High and Low, RTH-only or full session day.
• PDC — Previous Day Close.
• PMH / PML — Premarket High and Low (4:00am–9:30am ET, or the full overnight session to capture the entire Globex range on futures). Live during the premarket, then frozen at the open.
• WH / WL — The current week's running High and Low, updating in real time.
Each level is a labeled horizontal line with a matching price-scale marker. Colors, width, and labels are configurable, and each group toggles independently.
WHEN "YESTERDAY" ROLLS: by default, Roll Mode is Auto — futures roll yesterday's levels at the 18:00 ET session open (the exchange's own trading-day boundary, so evening and overnight sessions reference the day that just completed), while equities and other symbols roll at the next regular-session open. A manual override is available. Session-day and week boundaries are read in exchange time, so they are correct year-round through daylight-saving changes and hold up across holiday-shortened weeks.
───────────────────────────────────────────
LAYER 2: PARTICIPATION — RVOL
Raw volume comparisons mislead: the first 30 minutes of a session always dwarf lunch hour. This RVOL is time-of-day aware. It records the cumulative session-volume profile for each of the last N sessions, then compares today's cumulative volume to the average at the same elapsed minute of the session.
A reading of 100% means participation is exactly normal for this time of day; 150% means today is running half again above normal. The dashboard colors the reading against a configurable threshold. RVOL is a regular-session metric and reads N/A outside those hours.
───────────────────────────────────────────
LAYER 3: RANGE — ATR(14) AND RANGE/ATR
The dashboard shows the daily ATR (default 14 days), calculated from completed daily bars only — stable all day, never repainting intraday.
More useful than the raw number is Range/ATR: today's range so far as a percentage of the ATR. Under 70% (green), a statistically normal amount of range remains. Between 70–100% (orange), the day is approaching its average. Over 100% (red), the day has already exceeded a normal range, so late continuation attempts are fighting a mostly-spent tape.
Optional ATR Projection Bands (off by default) draw Today's Low + ATR and Today's High − ATR as live exhaustion estimates; when they invert, the day has exceeded its average range — visible at a glance.
───────────────────────────────────────────
HOW TO USE IT
Before the open: note where price sits relative to PMH/PML, YH/YL, and PDC. Confluence between these marks the zones most likely to produce reactions.
At the open: watch RVOL. An opening drive on 130%+ participation behaves very differently from one on 60%.
During the session: use Range/ATR as context for continuation versus exhaustion. A breakout attempt at 95% of ATR deserves more skepticism than the same pattern at 40%.
This indicator draws context only. It does not generate signals, place trades, or replace your own analysis and risk management.
───────────────────────────────────────────
TECHNICAL NOTES
• Non-repainting by design: no lookahead requests, no lower-timeframe data. Levels are built from chart-bar session windows; ATR uses completed daily bars; RVOL uses only accumulated history.
• Best on standard intraday timeframes (1m, 3m, 5m, 15m, 30m). Not intended for daily or higher charts.
• RVOL needs its lookback period of visible chart history to build a full profile; readings in the first sessions after loading are based on fewer samples.
• Session times, timezone, and roll behavior are fully configurable; defaults follow US equities/futures conventions.
───────────────────────────────────────────
DISCLAIMER
This script is for informational and educational purposes only. It does not constitute financial, investment, or trading advice. Past behavior of price, volume, or volatility does not guarantee future results. All trading decisions made using this tool are solely the responsibility of the user. Wskaźnik

GProf - FVG AlertsGProf - FVG Alerts
═══════════════════════════════════════════
OVERVIEW
This indicator detects standard 3-candle Fair Value Gaps (FVGs), draws every gap as a live zone, and fires an alert only when a gap is both large enough to matter and sits in an area with room to the left. It is built to surface displacement worth trading and stay silent on the rest.
Everything confirms on the close of the third candle — nothing is drawn or alerted intrabar, so a gap that appears mid-candle and vanishes before the close never produces a false alert.
───────────────────────────────────────────
DETECTION
• Bullish FVG — the current candle's low is above the high from two bars ago. The zone spans from that prior high (bottom) to the current low (top).
• Bearish FVG — the current candle's high is below the low from two bars ago. The zone spans from the current high (bottom) to that prior low (top).
───────────────────────────────────────────
THE ALERT FILTER — SIZE AND ROOM
Every FVG is drawn. An alert fires only when BOTH conditions are met:
1. SIZE — the gap is at least a set percentage of the daily ATR (default 2%), with a tick floor. Measuring against ATR rather than a fixed point value makes the threshold portable: it means the same thing on a fast index future and a slow one, and it adapts as volatility changes. A fixed-points mode is also available.
2. ROOM TO THE LEFT — the origin of the impulse that created the gap must be in clean territory: the anchor level (the extreme of the move) has few prior candle bodies overlapping it across a lookback window (defaults: 3 bodies over 20 bars). A gap that forms in the middle of prior congestion is drawn but does not alert.
Gaps are shown in three tiers so the chart teaches you over time:
• Full color — qualified on size AND room: these alert.
• Muted gray — big enough, but the anchor lacked room to the left: drawn, silent.
• Faint — below the size threshold: drawn, silent.
Watching which large gaps had room and which did not, and how price treats each, tells you where your own thresholds belong.
───────────────────────────────────────────
ZONE MANAGEMENT
• Zones extend right until fully filled: a bullish gap is removed when price trades down through the bottom of the zone, a bearish gap when price trades up through the top.
• Partial fills leave the zone at its original size — the original boundaries remain the reference, not the shrinking remainder.
• A configurable cap limits how many zones stay on the chart; oldest are removed first.
───────────────────────────────────────────
ALERTS — HOW TO SET UP
1. Add the indicator to your chart.
2. Open the Alert dialog and set the Condition to this indicator.
3. Select "Any alert() function call".
4. Set Expiration to Open-ended and choose your notification methods.
One alert covers everything. The Alert Direction input controls what fires: Both, Bullish Only, Bearish Only, or Off. Alert messages include the symbol, timeframe, direction, gap size in points and as a percentage of ATR, whether room-to-the-left is clean, and the exact zone boundaries.
Note: TradingView alerts snapshot the indicator's settings when created. If you change the size threshold or other settings later, edit and re-save (or recreate) the alert for the new values to take effect.
───────────────────────────────────────────
HOW TO USE IT
FVGs mark displacement — areas price moved through so fast that an imbalance was left behind. Many traders study them as zones of interest for retracement entries, targets, or invalidation. This indicator identifies and sizes the gaps, flags the significant ones that also have room to the left, and otherwise stays out of the way. Combine it with your own market structure analysis, session context, and risk management.
This indicator identifies a chart pattern. It does not generate buy/sell recommendations, does not place trades, and does not replace your own analysis and risk management.
───────────────────────────────────────────
TECHNICAL NOTES
• Non-repainting: detection, drawing, and alerts occur on confirmed bar closes only.
• Works on any symbol and timeframe. Size thresholds are a percentage of daily ATR with tick floors, so they travel across instruments and volatility regimes; a fixed-points mode is available.
• Colors, transparency, borders, size threshold, and the room-to-the-left lookback are fully configurable.
───────────────────────────────────────────
DISCLAIMER
This script is for informational and educational purposes only. It does not constitute financial, investment, or trading advice. Fair Value Gaps are a chart pattern, not a guarantee of future price behavior. All trading decisions made using this tool are solely the responsibility of the user. Wskaźnik

Watchlist Curator Stock RankerPick a sector — it scores ten of that sector's biggest names and ranks the top five leaders. A fast, honest starting point for your watchlist.
You've spotted the strong sector. Now — which stocks? Watchlist Curator takes one sector, scores ten of its biggest, most-traded names against the same yardstick, and hands you the top five in ranked order. That's a working watchlist in one look, instead of an hour of chart-flipping.
It works on its own — nothing else required.
Why a composite rank instead of raw relative strength?
Sorting a basket by relative strength alone hands you whatever ran the hardest — which is often the name that's most stretched and least enterable. The Curator's score starts with RS but lets the other components confirm or veto it: the trend stack rewards names in clean uptrends, the RSI sweet-spot deliberately down-ranks anything already overbought, and volume confirms real participation. The point of combining them is to surface leaders you can still enter — a different question than "what went up the most."
What it ranks — clearly said
Each of the 11 sectors carries a fixed basket of ten household-name bellwethers (Technology = AAPL, MSFT, NVDA, AVGO, CRM, AMD, ADBE, ORCL, CSCO, ACN — and so on for the rest). The Curator ranks *within that basket*. It doesn't scan every stock in the sector — it tells you which of the sector's big liquid names lead, which is where most swing traders should be looking anyway.
The Leadership Score (hover the Score header for this on the chart)
Relative strength vs SPY — the stock's % move minus SPY's over the lookback (20 bars by default). The backbone of the score.
Trend stack — up to +6: above the fast EMA, fast EMA above slow, above the slow EMA (+2 each).
RSI sweet spot — +3 only when RSI sits between 50 and 70: trending, but not overbought. This is deliberate — a red-hot name that's already stretched ranks lower on purpose, so the list points you at leaders you can still enter, not chases.
Volume — +2 for trading above its average.
The score is relative-strength % plus points — not a 0–100 scale. The Rating column translates it: 15+ Strong · 5–15 Good · 0–5 Fair · below 0 Lagging the market. The #1 row is highlighted in gold; a name whose data can't load shows "n/a".
How to use it
1. Find the leading sector — use whatever sector-strength read you trust.
2. Pick that sector in the dropdown.
3. Read the top five. Gold row = the current leader.
4. Those names are the charts worth your study time.
Settings — defaults work out of the box
Sector (dropdown, 11 choices) and timeframe (Daily by default — the ranking uses this timeframe no matter what chart you're on).
RS/momentum lookback (20), fast/slow EMA (20/50), RSI length (14).
Stocks to show (up to 5), table position, text size, dark/light theme, colors.
⚠ Educational tool for building a focused watchlist. It ranks relative strength — it does not give buy/sell signals or predict price. Not financial advice. Wskaźnik

MAEM - Macro Barometer
A compact macro dashboard for traders who can't watch four charts at once. MAEM - Macro Barometer places a single table on your active chart showing the live bias (Bullish / Bearish / Flat) and an RSI extreme flag (OB/OS) for four classic macro references: DXY, VIX, US10Y and WTI Crude Oil — the barometers most traders check before pulling the trigger on Gold, indices, or FX, regardless of what you're actually trading.
HOW IT WORKS
- Bias per barometer = price vs EMA + EMA slope (filters out single-tick whipsaws): Bullish only when price is above a rising EMA, Bearish only when price is below a falling EMA, otherwise Flat.
- The RSI column flags OB (overbought) / OS (oversold) on each barometer, so you catch when a macro driver may be running out of steam before it reverses against your position.
- All four barometers are read on your chart's own timeframe via request.security(), non-repainting (lookahead_off).
CUSTOMIZATION
- Toggle each barometer on/off individually.
- Override any of the four symbols if your broker/feed doesn't carry TVC: data.
- Adjust EMA length, RSI length/thresholds, panel position and text size.
Built for traders who want the macro backdrop at a glance without tab-hopping between separate charts — part of the MAEM suite alongside Structure Suite and Volume Suite. Wskaźnik

Buy-Sell Signals using Multi-Logic Trading System
📈 Advanced Multi-Logic Trading System with Trend, Momentum, Breakout and Risk Management
The **Buy-Sell Signals using Multi-Logic Trend, Momentum & Breakout System** is a multi-condition trading indicator designed to help traders identify structured trading opportunities across different market environments.
Unlike a conventional indicator that depends on only one moving-average crossover or oscillator, Buy-sell with Multi-logic Trading Sytem combines:
✅ Market structure and EMA alignment
✅ Higher-timeframe trend confirmation
✅ Session VWAP positioning
✅ RSI and MACD momentum
✅ Bollinger Band positioning and volatility
✅ Volume expansion and OBV direction
✅ Range-breakout confirmation
✅ Sideways-market mean reversion
✅ Dynamic stop-loss and target calculations
✅ Signal management and cooldown controls
The objective is not to produce the maximum number of signals.
The objective is to filter market noise and highlight situations where multiple independent conditions support the same directional view.
━━━━━━━━━━━━━━━━━━━━
🧠 How the Indicator Reads the Market
Buy-sell with Multi-logic Trading Sytem continuously classifies the chart into one of four market conditions:
📈 BULLISH TREND
A bullish trend is identified when:
**Price > Fast EMA > Medium EMA > Slow EMA**
With the default settings, this represents:
**Price > EMA 20 > EMA 50 > EMA 200**
This structure indicates that short-term, medium-term and long-term price positioning is aligned in the bullish direction.
------------------------------------------------
📈 BEARISH TREND
A bearish trend is identified when:
**Price < Fast EMA < Medium EMA < Slow EMA**
With the default settings:
**Price < EMA 20 < EMA 50 < EMA 200**
This indicates complete bearish alignment across the three trend layers.
------------------------------------------------
📈 RANGE / SIDEWAYS
The system studies the previous trading range over the selected Range Lookback.
The current candle is excluded from this range calculation. This allows the indicator to identify a genuine close outside the previous range instead of comparing the breakout candle against a range that already includes it.
A market is treated as sideways when:
• The previous range width remains within the selected percentage threshold
• Complete bullish EMA alignment is absent
• Complete bearish EMA alignment is absent
------------------------------------------------
📈 Transition
The Transition condition appears when the market is neither properly trending nor qualifying as a defined range.
This commonly happens when:
• EMAs are crossing or compressing
• Price repeatedly moves around the EMA ribbon
• The previous trend is weakening
• A new trend has not yet become established
• Price is moving between range and trend conditions
Transition is usually the least reliable environment for mechanical signals.
━━━━━━━━━━━━━━━━━━━━
⚙️ The Four Entry Logic Engines
Buy-sell with Multi-logic Trading System contains four separate entry engines.
Each engine is designed for a different type of market behaviour.
📈 1. Trend-Following Logic
Trend-following logic is designed to participate in an already established directional move.
A bullish trend setup requires:
• Bullish EMA alignment
• Minimum bullish confluence score
• Higher-timeframe bullish permission
• Price above session VWAP
A bearish trend setup requires the opposite conditions.
🔷 Bullish confluence score
The bullish score contains six independent components:
1. Bullish EMA trend alignment
2. RSI positioned between 45 and 72
3. MACD above its signal line with a positive histogram
4. Price above the Bollinger Band basis
5. High volume with bullish OBV behaviour
6. A bullish candle closing above the previous structural swing high
🔷 Bearish confluence score
The bearish score also contains six components:
1. Bearish EMA trend alignment
2. RSI positioned between 28 and 55
3. MACD below its signal line with a negative histogram
4. Price below the Bollinger Band basis
5. High volume with bearish OBV behaviour
6. A bearish candle closing below the previous structural swing low
The **Minimum Trend Confluence** setting determines how many of these six conditions must agree.
🔷 When to use Trend-Following Logic
👉Use it when:
• The EMA ribbon is properly expanded
• Price is making higher highs and higher lows in an uptrend
• Price is making lower highs and lower lows in a downtrend
• Pullbacks are respecting the fast or medium EMA
• Price is consistently holding on the correct side of VWAP
• The higher-timeframe trend supports the trade direction
👉 When to avoid it
Avoid relying on trend logic when:
• EMAs are flat or repeatedly crossing
• Price is trapped inside a narrow range
• The market-condition card shows Transition
• A signal appears directly below major resistance
• A signal appears directly above major support
• Price has already completed a large impulsive move without a pullback
━━━━━━━━━━━━━━━━━━━━
📈 2. Momentum Logic
Momentum logic is designed to detect acceleration before complete trend confluence becomes necessary.
🔷For bullish momentum, the indicator looks for:
• Price above the fast EMA
• RSI above 52
• Positive MACD histogram
• MACD histogram increasing from the previous candle
• Bullish OBV positioning
• Volume confirmation when usable volume is available
• Bullish higher-timeframe permission
• Price above VWAP
🔷Bearish momentum uses the opposite conditions.
Momentum logic can respond earlier than full trend logic because it does not require the complete EMA 20–50–200 alignment or the minimum six-part trend score.
👉 When to use Momentum Logic
Momentum logic is most useful when:
• Price is emerging from consolidation
• A fresh intraday directional move is developing
• Volume is expanding with price
• MACD momentum is accelerating
• Price has reclaimed or rejected VWAP decisively
• A pullback is followed by renewed directional strength
• The higher timeframe already supports the intended direction
👉 When to avoid it
Avoid momentum entries when:
• The momentum candle is unusually extended
• Price is entering a major higher-timeframe supply or demand zone
• Volume expansion is caused by a news spike
• MACD is positive but price structure remains weak
• Price repeatedly crosses VWAP
• The chart has unreliable or unavailable volume data
Momentum logic is especially dependent on meaningful volume and OBV behaviour. It is therefore generally better suited to liquid stocks, indices, futures and other actively traded instruments.
━━━━━━━━━━━━━━━━━━━━
📈 3. Range-Breakout Logic
The breakout engine is designed to identify confirmed movement outside a previously established range.
It does not trigger merely because price trades a few ticks outside the range.
A bullish breakout requires:
• The previous market qualified as a range
• Price closes above the previous range high
• The close exceeds the range by the selected ATR buffer
• The previous candle had not already closed above the range
• The breakout candle closes strongly toward its high
• RSI is above 50
• MACD is bullish
• Volume confirms the move when available and required
• Price is above VWAP
The bearish breakout logic uses the opposite conditions.
🔷 Breakout Confirmation Buffer
The ATR buffer prevents the system from treating a marginal move above or below the boundary as a valid breakout.
A value of **0.15 ATR** means price must close beyond the range boundary by an additional 15% of the current ATR.
Increasing this value creates fewer but more selective breakout signals.
🔷 Breakout Candle Close Position
The candle must also close strongly in the breakout direction.
With a value of **0.60**:
• A bullish breakout candle must close in the upper 40% of its total range
• A bearish breakout candle must close in the lower 40% of its total range
This helps reject candles that break a level intrabar but leave a large rejection wick.
🔷 Important HTF behaviour
The higher-timeframe EMA filter directly controls the Trend and Momentum engines.
The Range-Breakout engine instead uses its own range, ATR, candle-strength, RSI, MACD, volume and VWAP confirmation.
Therefore, traders should still manually inspect the higher-timeframe structure before accepting a breakout signal.
👉 When to use Breakout Logic
Use breakout logic when:
• Price has formed a clean and visible range
• Range boundaries have been tested multiple times
• Bollinger Band width has contracted before expansion
• Volume increases during the breakout
• The breakout candle closes outside the level
• There is sufficient room before the next major structure
• VWAP supports the breakout direction
👉 When to avoid it
Avoid breakout entries when:
• The range is poorly defined
• Price is breaking directly into higher-timeframe resistance or support
• The breakout candle leaves a large rejection wick
• Volume is weak or declining
• Price has already moved far beyond the range before entry
• The breakout occurs during an irregular news candle
• The range threshold is set too loosely and ordinary price movement is being classified as consolidation
━━━━━━━━━━━━━━━━━━━━
📈 4. Sideways Mean-Reversion Logic
Mean reversion is disabled by default because it represents a different trading philosophy from trend-following.
Instead of expecting price to continue moving away from fair value, this engine looks for rejection near the outer areas of a sideways range.
The range is divided into zones:
• Lower reversion area near the bottom 20% of the range
• Upper reversion area near the top 20% of the range
A bullish mean-reversion setup requires:
• Mean-reversion logic enabled
• Market classified as sideways
• Range sufficiently wide relative to ATR
• Price testing the lower reversion zone
• Price closing back above that zone
• A bullish rejection candle
• A sufficiently large lower wick
• RSI below 38
• RSI turning upward when the RSI-turn filter is enabled
• Volume permission
A bearish mean-reversion setup requires the opposite conditions near the upper range zone, with RSI above 62 and turning downward.
🔷 Important Mean-Reversion Behaviour
Mean-reversion trades are intentionally based on sideways-market rejection.
They do not use the higher-timeframe trend or VWAP filter in the same way as the Trend and Momentum engines.
This is logical because a range-fading trade may temporarily move against the prevailing higher-timeframe direction.
However, it also means mean-reversion mode should be activated only when the trader has independently confirmed that the market is genuinely balanced and range-bound.
👉 When to use Mean Reversion
Use it when:
• The market has clear horizontal boundaries
• EMA alignment is absent
• Price repeatedly rejects both sides of the range
• The range is wide enough to offer practical reward
• RSI reaches an extreme and begins turning
• The rejection candle closes back inside the range
• No major breakout catalyst is expected
👉 When not to use it
Disable mean reversion when:
• The market is strongly trending
• The EMA ribbon is expanding
• Price is forming one-sided momentum candles
• Volume is increasing near the range boundary
• A breakout is supported by broader-market direction
• Price is repeatedly pressing one boundary without meaningful rejection
Repeated testing of one range boundary can represent pressure accumulation rather than a reversal opportunity.
━━━━━━━━━━━━━━━━━━━━
🔍 Higher-Timeframe Trend Filter
The higher-timeframe filter compares price with an EMA calculated on the selected higher timeframe.
👉When enabled:
• Long Trend and Momentum setups require bullish HTF positioning
• Short Trend and Momentum setups require bearish HTF positioning
The higher-timeframe calculation is designed to use confirmed information rather than future-looking data.
🔷 Suggested timeframe combinations
These are practical starting points and should be tested for each instrument:
• 3-minute chart → 15-minute or 30-minute HTF
• 5-minute chart → 30-minute or 60-minute HTF
• 15-minute chart → 60-minute or 4-hour HTF
• 30-minute chart → 4-hour HTF
• 1-hour chart → 4-hour or Daily HTF
• 4-hour chart → Daily or Weekly HTF
A closer HTF produces more opportunities.
A larger HTF produces fewer but more structurally selective opportunities.
━━━━━━━━━━━━━━━━━━━━
📍 Session VWAP Filter
VWAP acts as the indicator’s intraday fair-value reference.
👉When enabled:
• Long Trend, Momentum and Breakout setups require price above VWAP
• Short Trend, Momentum and Breakout setups require price below VWAP
This reduces situations where a bullish technical setup appears below intraday fair value or a bearish setup appears above it.
👉Keep VWAP enabled when:
• Trading intraday
• Trading indices or liquid stocks
• Trading momentum continuation
• Trading opening-range or consolidation breakouts
• Filtering counter-directional entries
👉 Consider disabling VWAP when:
• Trading higher timeframes where session VWAP has less relevance
• Trading instruments with irregular sessions
• Testing a pure swing-trading model
• Using another manually defined fair-value framework
Disabling VWAP increases flexibility but may also increase counter-directional signals.
━━━━━━━━━━━━━━━━━━━━
📊 Volume and OBV Confirmation
The indicator compares current volume with its moving average.
With the default multiplier of **1.5**, high volume means the current volume is at least 1.5 times the selected average volume.
OBV is then compared with its own moving average to determine whether cumulative volume behaviour supports buyers or sellers.
The system is designed so that missing volume does not automatically block every setup.
However, symbols with reliable exchange volume are preferred, particularly when using Momentum Logic.
🔷 Volume Multiplier Interpretation
• 1.20–1.40: More responsive, but more noise
• 1.50: Balanced default
• 1.70–2.00: Strong expansion required
• Above 2.00: Very selective and mainly suited to exceptional participation
━━━━━━━━━━━━━━━━━━━━
🛡️ Stop-Loss and Target Engine
Every confirmed signal creates an active entry, stop-loss and target.
The indicator provides three stop-loss methods.
🔷 Structure + ATR
👉For a long trade:
The stop is placed below the previous structural swing low with an additional ATR buffer.
👉For a short trade:
The stop is placed above the previous structural swing high with an ATR buffer.
This is generally the preferred method for price-action and structure-based trading.
🔷ATR Stop
The stop is calculated using a fixed ATR multiple from the entry.
This method adapts to current volatility without depending on the location of a previous swing.
It can be useful for:
• Momentum setups
• Instruments with irregular swing structures
• Fast-moving markets
• Systematic risk standardisation
🔷 Fixed Percentage Stop
The stop is placed at a fixed percentage from entry.
This is simple but does not adjust to changing volatility.
It should be used carefully because the same percentage may be too tight in a volatile market and unnecessarily wide in a quiet market.
━━━━━━━━━━━━━━━━━━━━
📈 Target Methods
🔷Risk-to-Reward Target
The target is calculated from the actual distance between entry and stop.
With a 1.5 risk-to-reward ratio, the target is 1.5 times the defined trade risk.
🔷 ATR Target
The target is positioned at a selected ATR multiple from entry.
This can be useful for momentum trades where price expansion is expected.
🔷 Fixed Percentage Target
The target is placed at a fixed percentage from entry.
This is straightforward but less adaptive than ATR or structure-based calculations.
━━━━━━━━━━━━━━━━━━━━
🎯 Preferred Risk Settings
🔷 Structure-Based Intraday Trading
• Stop Method: Structure + ATR
• Structure ATR Buffer: 0.15–0.25
• Target Method: Risk:Reward
• Risk:Reward: 1.5–2.0
🔷 Momentum Trading
• Stop Method: ATR
• Stop ATR Multiplier: 1.2–1.8
• Target Method: ATR or Risk:Reward
• Target ATR Multiplier: 2.0–3.0
🔷 Swing Trading
• Stop Method: Structure + ATR
• Swing Lookback: 10–20
• Structure ATR Buffer: 0.20–0.40
• Target Method: Risk:Reward
• Risk:Reward: 1.5–2.5
🔷 Mean-Reversion Trading
• Stop Method: Structure + ATR or ATR
• Use a stop beyond the rejected range boundary
• Avoid excessively wide targets
• Consider the opposite side or midpoint of the range as practical structure
These values are starting points, not universal settings. Different instruments have different volatility and structural characteristics.
━━━━━━━━━━━━━━━━━━━━
🚦 Signal-Control System
Buy-sell with Multi-logic Trading System includes several controls to prevent repeated or conflicting signals.
👉 Minimum Bars Between Signals
The cooldown prevents the indicator from producing another signal immediately after the previous one.
Default: **5 bars**
Lower values create more frequent signals.
Higher values reduce repeated entries during the same move.
👉 Fresh Setup Only
When enabled, a signal appears only when the complete setup changes from false to true.
It prevents the indicator from repeatedly signalling on every candle while the same condition remains active.
This should normally remain enabled.
👉 Wait for SL or Target Before Next Signal
When enabled, the indicator waits for the active stop or target to be touched before accepting another trade.
This creates a cleaner one-trade-at-a-time workflow.
It is the preferred setting for discretionary traders and alert-based execution.
👉 Allow Opposite Signal
This setting becomes relevant when “Wait for SL/Target” is disabled.
It determines whether an opposite signal can replace the current directional trade before the original levels are completed.
━━━━━━━━━━━━━━━━━━━━
✨ Visual Features
3D Gradient Trend Ribbon
Glow Buy and Sell Markers
Signals are generated after the chart candle is confirmed.
Entry Beam
3D Risk and Reward Zones
VWAP Glow Line
Gradient Candle Coloring
━━━━━━━━━━━━━━━━━━━━
📋 Dashboard Explained
The dashboard provides a summary of current chart conditions.
Market Condition
Bull Score and Bear Score
RSI
ATR Percentage
Volume Ratio
Bollinger Band Width
HTF Trend
VWAP
Active Trade
SL / TP
Win Rate
The dashboard win rate is an internal chart-touch statistic based on whether displayed targets or stops were reached.
For reliable validation, traders should independently review historical trades and conduct proper testing.
━━━━━━━━━━━━━━━━━━━━
🔔 Alert Features
Buy-sell with Multi-logic Trading System provides alert conditions for:
• Confirmed BUY signal
• Confirmed SELL signal
• Active stop-loss touched
• Active target touched
Dynamic BUY and SELL alerts can also include:
• Symbol
• Entry price
• Stop-loss
• Target price
Signals and dynamic alerts are generated once per confirmed candle close.
For TradingView alerts, select the indicator and choose the required alert condition.
━━━━━━━━━━━━━━━━━━━━
📌 Preferred Logic According to Market View
👉 Strong Bullish Market
Recommended:
• Trend Logic: ON
• Momentum Logic: ON
• Breakout Logic: Optional
• Mean Reversion: OFF
• HTF Filter: ON
• VWAP Filter: ON
• Minimum Confluence: 4 or 5
Focus mainly on long signals, pullbacks and bullish consolidation breakouts.
👉Strong Bearish Market
Recommended:
• Trend Logic: ON
• Momentum Logic: ON
• Breakout Logic: Optional
• Mean Reversion: OFF
• HTF Filter: ON
• VWAP Filter: ON
• Minimum Confluence: 4 or 5
Focus mainly on short signals, failed recoveries and bearish range breakdowns.
👉 Developing Trend
Recommended:
• Trend Logic: ON
• Momentum Logic: ON
• Breakout Logic: ON
• Mean Reversion: OFF
• Minimum Confluence: 4
• Breakout Buffer: 0.10–0.20 ATR
Momentum or breakout logic may identify the move before complete EMA alignment develops.
👉 Established Trend
Recommended:
• Trend Logic: ON
• Momentum Logic: Optional
• Breakout Logic: Optional
• Mean Reversion: OFF
• Minimum Confluence: 4–5
• Structure + ATR stop
Look for continuation after controlled pullbacks rather than chasing extended candles.
👉 Clean Sideways Range
Recommended:
• Trend Logic: OFF or used cautiously
• Momentum Logic: OFF
• Breakout Logic: ON
• Mean Reversion: ON only for confirmed range rejection
• RSI Turn Requirement: ON
• Reversion Wick Ratio: 0.35–0.50
Use either range fading or breakout trading according to price behaviour—but avoid treating both as equally valid at the same moment.
👉 Transition or Choppy Market
Recommended:
• Increase Minimum Confluence
• Increase cooldown bars
• Use HTF and VWAP filters
• Keep Mean Reversion OFF unless a clear range forms
• Wait for structure to become clearer
Sometimes the best setting in a Transition market is simply to avoid trading.
━━━━━━━━━━━━━━━━━━━━
🧩 Suggested Presets
🔶 Balanced Intraday — 5 or 15 Minutes
• EMA: 20 / 50 / 200
• HTF: 60 minutes
• HTF Filter: ON
• VWAP Filter: ON
• Trend Logic: ON
• Momentum Logic: ON
• Breakout Logic: ON
• Mean Reversion: OFF
• Minimum Confluence: 4
• Volume Multiplier: 1.5
• Breakout Buffer: 0.15 ATR
• Breakout Close Position: 0.60
• Stop: Structure + ATR
• Target: 1.5 Risk:Reward
• Cooldown: 5 bars
• Fresh Setup Only: ON
• Wait for Exit: ON
🔶 Precision Intraday
• HTF Filter: ON
• VWAP Filter: ON
• Minimum Confluence: 5
• Volume Multiplier: 1.7–2.0
• Breakout Buffer: 0.20–0.30 ATR
• Breakout Close Position: 0.70–0.80
• Fresh Setup Only: ON
• Wait for Exit: ON
This preset produces fewer signals but demands stronger confirmation.
🔶 Fast Momentum Trading
• Trend Logic: Optional
• Momentum Logic: ON
• Breakout Logic: ON
• Mean Reversion: OFF
• HTF Filter: ON
• VWAP Filter: ON
• Volume Multiplier: 1.3–1.5
• Cooldown: 2–4 bars
• Stop: ATR
• Target: ATR or Risk:Reward
Fast settings should only be used on liquid instruments because they are more sensitive to lower-timeframe noise.
🔶 Range-Breakout Trading
• Trend Logic: Optional
• Momentum Logic: Optional
• Breakout Logic: ON
• Mean Reversion: OFF
• Breakout Buffer: 0.15–0.30 ATR
• Close Position: 0.65–0.80
• Require Breakout Volume: ON
• Volume Multiplier: 1.5–2.0
• VWAP Filter: ON
Manually confirm that sufficient space exists beyond the range.
🔶 Sideways Mean Reversion
• Trend Logic: OFF
• Momentum Logic: OFF
• Breakout Logic: Optional
• Mean Reversion: ON
• Minimum Range Width: 1.0–1.5 ATR
• Rejection Wick Ratio: 0.35–0.50
• RSI Turn Requirement: ON
• Fresh Setup Only: ON
• Wait for Exit: ON
Do not use this preset when the range boundary is being attacked with expanding volume.
🔶 Swing Trading — 1 Hour or 4 Hours
• EMA: 20 / 50 / 200
• HTF: 4 Hour, Daily or Weekly
• HTF Filter: ON
• VWAP Filter: Optional
• Trend Logic: ON
• Momentum Logic: ON
• Breakout Logic: ON
• Mean Reversion: Usually OFF
• Minimum Confluence: 4–5
• Swing Lookback: 10–20
• Stop: Structure + ATR
• Target: Risk:Reward
• Risk:Reward: 1.5–2.5
• Cooldown: 3–5 bars
━━━━━━━━━━━━━━━━━━━━
⛔ When Not to Use the Indicator
Avoid taking signals mechanically when:
• The market-condition card shows an unstable Transition phase
• Price is moving inside a very narrow and noisy area
• A signal is directly facing major higher-timeframe structure
• Price is highly extended from the EMA ribbon or VWAP
• The signal candle is abnormally large
• A major economic event is creating unpredictable volatility
• The selected instrument is illiquid
• Volume data is unreliable
• Bid–ask spreads are unusually wide
• The chart timeframe is too low for the instrument
• There is insufficient reward before the next support or resistance
• The stop required by structure is larger than the trader’s permitted risk
A technically valid signal is not automatically a good trade.
Location, liquidity, market context and risk remain essential.
━━━━━━━━━━━━━━━━━━━━
✅ Recommended Trading Workflow
Step 1 : Identify the market condition
Determine whether the chart is trending, ranging or transitioning.
Step 2 : Check the higher timeframe
Confirm the broader directional structure before using Trend or Momentum signals.
Step 3 : Check VWAP location
For intraday trading, prefer longs above VWAP and shorts below VWAP.
Step 4 : Read the dashboard
Compare:
• Bull and Bear scores
• RSI
• ATR percentage
• Volume ratio
• Bollinger Band width
• Higher-timeframe trend
Step 5 : Identify which logic suits the market
Do not use mean reversion in a strong trend.
Do not depend only on trend logic in an unstructured range.
Step 6 : Check trade location
Identify nearby support, resistance, previous-day levels, liquidity zones and higher-timeframe structure.
Step 7 : Evaluate risk
Check whether the displayed stop is logically placed and whether sufficient reward is available.
Step 8 : Wait for candle confirmation
Avoid anticipating a signal before the candle closes.
━━━━━━━━━━━━━━━━━━━━
⚠️ Important Notes
Buy-sell with Multi-logic Trading System is a decision-support indicator, not an automatic guarantee of profitable trades.
The indicator does not know:
• Your account size
• Your maximum permitted risk
• Whether a market-moving announcement is approaching
• Whether a nearby level is personally significant to your analysis
• Whether an option contract has suitable liquidity, delta or implied volatility
• Whether the displayed trade fits your trading plan
When several logic engines are enabled together, a BUY or SELL signal can originate from Trend, Momentum, Breakout or Mean-Reversion conditions.
The current signal marker does not separately label which internal engine generated it. The market condition, dashboard and surrounding price action should therefore be used to interpret the setup.
Always test the indicator on the intended market and timeframe before using it in live trading.
━━━━━━━━━━━━━━━━━━━━
📈 Final Perspective
Buy-sell with Multi-logic Trading System is designed around one central idea:
**Trade according to the current market regime instead of forcing the same strategy into every market.**
Use Trend Logic when structure is aligned.
Use Momentum Logic when participation and acceleration are increasing.
Use Breakout Logic when price is escaping a well-defined range with confirmation.
Use Mean Reversion only when the market is genuinely balanced and rejecting its boundaries.
The indicator can organise information, filter conditions and define structured risk—but disciplined execution, position sizing and market awareness remain the trader’s responsibility.
------------------------------------------------
**Educational use only. This indicator does not provide financial advice or guarantee future results.**
Wskaźnik

Percentage Price Oscillator Navigator [MarkitTick]💡 A highly multi-dimensional momentum and trend-tracking suite. Rather than relying on singular data points, this comprehensive ecosystem fuses normalized momentum oscillators, dynamic volatility filters, and automated risk-management frameworks into a single, cohesive interface. Designed for meticulous market analysts, it provides a strictly confirmed, non-repainting environment to identify structural shifts, validate trend strength, and project actionable risk-to-reward parameters.
● ✨ Originality and Utility
Standard momentum oscillators often suffer from noise in ranging environments and fail to contextualize signals with prevailing market conditions. This tool distinguishes itself by integrating a robust "Smart Filter" engine directly into the core momentum calculation. By dynamically cross-referencing directional movement strength, average true range expansions, and volume surges, it ensures that momentum shifts are only validated when supported by underlying market participation. Furthermore, the inclusion of a fully automated, dynamic risk-to-reward leveling system transforms a traditional oscillator into a complete trade management overlay, complete with a real-time heads-up display dashboard and fully formatted JSON alert payloads for external automation.
● 🔬 Methodology and Concepts
The foundational logic relies on the proportional divergence between a faster and slower moving average, calculating the percentage difference to create a normalized oscillator. This normalization is critical as it allows for consistent momentum evaluation across diverse asset classes regardless of their nominal price value.
To prevent the common pitfall of reverse-engineering and to protect the underlying intellectual architecture, the internal mathematical sequences remain fully abstracted. The methodology employs a cascading verification process:
First, the core normalized divergence is measured against its own smoothed signal line to identify baseline directional shifts.
Second, a Multi-Timeframe (MTF) confirmation engine evaluates the macro trend. This utilizes a strict, offset historical data request architecture, ensuring zero future-data leakage or repainting artifacts.
Third, the Smart Filter engine evaluates atmospheric market conditions. It demands that background volatility, average directional strength, and volume participation meet minimum threshold requirements before validating any structural momentum shift.
Finally, the system utilizes strict bar-close confirmation logic. Signals are exclusively generated when the evaluation bar has permanently closed, ensuring unalterable historical accuracy.
● 🎨 Visual Guide
The visual interface is engineered to maximize data delivery while maintaining chart clarity.
• Oscillator Elements
PPO Line (Solid Blue): Represents the primary normalized momentum metric.
Signal Line (Solid Orange): A smoothed derivative of the primary momentum, acting as the baseline for crossover events.
Histogram Columns: Visualizes the spread between the PPO and Signal lines. Rising positive momentum is colored in solid teal, while weakening positive momentum fades to a transparent teal. Conversely, expanding negative momentum is solid red, fading to transparent red as bearish momentum wanes.
Zero Line (Gray): The equilibrium point delineating macro bullish versus bearish environments.
• Chart Overlay Elements
Heatmap Candles: The main chart candles are dynamically colored (Teal for positive momentum, Red for negative momentum) based directly on the histogram's state, instantly aligning price action with underlying momentum.
Signal Markers: Small, precise triangles appear at the exact bar of a confirmed momentum crossover (Teal triangle pointing up for bullish, Red pointing down for bearish).
Risk Management Levels: Upon a confirmed signal, the tool draws horizontal projections. The Stop Loss is a thick solid red line. The Entry is a dashed blue line. Take Profit targets (TP1, TP2, TP3) are plotted as dashed teal lines of varying opacity. Colored background fills visually represent the geometric risk and reward zones.
• Heads-Up Dashboard
A fixed tabular dashboard provides a real-time diagnostic readout of all internal states, including current momentum values, moving average gap percentages (visualized as a progress bar), higher-timeframe alignment, and the active positional status with exact level coordinates.
● 📖 How to Use
This tool is designed to act as a primary navigational compass for market structure. Traders should observe the histogram for early signs of momentum deceleration (indicated by fading column colors). A validated setup occurs when the primary momentum line crosses the signal line, strictly accompanied by a visual marker on the chart.
Because the system employs strict bar-close confirmation, traders must wait for the bar to finalize before interpreting a signal as valid. Once a signal fires, the risk management levels automatically project onto the chart. The user can utilize the "Lock Signal" feature to freeze these specific entry and exit levels on the chart, preventing the system from calculating subsequent, potentially conflicting signals while a trade is actively being managed. The comprehensive JSON alerts can be mapped directly to external execution platforms, utilizing the dynamically generated Entry, Stop Loss, and Take Profit price coordinates embedded within the payload.
● ⚙️ Inputs and Settings
The configuration panel is highly modular, categorized logically for precise tuning:
• Core
Defines the lookback periods for the fast, slow, and signal moving averages, as well as the calculation type (SMA or EMA) and the source price data.
• Filters
The gatekeeper settings. Users can toggle and tune the Higher Timeframe confirmation, ADX strength threshold, ATR volatility multiplier, and Volume moving average requirements. A histogram slope confirmation can also be activated to ensure structural momentum is moving in the correct direction.
• Trade Tools
Controls the geometric risk overlay. Users define the Stop Loss distance via an ATR multiplier and set precise Risk:Reward ratios for all three Take Profit targets. The "Lock Signal" toggle is located here, allowing users to freeze the active projection.
• Visuals & Dashboard
Comprehensive toggles to enable or disable specific UI elements such as the histogram, heatmap candles, chart signals, and the diagnostic dashboard, allowing for a fully customized workspace.
• Alerts
Input fields to define custom JSON action tags for integration with third-party webhooks, ensuring seamless connectivity with external systems.
● 🔍 Deconstruction of the Underlying Scientific and Academic Framework
The theoretical foundation of this evaluation suite rests on the synthesis of structural momentum analysis and statistical variance gating. In traditional financial modeling, momentum is frequently quantified as the first derivative of price relative to time. However, absolute price changes suffer from scalar distortion; a ten-point move in a high-valuation asset is mathematically insignificant compared to a ten-point move in a low-valuation asset. By utilizing a normalized percentage differential between dual moving averages, the tool mathematically standardizes momentum, allowing for robust, scale-invariant analysis.
Furthermore, the integration of the Smart Filter engine elevates the framework from simple linear smoothing to a multidimensional evaluation model. The inclusion of the Average Directional Index (ADX) introduces a non-directional vector strength requirement, ensuring that momentum shifts are occurring within an established trend environment rather than a stochastic mean-reversion chop. The Volatility filter, utilizing the Average True Range (ATR), acts as a statistical variance gate. It postulates that significant structural shifts require an expansion in price distribution variance; if a momentum crossover occurs during a period of localized volatility contraction, it is statistically more likely to be a false positive generated by noise rather than a genuine shift in market consensus.
Finally, the dynamic risk leveling system applies principles of geometric expectancy. By anchoring the invalidation point (Stop Loss) to the ATR, the system ensures that risk parameters are continuously adjusted to the current statistical distribution of price movement, rather than relying on arbitrary, static percentages. This creates a mathematically sound, expectancy-positive projection model that adapts fluidly to expanding and contracting market environments, enforcing a rigorous, quantitative approach to trade management.
⚠️ Disclaimer
All provided scripts and indicators are strictly for educational exploration and must not be interpreted as financial advice or a recommendation to execute trades. We expressly disclaim all liability for any financial losses or damages that may result, directly or indirectly, from the reliance on or application of these tools. Market participation carries inherent risk where past performance never guarantees future returns, leaving all investment decisions and due diligence solely at your own discretion. Wskaźnik

Order Block Engine [JOAT]═══ ORDER BLOCK ENGINE ═══
Most order-block tools paint a fresh box on every candle and bury the chart. This one does the opposite. It only marks the last opposing-close candle that appears just before a genuine displacement leg — a move that closes through a confirmed swing by more than a volatility-scaled threshold, backed by a volume expansion. The result: only a handful of clean, unmitigated, high-grade zones survive on screen at once.
▎ WHAT IT DOES
It maps institutional-style order blocks, grades each one from 0 to 10 by ★ quality, extends the surviving zones to the right until price mitigates them, and fires a single clean BUY / SELL pill on a valid retest + reaction — complete with an R-multiple TP/SL zone construct. A grey/white and blue-chrome dashboard keeps the running read of structure, bias and zone quality in one corner.
▎ HOW IT WORKS
— Confirmed swing structure. Pivot highs and lows are tracked with a configurable lookback. Each swing stays "unbroken" until price genuinely closes through it.
— Displacement break. A bullish break needs an up-close candle that closes above the last swing high by more than Displacement × ATR ; a bearish break mirrors it below the swing low. ATR scaling means the threshold self-adjusts to any asset or timeframe.
— Volume confirmation. The breaking candle's volume must exceed its own moving-average baseline by the chosen multiplier. On symbols with no volume feed, this filter auto-skips.
— Order-block selection. Once a break is confirmed, the engine walks back through recent bars to find the last opposing-close candle — the down-close before a bullish break, or the up-close before a bearish break. That candle's high/low becomes the zone.
— ★ Grade (0-10). Each block is scored on three factors: how far the break displaced (in ATR), how strong the volume expansion was, and the body-to-range ratio of the origin candle. The composite maps to a 0-10 grade and a tier (WEAK → FAIR → SOLID → STRONG → ELITE).
— Mitigation & signals. Live zones extend right on each bar. If price closes fully through a zone, it is mitigated — frozen and greyed (or deleted). If instead price wicks back into the zone and the bar reacts back out with a close in the right direction, and the block's grade clears your minimum, a BUY / SELL signal fires. One signal per bar, longs take priority.
— Trade construct. On a signal the engine builds an entry line at close, a stop a buffer beyond the zone edge (× ATR), and TP1 / TP2 at your chosen R multiples — drawn as green TARGET and red RISK zone boxes that extend, then freeze when SL or TP2 is touched.
▎ HOW TO USE IT
— Treat the surviving zones as decision areas , not guarantees. A blue zone is a bullish order block; a slate zone is bearish. The ★ tag shows its grade at a glance.
— Wait for price to return into a zone. The engine only signals on a retest + reaction , so you are not chasing the initial impulse.
— Use the BUY / SELL pill's grade (e.g. ★★★★ 7.8/10) as a confidence read — higher grades reflect stronger displacement, volume and candle body.
— The TARGET ZONE and RISK ZONE boxes frame reward against risk before you commit. Entry, SL, TP1 and TP2 are all labelled with their R multiples.
— Grey zones are spent — they have already been mitigated and are kept only as context for prior structure.
— Combine with your own higher-timeframe bias; order blocks aligned with trend tend to be the cleaner reactions.
▎ KEY SETTINGS
— Engine: ATR length, structure pivot width, displacement break multiple, OB candle search depth, and bull/bear toggles.
— Filters: volume expansion on/off with baseline length and multiplier, minimum grade required to signal, and confirm-on-close to avoid intrabar repaint.
— Zones: show zones, max zones kept (4-6 recommended), extension length, fill transparency, ★ grade labels, keep-mitigated-grey toggle, and bull/bear colours.
— Signals & Risk: show BUY/SELL pills, draw TP/SL zone, stop buffer (× ATR), TP1 and TP2 R multiples, projection length, and max trade sets kept.
— Extras: optional zone-reader candle tinting and an optional VWAP + σ band.
▎ DASHBOARD
A compact panel (five positions, three text sizes) reports: current Bias , count of live Bullish and Bearish OBs, the Nearest zone level and its distance in %, the Strongest zone's grade and tier, the Last Mitigated zone, the Active Signal state, and running Signal and Trade W/L tallies. The W/L count is an illustrative record of how the historical construct resolved — not a performance promise.
▎ ALERTS
— OB Bullish Signal — fires on a bullish order-block retest + reaction.
— OB Bearish Signal — fires on a bearish order-block retest + reaction.
Both include ticker and interval in the message.
▎ NOTES
— Works on all timeframes and all assets ; ATR and volume baselines adapt automatically.
— Confirm On Bar Close evaluates detection, mitigation and signals on closed bars only, so confirmed signals do not repaint.
— Everything is toggleable — zones, grades, pills, trade boxes, candles, VWAP and dashboard — for a chart as clean or as detailed as you like.
— The volume filter self-disables on feeds without volume, so nothing breaks on those symbols.
For research and education only. This is not financial advice. No indicator can predict the future, and past behaviour never guarantees future results. Always do your own analysis and manage your own risk.
Made with passion by JackOfAllTrades ⚡ Wskaźnik

Market Structure Shift [JOAT]═══ MARKET STRUCTURE SHIFT ═══
A complete Smart Money Concepts structure engine that reads the market the way institutional flow moves it — mapping every swing and internal shift, tagging each break as BOS (continuation) or CHoCH (reversal), then layering liquidity, premium/discount context, and a structure-anchored risk plan on top. It turns raw price action into a clean, labelled map of who is in control and where the shift happens.
▎ WHAT IT DOES
MSS tracks confirmed pivots and runs them through a two-layer structure state machine. When price closes (or wicks) beyond a protective swing, it draws the break line, labels it BOS or CHoCH, and updates the live trend state. Around that skeleton it adds equal-high/low liquidity marks, a premium/discount/equilibrium range map, an optional structure-anchored SL and Reward:Risk target zone, session VWAP with deviation bands, and a live dashboard summarising the whole picture.
▎ HOW IT WORKS
• Confirmed pivots — swing highs/lows are detected with a symmetric pivot length (bars each side), so a pivot only prints once fully confirmed. A separate, shorter internal pivot length tracks a faster inner structure layer.
• BOS vs CHoCH logic — each layer holds a trend state (bull / bear / range). A bullish break of the last swing high while the state is already bullish is a BOS (continuation); a bullish break while the state was bearish is a CHoCH (change of character / first reversal). The mirror logic applies to bearish breaks.
• Break confirmation — you choose whether a candle must close beyond the level (cleaner) or whether any wick penetration counts.
• Sequence read — every new pivot is classified HH / LH / HL / LL (or EQ) so you can see the higher-high / lower-low rhythm at a glance.
• Liquidity (EQH/EQL) — two consecutive pivots landing within an ATR-scaled tolerance are marked as Equal Highs or Equal Lows — resting liquidity pools where stops cluster.
• Premium / Discount — the active swing range is split into a Premium (upper) zone, a neutral Equilibrium band around the midpoint, and a Discount (lower) zone, so you always know which half of the range price is trading in.
• Structure-anchored risk — on a fresh signal the stop is placed just beyond the swing that would invalidate the shift (plus an ATR buffer), or by a fixed ATR distance. Risk is floored and capped by ATR, and the target is projected at your Reward:Risk multiple.
• VWAP magnet — session-anchored VWAP with inner and outer standard-deviation bands acts as the fair-value reference the structure tends to rotate around.
• ATR normalisation — label spacing, liquidity tolerance and stop distances all scale with ATR, so the tool behaves consistently across assets and timeframes.
▎ HOW TO USE IT
• Read the trend state first: a CHoCH warns the prevailing structure has broken; a following BOS confirms the new leg. Trade with the higher-conviction swing layer and use internal breaks for earlier, finer entries.
• BUY / SELL labels fire on the events you enable (CHoCH, BOS, or both) from your chosen layer — treat them as a structure trigger, not a blind entry.
• Favour longs from the Discount zone and shorts from the Premium zone; the Equilibrium band is neutral / no-man's-land.
• EQH/EQL marks show where liquidity rests — price often sweeps these before a genuine shift, so use them as targets and as traps to avoid.
• When a signal prints, the RISK ZONE (entry→stop, red) and TARGET ZONE (entry→TP, green) boxes project the plan; the SL and TP lines carry exact price and R labels. The zones extend live, then freeze once TP, SL, or the time-out is reached.
• Use VWAP and its bands as confluence — a shift back through VWAP into the opposite σ band is a common rotation target.
▎ KEY SETTINGS
• Structure Engine — swing pivot length, optional internal layer + its length, close/wick break confirmation, ATR length.
• Signals — signal source (Swing / Internal / both) and whether labels fire on CHoCH, BOS, or both.
• Liquidity & Zones — toggle EQH/EQL, equal-level tolerance, premium/discount zones, equilibrium band width, and the floating price-zone tag.
• Risk Model — stop basis (Structure+Buffer or ATR Multiple), buffer/ATR distance, Reward:Risk multiple, min/max risk floors and caps, projection length, max drawn setups.
• VWAP — show VWAP, inner/outer σ multiples, deviation lookback.
• Visuals — swing/internal break display, pivot markers, zone candle colouring, draw limits, and the blue/violet colour scheme.
▎ DASHBOARD
A compact blue/violet panel reports live: overall Trend , the Last Event (Bull/Bear BOS or CHoCH), the current Swing Sequence (e.g. HH · HL), the Internal structure state, the active Price Zone , running BOS and CHoCH counts, Liquidity (EQH/EQL) count, the current Signal , and the symbol/timeframe. Position and text size are adjustable.
▎ ALERTS
Six alertconditions are provided: Bullish BOS, Bearish BOS, Bullish CHoCH, Bearish CHoCH, BUY Signal, and SELL Signal — each with a ready message carrying ticker and interval.
▎ NOTES
• Works on all timeframes and all assets — everything scales with ATR.
• Pivots are confirmed (they need bars to close each side), so structure marks are non-repainting once printed; the price-zone label and dashboard update live on the last bar as expected.
• Every visual layer has a toggle — turn off what you don't need for a clean chart.
• Signals never fire both directions on the same bar; a conflicting wide-range bar is dropped.
For research and education only. This is not financial advice. No indicator can predict the future, and past behaviour does not guarantee future results. Any labels, zones, or counts describe historical price action only. Always do your own analysis and manage your own risk.
Made with passion by JackOfAllTrades ⚡ Wskaźnik

Volume Map Volume Map is a volume profile that shows the price levels where trading activity was concentrated within the selected market range.
The indicator distributes historical candle volume across horizontal price rows and identifies three key reference levels:
🔴 Resistance — the upper boundary of the calculated balance area.
🟡 Balance — the price row with the highest calculated volume.
🟢 Support — the lower boundary of the calculated balance area.
The profile, levels, and information dashboard are all generated from one unified volume-distribution model. They are not separate indicators mechanically combined to create additional signals.
The horizontal profile displays the full volume distribution, the levels identify its key boundaries, and the dashboard translates the same calculations into a clear and accessible market context.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚙️ ORIGINAL CALCULATION METHOD
The main feature of this implementation is the way each candle’s volume is distributed across price rows.
A single candle may cross several price levels. Instead of adding the entire candle volume to every crossed row, Volume Map measures the actual overlap between the candle’s range and each price row.
The volume allocated to a specific row is proportional to:
the row’s overlap with the candle / the candle’s full range
For example, if a price row covers 20% of the candle’s full high-to-low range, that row receives approximately 20% of the candle’s volume.
This approach:
• preserves the candle’s total volume within the profile;
• avoids repeatedly counting the full candle volume at multiple price levels;
• provides a more precise approximation of how available OHLCV volume is distributed within the candle’s range.
When a candle has no measurable difference between its high and low, its volume is assigned to the row containing the closing price.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🟡 HOW BALANCE IS DETERMINED
Balance represents the price row with the highest calculated concentration of volume.
When several rows have the same maximum volume, the indicator calculates the volume-weighted centroid of the entire profile and selects the maximum-volume row located closest to that centroid.
This rule connects Balance to the broader volume distribution and avoids automatically selecting the first maximum found in the profile.
Balance can be viewed as a statistical reference for the area of value within the selected range.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔵 HOW THE BALANCE AREA IS FORMED
The Balance Zone Size setting determines what percentage of the profile’s total volume must be contained between Support and Resistance.
The default value is 68%.
The script searches for the narrowest continuous group of price rows that:
• contains the Balance row;
• includes at least the selected percentage of total volume;
• remains continuous between its lower and upper boundaries.
When two possible ranges have the same width, the script selects the one whose center is located closest to Balance.
The balance area does not have to be symmetrical. When more volume is concentrated above or below the Balance row, one side of the area may extend noticeably farther than the other.
This reflects the actual calculated volume distribution instead of artificially centering the boundaries around Balance.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎨 PROFILE COLOR LOGIC
The horizontal profile uses three visual states:
🔵 Blue rows — volume included in the calculated balance area.
⚫ Gray rows — volume located outside the balance area.
🟡 Yellow row — the Balance level.
The width of each row represents its calculated volume relative to the highest-volume row in the profile.
The wider the row, the greater the volume concentration at that price level within the analyzed range.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📍 KEY REFERENCE LEVELS
🟡 BALANCE
Balance is the row with the highest calculated volume in the profile.
It can be used as a statistical reference for the area of value and as a central point for evaluating the current price location.
🔴 RESISTANCE
Resistance is the upper boundary of the balance area.
This level does not mean that price must reverse. It identifies the price where the selected concentration of volume ends on the upper side of the profile.
🟢 SUPPORT
Support is the lower boundary of the balance area.
It is a statistical boundary of the calculated area of value, not a guaranteed support level.
The names Support and Resistance are used to make the profile easier to understand. Both levels are calculated from volume distribution rather than from:
• local highs and lows;
• moving averages;
• traditional pivot levels;
• trend lines.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔗 WHY THESE COMPONENTS ARE COMBINED IN ONE INDICATOR
Volume Map contains three connected components:
1. Horizontal profile
Displays the full calculated volume distribution across price levels.
2. Support, Balance, and Resistance levels
Identify the highest concentration of volume and the boundaries of the balance area.
3. Beginner Dashboard
Explains the current price location relative to the same calculated levels.
The dashboard does not calculate a separate trend, momentum, or trading signal.
Every value displayed in the dashboard is derived directly from:
• the current price;
• Balance;
• Support;
• Resistance.
The purpose of combining these components is to make one volume-distribution calculation useful both for experienced volume-profile users and for traders who prefer a simpler and clearer summary.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🧭 BEGINNER DASHBOARD
Market
Shows whether the current price is above or below Balance.
🟢 Above — price is above Balance.
🔴 Below — price is below Balance.
This describes the location of price. It is not a prediction of future upward or downward movement.
Price
Shows the current price location relative to the entire balance area.
• Above map — price is above Resistance.
• Upper — price is between Balance and Resistance.
• Balance — price is at the Balance level.
• Lower — price is between Support and Balance.
• Below map — price is below Support.
Zone
Shows the nearest significant profile level while price remains inside the balance area:
🔴 Resistance
🟡 Balance
🟢 Support
When price is above Resistance or below Support, the dashboard displays Outside.
Tip
Provides a brief description of the current price location:
• Above resistance — price is above Resistance;
• Above balance — price is above Balance;
• At balance — price is at Balance;
• Below balance — price is below Balance;
• Below support — price is below Support.
The Tip row is descriptive only and does not represent a buy or sell signal.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛠️ SETTINGS
Use Visible Range
When enabled, the script builds the profile from the chart range currently visible to the user.
Changing the chart scale or moving the visible range may change the calculated profile and levels.
When disabled, the script uses the fixed number of candles selected in Lookback Bars.
Lookback Bars
Defines the number of recent candles used in the calculation when Use Visible Range is disabled.
• A larger value includes more historical data.
• A smaller value makes the profile more responsive to recent price action.
Profile Detail
Controls the number of horizontal price rows.
• Higher values provide finer price resolution but require more calculations.
• Lower values produce a simpler and smoother profile.
Profile Bar Thickness
Controls the visual thickness of the horizontal rows.
This setting does not affect the calculations.
Profile Width
Controls the maximum horizontal width of the profile relative to the number of analyzed candles.
This setting affects presentation only.
Right Offset
Controls the distance between the latest candle and the profile.
Balance Zone Size
Defines the percentage of total profile volume that must be included between Support and Resistance.
• A higher value usually creates a wider balance area.
• A lower value creates a narrower balance area.
Volume Type
• Both — includes all qualifying candles.
• Bullish — includes candles whose closing price is greater than or equal to their opening price.
• Bearish — includes candles whose closing price is below their opening price.
Bullish and Bearish modes classify the entire volume of a candle according to the candle’s direction.
They do not represent actual buy and sell volume, bid/ask volume, order-flow delta, or the precise distribution of aggressive market orders.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📈 HOW TO USE THE INDICATOR
Start with the default settings and observe how price behaves around Balance, Support, and Resistance.
Price inside the balance area
When price is between Support and Resistance, the profile indicates that a significant share of the analyzed volume was concentrated within this range.
Balance can be used as a reference for analyzing:
• price rotation within the area of value;
• mean-reversion behavior;
• price reactions around the area of maximum volume concentration.
Price above Resistance or below Support
When price moves outside the balance area, traders can observe:
• whether price is being accepted outside the area;
• whether price remains outside the area of value;
• whether price returns toward Balance.
The profile may also help identify:
• high-volume areas that price may revisit repeatedly;
• low-volume transitions where less trading activity was previously concentrated;
• changes in the area of value when the profile is calculated over a different range;
• differences between short-term and long-term volume distributions.
Volume Map does not determine trend direction and does not generate predefined:
• entry points;
• exit points;
• stop-loss levels;
• profit targets.
The indicator can be used together with the trader’s own market-structure, trend-direction, and risk-management process.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔄 REAL-TIME BEHAVIOR
The profile is calculated in real time using the selected market range.
Its values may change when:
• the current candle’s high, low, or volume changes;
• a new candle enters the fixed calculation range;
• an older candle leaves the calculation range;
• the visible chart range changes;
• the timeframe, symbol, or settings are changed.
This recalculation is normal behavior for a volume profile based on a changing market range.
The script does not request future data and does not use lookahead calculations.
However, levels calculated using the active candle may continue to change until that candle closes.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠️ LIMITATIONS
Volume Map uses the volume data supplied by TradingView’s chart data source.
Results may be less informative for instruments with:
• unavailable volume data;
• synthetic volume;
• incomplete volume data;
• decentralized volume.
The script estimates the distribution of volume within each candle using the candle’s high-to-low range.
Standard chart data does not contain the exact sequence of every transaction at each price level inside a historical candle.
The profile is therefore an approximation based on the available OHLCV data.
It is not an exchange-level profile calculated from every individual trade or tick.
Support, Balance, and Resistance describe the selected historical range. They do not guarantee a future price reaction and should not be treated as standalone trading instructions.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎓 IMPORTANT
Volume Map is designed for analytical and educational purposes.
The indicator does not constitute financial advice, does not promise a particular outcome, and does not replace independent analysis or risk management. Wskaźnik

Wskaźnik

Regime Blocks Regime Blocks is a market-structure visualization tool that converts confirmed structural breaks into sequential bullish and bearish price-range blocks.
The indicator helps answer three practical questions directly on the chart:
1. Which structural regime is currently active?
2. How long has the current regime remained active?
3. What price range has developed within the regime?
The main purpose of Regime Blocks is to present price movement as a clear visual map of bullish and bearish structural regimes.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🧠 ORIGINALITY AND DESIGN LOGIC
The indicator is based on two analytical concepts:
confirmed swing highs and swing lows;
Average True Range, or ATR, used as a volatility-adjusted structural-break filter.
These components are not an arbitrary combination of unrelated indicators. They work together as parts of one unified market-structure model.
Confirmed swing points define the structural levels that price must exceed. The ATR filter defines the additional minimum distance price must move beyond a swing level before the break is accepted by the system.
Using ATR instead of a fixed number of points allows the confirmation threshold to adapt automatically to instruments with different price scales and volatility levels.
After a break is confirmed, the script applies a persistent market-state model:
an upward break can establish a bullish regime;
a downward break can establish a bearish regime;
a break in the opposite direction changes the current regime;
a break in the same direction can divide an extended regime into a new visual wave without changing its bullish or bearish classification.
The distinction between a regime change and a continuation structural wave is one of the indicator’s key features.
Without segmentation, an extended move can appear as one oversized block that becomes difficult to analyze. Regime Blocks divides such movements into more compact structural sections while preserving the overall regime direction.
This makes it possible to see simultaneously:
the broader structural condition of the market;
the internal development of the current move;
the sequence of structural waves.
The indicator maintains only one Bullish or Bearish label for each regime. When a new wave begins in the same direction, the label is transferred to the current block instead of being repeated on every section.
This approach reduces unnecessary text and keeps the chart visually clean.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚙️ HOW THE CALCULATIONS WORK
1. Swing-point confirmation
The indicator identifies local swing highs and swing lows using a symmetrical pivot window.
The Swing Length setting defines how many candles must appear on both sides of a potential extreme before the swing can be confirmed.
For example, a value of Swing Length = 8 means that eight candles to the left and eight candles to the right are required to confirm a swing point.
A higher value:
creates fewer structural levels;
highlights broader market movements;
reduces sensitivity to short-term fluctuations;
confirms structural changes later.
A lower value:
reacts more quickly to price movement;
identifies smaller structures;
creates more structural breaks;
may increase the number of regime changes.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2. Structural-break confirmation
After a swing point is confirmed, the indicator monitors whether price moves beyond the corresponding structural level.
A bullish structural break occurs when the selected confirmation source moves above the latest confirmed swing high, including the additional ATR-based filter.
A bearish structural break occurs when the selected confirmation source moves below the latest confirmed swing low, including the ATR-based filter.
The user can choose between two confirmation methods:
candle-close confirmation;
candle-extreme confirmation using the wick.
When candle-close confirmation is enabled, the structural event is confirmed only after the candle closes beyond the calculated level.
When candle-close confirmation is disabled, the event can be triggered by the candle’s high or low before the current candle closes.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
3. ATR break filter
The Break Filter setting is expressed as a fraction or multiple of ATR.
For example, a value of 0.20 means that price must move beyond the swing level by an additional distance equal to at least 0.20 ATR.
Increasing the value:
filters weaker and marginal breaks;
reduces the number of regime changes;
makes the indicator more conservative.
Decreasing the value:
increases the speed of the indicator’s response;
makes the model more sensitive;
may increase the number of temporary or minor breaks.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
4. Market-regime changes
The first confirmed structural break establishes the initial market state.
After that:
a bearish break during a bullish regime starts a Bearish regime;
a bullish break during a bearish regime starts a Bullish regime.
Each confirmed swing level can generate only one break event.
This prevents the same structural level from repeatedly generating events on subsequent candles.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
5. Dividing a regime into structural waves
A confirmed break in the current direction does not change the regime.
For example, a new upward break within an already active bullish regime does not establish a different market state. The regime remains bullish.
When Split Long Regimes Into Waves is enabled, such a break can start a new visual block within the same regime.
A new wave is created only when all three conditions are met:
a new structural break in the current direction is confirmed;
the current block has reached the required minimum duration;
the current block has reached the required minimum price range measured in ATR.
These filters prevent small or closely spaced breaks from creating an excessive number of blocks.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
6. Block construction
Each block begins on the candle where the corresponding structural event is confirmed.
While a block remains active:
its upper boundary follows the highest price reached within the block;
its lower boundary follows the lowest price reached within the block.
When the next structural wave begins or the regime changes, the completed block is fixed and a new block starts separately.
The blocks therefore display the actual price range formed within each structural section.
The blocks are not projected future support or resistance zones.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
👁️ HOW TO READ THE INDICATOR
🟢 Bullish regime
Bullish blocks are displayed in green.
The lower boundary is emphasized as the primary reference boundary of the bullish regime.
The upper boundary is displayed as the secondary range boundary.
The Bullish label appears below the lower boundary of the block.
🔴 Bearish regime
Bearish blocks are displayed in red.
The upper boundary is emphasized as the primary resistance boundary of the bearish regime.
The lower boundary is displayed as the secondary range boundary.
The Bearish label appears above the upper boundary of the block.
A longer block shows that the structural condition remained active for a greater number of candles.
Frequent alternation between Bullish and Bearish may indicate a less stable, sideways, or rotational market structure.
Extended sections in one direction indicate a more persistent structural move.
Block boundaries should be interpreted as the actual extremes of a completed or developing structural wave, not as guaranteed reversal points.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛠️ INDICATOR SETTINGS
Swing Length
Controls the sensitivity of confirmed swing-high and swing-low detection.
Lower values:
react more quickly to price movement;
identify smaller structures;
generally create more regime changes.
Higher values:
identify broader structures;
reduce the influence of short-term market noise;
confirm structural changes later.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Confirm Break By Candle Close
When this setting is enabled, a structural break is confirmed only after the candle closes.
This is the more conservative option and prevents intrabar events that may disappear before the candle closes.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Break Filter, ATR
Defines the additional distance beyond a confirmed swing level required to validate a structural break.
Increase the value to filter weaker breaks.
Decrease the value when a faster response to structural changes is preferred.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Split Long Regimes Into Waves
Determines whether extended bullish and bearish regimes are divided into separate visual blocks after confirmed breaks in the current direction.
When this setting is disabled, one block continues until the regime changes direction.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Minimum Wave Length
Defines the minimum number of candles that must form within the current block before another break in the same direction can begin a new visual wave.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Minimum Wave Range, ATR
Defines the minimum height of the current block relative to ATR before the block can be segmented.
A value of 0 disables this requirement.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎨 Visual settings
Users can customize:
bullish and bearish block colors;
fill transparency;
boundary visibility;
boundary-line width;
secondary-boundary transparency;
label visibility and spacing;
the number of historical blocks displayed on the chart.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔔 ALERTS
The indicator provides four alert conditions.
Bullish Regime Started
Triggers when a confirmed bullish structural break changes the market state from bearish or undefined to bullish.
Bearish Regime Started
Triggers when a confirmed bearish structural break changes the market state from bullish or undefined to bearish.
Bullish Structural Wave
Triggers when a confirmed upward break starts a new visual block within an already active bullish regime.
The regime itself does not change.
Bearish Structural Wave
Triggers when a confirmed downward break starts a new visual block within an already active bearish regime.
The regime itself does not change.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⏱️ CONFIRMATION AND REAL-TIME BEHAVIOR
A pivot point requires candles to form to the right of the potential extreme before it can be confirmed.
A swing high or swing low is therefore confirmed with a delay equal to the selected Swing Length.
The indicator does not move a structural-break event retrospectively to the candle where the potential pivot originally appeared.
It first waits for the swing point to be confirmed and then monitors whether the structural-break condition is satisfied.
When candle-close confirmation is enabled, regime changes and new-wave events are evaluated only on closed candles.
When candle-close confirmation is disabled, an intrabar event may appear while the candle is forming and disappear before the candle closes if price moves back inside the structural level.
The active block changes in real time as price develops:
the upper boundary expands when a new high is formed;
the lower boundary expands when a new low is formed.
After the next block begins, completed historical blocks no longer change.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠️ LIMITATIONS
Regime Blocks is a market-structure visualization indicator, not a complete trading system.
It does not analyze:
volume;
momentum divergence;
order flow;
fundamental data;
trading sessions;
position sizing;
stop-loss placement;
expected trade return;
commissions or other trading costs.
The indicator does not predict whether a block boundary will hold and does not provide guaranteed entry or exit signals.
The output depends on:
the selected Swing Length;
the ATR filter value;
the chart timeframe;
the instrument’s volatility;
the candle type being used.
Synthetic chart types may produce different results because their open, high, low, and close values differ from standard market candles.
Regime Blocks is intended to be used as a market-context tool alongside the trader’s own entry rules, risk management, and independent analysis. Wskaźnik

Recursive Kernel Trend [QuantAlgo]🟢 Overview
The Recursive Kernel Trend is a trend-following indicator built on a recursive residual estimator with adaptive rate scheduling. It applies one of six selectable filter structures to a residual-corrected recursion, modulates the update rate according to efficiency and volatility conditions, and confirms directional state through slope persistence. The result is a responsive yet controlled trend line that adapts its tracking behavior to market regime while filtering noise-driven fluctuations across every timeframe and instrument.
🟢 How It Works
The calculation begins with a residual between the selected price source and the current estimate. This residual drives a base recursive update whose rate is not fixed but scheduled on every bar:
resid = src - estimate
base = estimate + kern_rate * resid
The scheduled rate is produced by combining two adaptive weights. Efficiency weighting measures the ratio of net directional progress to total price path over a lookback window, raising the rate when movement is clean and lowering it during chop. Volatility weighting compares current ATR against a longer baseline and reduces the rate when volatility expands. The combined rate is then bounded by floor and ceiling limits and further scaled by an optional directional bias that applies different multipliers depending on whether price sits above or below the estimate:
eff_weight = eff_floor + (1.0 - eff_floor) * eff_ratio
vol_weight = math.min(math.max(1.0 / vol_ratio, 0.50), 1.75)
rate_sched = math.min(math.max(base_rate * eff_weight * vol_weight, rate_floor), rate_ceil)
kern_rate = rate_sched * bias
Six filter structures can be applied to the base update. Standard uses a single pass. Wilder halves the rate for smoother behavior. Double and Triple apply successive lag-compensated stages. Gaussian cascades four poles without compensation. Hull combines fast and slow passes then re-smooths the result. All structures receive the live scheduled rate so the adaptive weighting remains active.
A residual accumulator runs in parallel with the recursion. It retains a decaying memory of past residuals and applies a correction term that closes persistent offset during sustained trends. An optional ATR-based limiter can bound the accumulator to prevent overshoot after gaps or parabolic moves:
corr_acc := corr_acc * corr_decay + resid
estimate := kern_out + corr_weight * corr_acc
Directional state is derived from the slope of the finished estimate after a short smoothing window. A consecutive run of bars in the same slope direction must reach a confirmation threshold before the state is allowed to flip. This step prevents single-bar noise from reversing the trend color or firing alerts.
🟢 Signal Interpretation
▶ Bullish Trend (Long/Buy): When the smoothed slope of the estimate remains positive for the required number of confirmation bars, the indicator enters bullish state. The trend line and gradient layers switch to the bullish color. This condition identifies potential long or buy opportunities and remains active until an equal run of negative slope bars confirms a reversal.
▶ Bearish Trend (Short/Sell): When the smoothed slope remains negative for the required confirmation bars, the indicator enters bearish state. The visual elements switch to the bearish color. This condition identifies potential short or sell opportunities and holds until a confirmed positive run occurs.
🟢 Features
▶ Preconfigured Presets: Three parameter sets cover different trading approaches. Default targets swing trading on 1H to daily charts with balanced rate and confirmation. Fast Response raises the recursion rate and shortens confirmation for intraday charts where the indicator needs to adapt to shorter-duration moves. Smooth Trend lowers the rate and lengthens confirmation for position trading on daily and weekly timeframes, where the cost of a false flip is higher than the cost of a delayed one. Selecting a preset overrides the individual rate, efficiency, and state detection inputs.
▶ Built-in Alerts: Three alert conditions are provided. Bullish State Signal fires when the trend state flips from bearish to bullish. Bearish State Signal fires on the opposite transition. Any State Change combines both into a single notification.
▶ Visual Customization: Six color presets (Classic, Aqua, Cosmic, Cyber, Neon, Custom) coordinate the trend line and gradient layers. Optional bar coloring tints candles with the active state color at a configurable transparency.
*Tips: Layer the Recursive Kernel Trend with complementary analysis rather than treating it as a standalone trading tool. State flips hold most reliably when backed by participation, so combine each change with volume context, since a flip on expanding volume is far more likely to sustain than one on thin flow, and read the move against market structure, as a reversal that aligns with a clear swing high or low carries more significance than one in open space. Pairing this script with volume, open interest, CVD, market structure, and mean reversion indicators from our QuantAlgo toolkit can further validate a directional shift before entry. Wskaźnik

Average Price Sideways Detector - Gap Neutral## Average Price Sideways Detector – Gap Neutral
The **Average Price Sideways Detector (APSD)** is designed to identify bullish, bearish, and sideways market conditions by analyzing the behavior of the average price derived from each candle's **High, Low, and Close (HLC3)**.
Unlike conventional trend indicators, APSD focuses on **average-price direction, price compression, and persistence** to identify periods where the market is genuinely moving sideways.
### How It Works
For every candle, the indicator calculates the typical price:
**Typical Price = (High + Low + Close) / 3**
It then analyzes three primary characteristics:
**Average Price Slope:** Measures the directional movement of the average price. A nearly flat slope indicates a potential sideways market.
**Price Compression:** Measures how tightly recent average prices are grouped. Lower compression ranges indicate consolidation and reduced directional movement.
**Sideways Persistence:** A sideways condition must remain valid for a specified number of consecutive candles before it is confirmed. This helps reduce temporary and false sideways signals.
### Gap-Neutral Calculation
The indicator resets its internal price calculation at the beginning of each new trading day. Therefore, overnight **gap-ups and gap-downs do not directly distort the current session's sideways analysis**.
This feature is particularly useful for intraday markets where significant opening gaps can otherwise influence rolling indicators for several candles.
### Indicator Interpretation
🟢 **Green Line** – Bullish price momentum
🔴 **Red Line** – Bearish price momentum
⚪ **Gray Line** – Neutral or sideways market condition
When a sideways market is fully confirmed through both flatness and compression conditions, the oscillator moves to the **zero line**.
The upper and lower threshold levels help separate meaningful directional movement from the neutral zone.
### Key Features
* Based primarily on High, Low, and Close average-price behavior
* Identifies price compression and average-price flatness
* Confirms sideways conditions using consecutive candles
* Gap-neutral session-based calculation
* Separates bullish, bearish, and sideways market conditions
* Adjustable sensitivity and confirmation settings
* Designed primarily for intraday market analysis
### Important Note
The indicator should be used as a market-condition detection tool rather than as a standalone buy or sell signal. Settings may need adjustment depending on the instrument, timeframe, and prevailing market volatility.
**Developed by Firozstar**
Wskaźnik

Terminal Velocity Stop | Lyro RSOverview:
Terminal Velocity Stop is an ATR-based trailing stop that borrows a physics concept for its trailing logic: a falling object stops accelerating once it hits terminal velocity. Instead of letting a single vertical candle snap the stop right under price, this stop's per-bar movement is hard-capped at a maximum speed, so it keeps a controlled distance through violent moves and only closes the gap gradually once the market settles.
Key Features
ATR-Based Stop Targeting: Calculates a bullish and bearish stop target using independent ATR multipliers, allowing asymmetric distance in uptrends versus downtrends.
Terminal Velocity Cap: Limits how far the stop can travel per bar (in ATR terms), so parabolic candles cannot yank the stop into the noise — the stop always approaches its target at a controlled, capped speed.
Directional Trailing Logic: The stop only tightens in the direction of the current trend and flips direction (with a fresh target) once price closes through it.
Trend Cloud Fill: Fills the space between price and the stop line, shaded and colored to reflect current trend direction and give a clear visual sense of the cushion between price and the stop.
Flip Markers: Plots a marker dot at the exact bar where the stop flips direction, making trend reversals easy to spot at a glance.
Candle Coloring: Colors chart candles according to the current stop direction for immediate visual alignment between price action and trend state.
Customizable Visuals: Choose from 4 preset palettes — Classic, Mystic, Accented, Royal — or define your own custom bullish/bearish colors.
How It Works
ATR Calculation – Computes the Average True Range over the chosen length as the base volatility measure.
Target Calculation – Sets a bullish target below price or bearish target above price, offset by the respective ATR multiplier.
Speed Capping – Limits the stop's movement toward its target each bar to a maximum of the Terminal Velocity setting (in ATR per bar), regardless of how far the target has moved.
Directional Trailing – In an uptrend the stop only ratchets upward toward its target; in a downtrend it only ratchets downward, never loosening.
Flip Detection – When price closes beyond the current stop, direction flips and a new stop target is established on the opposite side of price.
Visualization – Plots the stop line with a glow effect, fills the trend cloud between price and stop, marks flips, and colors candles to match the current direction.
Practical Use
Trailing Stop Management – Use the plotted stop line as a dynamic trailing stop level for open positions, adjusting for the asymmetric up/down multipliers to suit your risk tolerance.
Volatility Spike Protection – The Terminal Velocity cap helps avoid getting stopped out prematurely during a single volatile candle by preventing the stop from moving too aggressively in one bar.
Trend Direction Read – Use flip markers and candle coloring as a quick visual cue for the prevailing trend direction.
Cushion Awareness – Watch the width of the trend cloud to gauge how much room price currently has before triggering a stop flip.
Customization
Adjust ATR Length to tune stop responsiveness to volatility.
Set independent + and - Multipliers to control stop distance separately for uptrends and downtrends.
Adjust Terminal Velocity to control the maximum per-bar speed of the stop.
Pick a preset palette or define fully custom bullish/bearish colors.
⚠️Disclaimer
This indicator is a tool for technical analysis and does not provide guaranteed results. It should be used in conjunction with other analysis methods and proper risk management practices. The creators of this indicator are not responsible for any financial decisions made based on its signals. Wskaźnik

Funding Rate & OI Radar [StrixEDGE]What It Does
Funding Rate & OI Radar is a multi-symbol derivatives dashboard that consolidates funding rate intensity, open interest momentum across three timeframes, and price-OI divergence signals into a single on-chart table. It is designed for perpetual futures traders who need to read market positioning at a glance — without switching tabs or charts.
The indicator tracks up to 5 perpetual contract symbols simultaneously, surfaces extreme funding conditions as they develop, and flags structurally weak rallies or drops where price and open interest are moving in opposite directions.
Core Features
Funding Rate with Color Intensity
Funding rate values are color-graded by severity — from dim neutral tones near zero, through elevated orange, to extreme red (longs paying) or bright green (shorts paying). Extreme readings trigger a highlighted cell background so they stand out immediately during fast-moving markets.
Open Interest Change — 1H / 4H / 24H
Three separate OI delta columns show how positioning is shifting across intraday, swing, and daily windows. Each cell includes a directional arrow (▲ ▼ ►) and percentage change, color-coded against your configured alert threshold. This gives you a layered read: is OI building across all timeframes, or only spiking on the short window?
Price-OI Divergence Detection
The SIGNAL column cross-references 24H price change against 24H OI change and classifies the move:
- WEAK▲ — Price rising but OI declining. Rally lacks new capital commitment. Potential short squeeze or exhaustion move.
- WEAK▼ — Price falling but OI rising. New positions opening into the drop. Potential capitulation trap or forced selling.
- STRONG▲ — Price and OI both rising. New money entering on the long side. Structurally supported move.
- STRONG▼ — Price and OI both falling. Positions closing out. Orderly deleveraging.
- NEUTRAL — No meaningful divergence.
Weak signals receive a highlighted background row to ensure they are not missed.
Multi-Symbol Table
Monitor BTC, ETH, SOL, and two custom perpetual contracts of your choice — all rendered in a single dashboard. The table includes configurable column visibility, so you can strip it down to just FR + divergence, or run the full 8-column view.
Aggregate Sentiment Footer
The bottom row averages funding rates across all active symbols and classifies the overall market into one of seven sentiment tiers — from 🟢 EXTREME FEAR through ⚪ NEUTRAL to 🔴 EXTREME GREED. A fast, blunt read on whether the derivatives market is skewing overleveraged in either direction.
Alerts
Four built-in alert conditions, all routed through TradingView's native alert system:
- Extreme Funding Rate — Any tracked symbol's absolute FR exceeds your configured threshold (default: 0.05%/8h).
- OI Surge — Any symbol's 1H OI change exceeds your OI alert threshold (default: 5%).
- OI-Price Divergence — A WEAK▲ or WEAK▼ signal fires on any tracked symbol.
- Sentiment Extreme — Aggregate average FR across all symbols reaches the extreme zone.
Data Sources & Configuration
The indicator supports two modes for funding rate data:
- Ticker Mode (default) — Pulls funding rate from your exchange's dedicated FR data feed using a configurable ticker suffix (default: `_FR`). Requires the exchange to publish FR data through TradingView.
- Basis Proxy Mode — Estimates the implied 8-hour funding rate from the perpetual-spot price spread: `(Perp − Spot) / Spot / 3`. Useful when direct FR tickers are unavailable. Note: this is an approximation, not the actual settlement rate.
Open interest data is fetched via configurable OI ticker suffix (default: `_OI`).
Important: Ticker formats vary across exchanges and TradingView data providers. If columns display "N/A", adjust the OI/FR suffix inputs under 🔌 Data Sources to match your exchange's naming convention. Consult your exchange's TradingView symbol search for the correct format.
Settings Overview
📊 Symbols — Exchange selector, 3 default symbols (BTC/ETH/SOL perpetuals), 2 optional custom slots.
🔌 Data Sources — OI suffix, FR suffix, FR method toggle, spot suffix override for basis proxy.
🚨 Thresholds — Extreme FR level, elevated FR level, OI alert percentage. These control both color intensity breakpoints and alert trigger levels.
🎨 Display — Table position (8 positions), text size (Tiny / Small / Normal / Large).
📋 Columns — Individual toggles for Price, Price Δ24H, Funding Rate, OI Δ1H, OI Δ4H, OI Δ24H, Divergence Signal, and Sentiment Footer. Disable any column you don't need to keep the table compact.
Technical Notes
- Uses 25 `request.security()` calls across 5 symbols (well within Pine Script's 40-call limit).
- OI changes are calculated from actual multi-timeframe requests (60min, 240min, Daily) — not bar-count estimates — so they remain accurate regardless of your chart's timeframe.
- Table renders only on the last bar (`barstate.islast`) for performance.
- Inactive custom symbol slots (left blank) fall back to the primary ticker internally and are hidden from the table.
How to Read It
Open the indicator on any chart. The table appears as an overlay (default: top-right corner). Scan left to right:
1. Symbol — Which asset.
2. Price — Current perpetual price.
3. Δ24H — Daily price change. Green = up, red = down.
4. FR /8h — Current funding rate per 8-hour interval. Bright color = elevated. Highlighted background = extreme.
5. OI Δ1H / 4H / 24H — Open interest change with directional arrows. Look for alignment across timeframes (all rising = strong conviction) or divergence (1H spiking, 24H flat = short-term noise).
6. SIGNAL — Divergence classification. WEAK▲ and WEAK▼ are the actionable signals — they indicate structural fragility in the current move.
7. Sentiment — Aggregate market tilt from combined funding rates.
Use Cases
- Scalpers & intraday traders — Monitor 1H OI spikes alongside funding rate to detect short-squeeze or long-squeeze setups forming in real time.
- Swing traders — Use the divergence signal column to filter entries. Avoid longing into WEAK▲ conditions; avoid shorting into WEAK▼.
- Portfolio monitors — Track funding costs across multiple positions simultaneously. Elevated aggregate sentiment warns of crowded positioning before liquidation cascades.
Complementary Tools
Designed to pair with liquidity heatmaps and liquidation level estimators. Funding rate tells you who is paying whom. OI tells you how much is at stake. Liquidity maps tell you where the pressure points are. Together, they give a full derivatives positioning read. Wskaźnik

Reactive Trail System [WillyAlgoTrader]📊 Reactive Trail System (RTS) is an overlay trend-following indicator that combines a momentum-adaptive trailing stop, a dual volatility engine, a 0–100 signal quality score, and a complete trade-management layer (Entry / SL / TP1–TP3 / break-even) — all tracked live on a sectioned dashboard with win-rate statistics.
The core insight: a trailing stop should not have a fixed width. When momentum is strong, price moves cleanly and the trail can hug price to lock in profit. When momentum fades, price gets noisy and the trail must widen to survive the chop. RTS measures momentum every bar and reshapes the trail width automatically — up to 40% tighter in strong moves — so one setting adapts to changing conditions instead of being permanently too tight or too loose.
If you are new to trailing stops: think of the trail as a colored line that follows price from below in an uptrend (green) and from above in a downtrend (red). As long as price stays on the right side of the line, the trend is alive. When price closes through the line, the trend flips — and RTS turns that flip into a fully managed trade idea with a stop-loss and three targets drawn on the chart for you.
Works on all markets (crypto, forex, stocks, indices, commodities) and all timeframes.
🧩 WHY THESE COMPONENTS WORK TOGETHER
A classic supertrend-style trail has three chronic problems. First, its width is fixed — the same multiplier that protects you in chop gives back too much profit in a strong trend. Second, a raw trail flip says nothing about signal quality — a flip in dead, low-volume conditions looks identical to a flip with real participation. Third, a flip is not a trade — you still have to decide where the stop goes, where the targets go, and when to move to break-even.
RTS solves all three with one integrated pipeline:
Baseline MA (6 engines) → Dual volatility measure (ATR + StDev) → RSI momentum engine → Adaptive trail width → Ratcheting trail state machine → HTF bias + volume filters → 0–100 signal score → Wick-anchored SL + TP1/TP2/TP3 → Break-even automation → Trade outcome statistics
The baseline MA defines the anchor the trail hangs from. The volatility engine defines the raw distance. The RSI momentum engine then compresses that distance when momentum is strong — this is what makes the trail "reactive" rather than static. The ratcheting state machine guarantees the trail only ever tightens in the trade's favor (it never backs away from price). The HTF and volume filters decide whether a flip is allowed to become a trade. The scoring engine grades every entry so you can tell an A-setup from a C-setup at a glance. The risk engine converts the signal into concrete levels anchored to real market structure (the signal bar's wick), and the trade engine tracks every touch, break-even move, stop-out and reversal — feeding honest statistics back to the dashboard.
Remove any link and the chain breaks: without momentum adaptation the trail is just another supertrend; without filters every flip fires; without the wick-anchored stop the levels ignore structure; without outcome tracking you never learn how the system actually behaves on your market.
🔍 WHAT MAKES IT ORIGINAL
1️⃣ Momentum-adaptive trail width — the trail breathes with the market.
Instead of a fixed multiplier, RTS computes a momentum distance from the smoothed RSI and uses it to compress the trail:
— momDist = min(|RSI_smoothed − 50| / 50, 1.0) — 0 means dead-center momentum, 1 means extreme
— effectiveMultiplier = TrailMultiplier × (1 − Adaptivity × momDist × 0.4)
— trailOffset = volatility × effectiveMultiplier
With default Trail Multiplier 2.0 and Adaptivity 1.0, the trail runs at full width in neutral conditions and tightens by up to 40% when RSI pushes toward extremes. Set Adaptivity to 0 and you get a classic fixed-width trail; the default 1.0 gives maximum adaptation. RSI length 13 with EMA smoothing 3 keeps the width changes calm instead of jittery.
Why this matters: strong momentum = clean price movement = you can afford a tight trail that protects open profit. Weak momentum = noise = the trail widens automatically so you don't get shaken out.
2️⃣ Dual volatility engine — ATR, StDev, or a stabilized Hybrid.
Trail distance can be measured three ways (Volatility Length default 13):
— ATR: classic bar-range volatility
— StDev: close-to-close dispersion
— Hybrid (default): (ATR + StDev) / 2
ATR reacts to wicks and gaps; StDev reacts to closing dispersion. Averaging them dampens the weakness of each — a single wild wick inflates ATR but barely moves StDev, so the Hybrid stays stable where a pure-ATR trail would suddenly balloon.
3️⃣ Six baseline engines including KAMA and T3 — with a volume-safety fallback.
The trail anchors to a baseline MA selectable from HMA, ALMA (default, length 21), KAMA, T3, VWMA and EMA. KAMA and T3 are computed from their full formulas internally (Kaufman efficiency-ratio smoothing constant sc = (ER × (fast − slow) + slow)², and Tillson's six-stage EMA cascade with a = 0.7). If you pick VWMA on an instrument whose data feed reports no volume (common on some forex feeds), RTS silently falls back to EMA instead of plotting garbage.
4️⃣ Ratcheting trail state machine — the stop never retreats.
In a bull regime the trail is trail = max(previous trail, baseline − offset): it can only rise. In a bear regime it can only fall. A flip requires a full bar close beyond the trail — intrabar wicks through the line do not flip the trend. This one-way ratchet is what makes the line usable as an actual trailing stop rather than a wavy band.
5️⃣ Non-repainting HTF bias filter.
Optional filter: longs only when the higher timeframe (default 240 = 4H) closes above its 50 EMA, shorts only below. The HTF request uses the last closed HTF bar (index with lookahead), so the bias never changes retroactively — what you see in a live chart is what a backtest would have seen.
6️⃣ Signal quality score 0–100 — every entry is graded, not just fired.
Each entry gets a transparent confluence score:
— Momentum component (0–40): min(momDist / 0.6, 1) × 40
— Volume component (0–30): participation vs the 20-bar volume SMA, clamped; fixed 15 when the feed has no volume
— HTF alignment (10 or 30): 30 when the higher timeframe agrees with the trade direction, 10 when it doesn't
The score is shown in the BUY/SELL label tooltip, in the dashboard "Last signal" row, and in every entry alert. A 90-score long (strong momentum, heavy volume, HTF agrees) and a 45-score long are both valid flips — but you instantly know which one deserves full size.
7️⃣ Wick-anchored stop-loss — structure-aware risk, not a blind ATR offset.
Default SL mode anchors the stop to the signal bar's actual wick:
— Long SL = min(low − 0.25 × ATR, close − 0.5 × ATR)
— Short SL = max(high + 0.25 × ATR, close + 0.5 × ATR)
The 0.25 × ATR buffer sits the stop just beyond the wick (where stop-hunts reach), and the 0.5 × ATR minimum distance prevents absurdly tight stops on small-bodied signal bars. A classic fixed ATR mode (SL = entry ± multiplier × ATR, ATR length 14) is available too. Targets are pure R-multiples of the actual risk: TP = entry ± risk × multiplier.
Four one-click risk presets: Conservative (SL 2.5×ATR, TP 1R/2R/4R), Balanced (default: 1.5×ATR, 1R/2R/3R), Aggressive (1.0×ATR, 1.5R/2.5R/4R), Scalping (0.8×ATR, 0.8R/1.5R/2R), plus a fully manual Custom preset with input validation (TP1 < TP2 < TP3 enforced).
8️⃣ Full trade lifecycle engine with honest intrabar rules.
RTS doesn't just draw levels — it tracks the trade like a journal:
— Hits are checked only on confirmed bars, and never on the entry bar itself (entry-bar guard)
— TP-priority model: if a bar touches both a TP and the SL, the TP touch registers first (this optimistic assumption is disclosed right in the dashboard tooltip)
— Break-even automation: once TP1 is touched, the stop moves to entry; a BE moved this bar cannot stop you out on the same bar
— Opposite confirmed signal reverses the position (closes the old trade, opens the new one)
— Win definition is fixed and transparent: a trade counts as a WIN once TP1 has been touched (TP3 close, BE stop-out after TP1, or reversal after TP1); closed before TP1 = loss
9️⃣ Persistent trade visualization.
Entry (subtle dotted), SL (solid, prominent) and TP1/TP2/TP3 (dashed) lines extend with the live trade. When a TP is touched, its line turns solid teal with a ✓ on the label. When break-even activates, the original SL line dims to a record and the entry label is annotated "→ SL (BE)". After the trade closes, the drawing persists as a record until the next entry replaces it — you can scroll back and see exactly how each trade resolved.
🔟 Dashboard 2.0 with period-filtered statistics.
A sectioned panel (Market / Trade / Stats — each toggleable, position and font size configurable):
— Market: trend direction, trend age in bars, HTF bias, smoothed RSI, last signal with score and bars-ago
— Trade: entry, SL (with "BE @" marker), TP1–TP3 with ✓ checkmarks, R:R at TP1, SL distance in % — collapses to one row when flat
— Stats: closed trades, wins, losses, win rate with a ▰▱ gauge, and a "Form" strip of the last 10 results
The win-rate window is selectable: last 24 Hours, last 30 Days, or All-Time — computed from timestamped trade closures kept in a rolling 31-day buffer. Statistics reset on chart reload, and this is disclosed directly in the dashboard tooltips.
📖 HOW IT WORKS — CALCULATION FLOW
Step 1 — Baseline: the selected MA engine (ALMA 21 by default) is computed as the trail anchor.
Step 2 — Volatility: ATR and StDev over 13 bars are combined per the selected engine into one volatility measure.
Step 3 — Momentum: RSI(13) is EMA-smoothed(3); its distance from 50 (normalized 0–1) compresses the trail multiplier by up to 40%.
Step 4 — Trail update: the ratcheting state machine raises the trail in bull regimes / lowers it in bear regimes; a confirmed close through the trail flips the regime.
Step 5 — Filtering: the flip becomes an entry signal only if it passes the optional HTF bias and volume-confirmation filters, on a confirmed bar, after the warm-up period.
Step 6 — Scoring: the entry is graded 0–100 from momentum, volume participation and HTF alignment.
Step 7 — Risk placement: SL is anchored to the signal bar's wick (or fixed ATR), TP1–TP3 are projected as R-multiples of the actual risk per the active preset.
Step 8 — Trade tracking: every confirmed bar is checked for TP touches, break-even activation, stop-out or reversal; outcomes update the win/loss statistics and the Form strip.
📖 HOW TO USE
🎯 Quick start:
1. Add the indicator to your chart. Defaults (ALMA 21, Hybrid volatility, Balanced preset) are ready to use.
2. Wait for a ▲ BUY or ▼ SELL label — hover it to see the score, RSI, SL and TP1.
3. Check the dashboard: score of the last signal, HTF bias, and current R:R.
4. Prefer high-score signals (70+) where the HTF bias agrees with the trade direction.
5. Manage by the drawn levels: partial at TP1 (stop moves to break-even automatically), remainder toward TP2/TP3 or until the trail flips.
👁️ Reading the chart:
— 🟢 Green trail line below price = bull regime; it can only rise
— 🔴 Red trail line above price = bear regime; it can only fall
— ▲ BUY / ▼ SELL labels = filtered, confirmed entries (tooltip shows score and levels)
— Dotted line = entry reference · solid red = stop-loss · dashed green = TP1/TP2/TP3
— Teal solid TP line with ✓ = target reached · dimmed SL + "→ SL (BE)" = stop moved to entry
— Optional: soft trend fill between trail and baseline, and regime-colored candles
📊 Dashboard fields:
— Trend / Age: current regime and bars since the last flip
— HTF Bias: higher-timeframe direction (Off when the filter is disabled)
— RSI: the smoothed momentum value driving trail width
— Last signal: direction · score (bars ago)
— Entry / SL / TP1–TP3 / R:R / SL Dist: full live trade card
— Trades / Wins / Losses / Win rate: statistics for the selected period (24H / 30D / All-Time)
— Form: last 10 results, ▰ = win, ▱ = loss, newest on the right
🔧 Tuning guide:
— Too many flips / whipsaws: raise Trail Multiplier toward 2.5–3.0, raise Baseline Length toward 34–55, or enable the HTF Bias Filter
— Exits feel too late: lower Trail Multiplier toward 1.8, or keep Adaptivity at 1.0 so strong momentum tightens the trail
— Trail width feels jumpy: lower Momentum Adaptivity to 0.4–0.6 or raise Momentum Smoothing to 5–8
— Too few signals: disable the volume filter, or shorten Baseline Length toward 13–21
— Stops too tight on your market: switch the preset to Conservative, or use ATR mode with a higher SL multiplier
— Scalping lower timeframes: Scalping preset + Volatility Length 10 + consider HMA baseline
⚙️ KEY SETTINGS
⚙️ Main:
— Baseline MA Type (default ALMA): trail anchor engine — HMA / ALMA / KAMA / T3 / VWMA / EMA
— Baseline Length (default 21): higher = smoother, fewer flips
— Momentum (RSI) Length (default 13) and Smoothing (default 3): the adaptive-width driver
— Volatility Engine (default Hybrid) and Length (default 13)
— Trail Multiplier (default 2.0): base trail distance in volatility units
— Momentum Adaptivity (default 1.0): 0 = fixed width, 1 = up to 40% tightening
🔍 Filters:
— HTF Bias Filter (default off) + Higher Timeframe (default 240): trade only with the bigger trend
— Volume Confirmation (default off) + Threshold (default 1.2 × SMA20): require real participation; auto-bypassed on no-volume feeds
🛡️ Risk Management:
— Risk Preset (default Balanced): Conservative / Balanced / Aggressive / Scalping / Custom
— SL Mode (default Wick-Anchored): structure-based stop or fixed ATR
— ATR Length (default 14), SL / TP1 / TP2 / TP3 multipliers (Custom preset)
— Break-Even After TP1 (default on)
— SL/TP lines, labels, % distance and per-line styles are all configurable
🎨 Visual:
— Theme Auto / Dark / Light (auto-detects chart background), trail / baseline / fill / labels / candle-coloring toggles, font sizes, bull & bear colors
📊 Dashboard:
— Show/hide the panel and each section, position (4 corners), font size, Win Rate Period (24 Hours / 30 Days / All-Time)
🔔 ALERTS
— 🟢 LONG / 🔴 SHORT — entry with price, SL, TP1–TP3, R:R and score; plain text or JSON webhook payload for bot integration
— 🎯 TP1 HIT / 🎯🎯 TP2 HIT — target touches
— 🏆 TP3 HIT — final target, trade closed
— 🛑 SL HIT / 🛡️ BE STOP-OUT — stop-outs with entry and stop price
— 🛡️ BREAK-EVEN — stop moved to entry after TP1
— 🔄 REVERSAL — opposite signal closed the trade and opened the other direction
— ▲ / ▼ FLIP (optional, informational) — trail flipped but the entry was blocked by filters
All alerts fire once per confirmed bar close. Set up a single alert with "Any alert() function call" and toggle the categories you want in the settings.
⚠️ IMPORTANT NOTES
— 🚫 No repainting. Signals require barstate.isconfirmed; a flip needs a full bar close through the trail; the HTF filter reads only the last closed higher-timeframe bar; all alerts use bar-close frequency. What you see on historical bars is what the live chart produced.
— 📐 Intrabar assumption disclosed. When a single bar touches both a TP and the SL, the TP registers first (optimistic model). This is stated in the dashboard tooltip so the statistics are interpreted correctly.
— 📐 Statistics are session-based. Win/loss counts and the Form strip are computed from the loaded chart history and reset on chart reload. Past performance does not guarantee future results.
— ⚖️ Scope. RTS is a trend-following system — like any trail-based approach it performs best in trending conditions and will flip more often in tight ranges. Use the HTF and volume filters and the score to skip low-quality environments.
— 🛠️ This is an analysis tool, not an automated trading bot. It identifies trend regimes, grades entries, and draws structured risk levels — trade decisions remain yours.
— 🌐 Works on all markets and timeframes. Instruments without volume data are handled automatically (VWMA falls back to EMA, the volume filter bypasses, scoring uses a neutral volume component).
The indicator is completely free. Wskaźnik

QIFM SMC Market Structure QIFM SMC Market Structure — 2CR/2CG, BOS, CHoCH, FVG & OB
OVERVIEW
QIFM SMC Market Structure is a rule-based charting indicator designed to identify and display developing market structure using a custom Two-Candle Retracement framework.
The indicator combines:
• Two-Candle Retracement confirmation: 2CR and 2CG
• Developing and confirmed Break of Structure levels
• Pending and confirmed Change of Character levels
• Dual CHoCH identification
• Structure-based Fibonacci retracement levels
• Structure-leg Fair Value Gaps
• Order Blocks associated with accepted FVG patterns
• Previous Day High and Low
• Previous Week High and Low
• Optional candle classification and live OHLC analysis
This is a market-structure analysis tool. It does not place trades, calculate position size, or provide guaranteed buy and sell signals.
ORIGINALITY AND PURPOSE
The central feature of this indicator is its custom structure-confirmation sequence.
Instead of defining every local high or low as market structure, the script waits for a specific two-candle retracement condition before establishing a pending BOS level. Confirmed BOS and CHoCH events are then used to control where the indicator searches for FVG and Order Block zones.
The main original component is the sequencing of:
Impulse extreme → 2CR/2CG confirmation → pending BOS → confirmed BOS → protected CHoCH point → confirmed CHoCH → structure-leg FVG and OB filtering.
This structure-based filtering is intended to reduce the number of randomly marked gaps and blocks that are not connected to a confirmed market-structure event.
1. TWO-CANDLE RETRACEMENT: 2CR AND 2CG
The indicator uses two types of retracement confirmation.
2CR — Two-Candle Red Retracement
During a developing bullish structure:
• The script records a bearish candle as the first retracement candle.
• The next bearish candle must close below the low of the first bearish candle.
• When this condition is completed, the pattern is marked as 2CR.
• The highest price reached before the confirmed retracement becomes the pending bullish BOS level.
2CG — Two-Candle Green Retracement
During a developing bearish structure:
• The script records a bullish candle as the first retracement candle.
• The next bullish candle must close above the high of the first bullish candle.
• When this condition is completed, the pattern is marked as 2CG.
• The lowest price reached before the confirmed retracement becomes the pending bearish BOS level.
Inside-range behavior is also evaluated while the pattern is developing. A candle contained within the tracked range does not automatically confirm the retracement.
2. PENDING AND CONFIRMED BREAK OF STRUCTURE
After a valid 2CR or 2CG pattern, the script creates a waiting BOS line.
Bullish BOS:
• A 2CR confirms the retracement.
• The preceding bullish extreme becomes the pending BOS level.
• A bullish BOS is confirmed when a candle closes above that level.
Bearish BOS:
• A 2CG confirms the retracement.
• The preceding bearish extreme becomes the pending BOS level.
• A bearish BOS is confirmed when a candle closes below that level.
The waiting BOS line and the confirmed BOS line have separate style, width, and color controls.
A wick through the BOS level is not sufficient. BOS confirmation is based on the candle close.
3. PENDING CHoCH POINT
After a confirmed bullish BOS, the lowest point of the confirmed retracement becomes the bearish protected structure level.
After a confirmed bearish BOS, the highest point of the confirmed retracement becomes the bullish protected structure level.
This protected level is displayed as:
P.CHoCH — Pending Change of Character
The active pending CHoCH line represents the level that must be broken to confirm a potential change in the current market structure.
Users can separately display:
• The current pending CHoCH level
• Previous pending CHoCH levels
4. CONFIRMED CHANGE OF CHARACTER
A CHoCH requires two consecutive candle closes beyond the active protected level.
Bearish CHoCH:
• The current structure is bullish.
• Two consecutive candles close below the active bearish P.CHoCH level.
• The script marks a confirmed bearish CHoCH.
• The internal trend state changes from bullish to bearish.
Bullish CHoCH:
• The current structure is bearish.
• Two consecutive candles close above the active bullish P.CHoCH level.
• The script marks a confirmed bullish CHoCH.
• The internal trend state changes from bearish to bullish.
The candle colors are not used for CHoCH confirmation. Only the two consecutive closing prices relative to the protected level are evaluated.
5. DUAL CHoCH
The Dual CHoCH feature tracks an additional structural reference following a confirmed change in direction.
It is intended to highlight a secondary two-close break beyond the previous structural extreme. This can help users distinguish an initial change of character from a more developed structural transition.
Dual CHoCH lines, labels, colors, widths, and styles can be customized separately.
6. STRUCTURE-BASED FIBONACCI LEVELS
When a valid 2CR or 2CG creates a pending BOS setup, the indicator calculates Fibonacci levels across the relevant structure range.
The visible default levels are:
• 0.50
• 0.618
• 0.70
• 1.00
The script can display:
• The current structure Fibonacci
• A selected number of previous Fibonacci structures
• Individual Fibonacci level labels
• Custom colors, widths, and line styles
The 0.50-to-1.00 portion of the calculated range is also used internally as a location filter for qualifying FVG and Order Block zones.
In bullish structure, this generally represents the deeper or discount side of the measured range.
In bearish structure, this generally represents the deeper or premium side of the measured range.
Fibonacci levels are reference locations only. They are not automatic trade-entry signals.
7. FAIR VALUE GAP LOGIC
The script does not search for FVGs across every candle on the chart.
It searches for FVGs only inside confirmed BOS and CHoCH displacement legs.
Bullish FVG requirements include:
• A three-candle bullish wick imbalance
• The third candle’s low is above the first candle’s high
• The third candle closes above the second candle’s high
• Additional inside-candle checks reject compressed or fully contained formations
• The FVG and its associated Order Block must be positioned within the active Fibonacci filtering band
Bearish FVG requirements include:
• A three-candle bearish wick imbalance
• The third candle’s high is below the first candle’s low
• The third candle closes below the second candle’s low
• Additional inside-candle checks reject compressed or fully contained formations
• The FVG and its associated Order Block must be positioned within the active Fibonacci filtering band
Only qualifying structure-leg FVGs are displayed.
8. ORDER BLOCK LOGIC
For each accepted FVG pattern, the script defines the full high-to-low range of the first candle in the three-candle FVG formation as the associated Order Block.
The OB is therefore directly connected to:
• A confirmed BOS or CHoCH leg
• An accepted three-candle FVG pattern
• The active Fibonacci location filter
Bullish and bearish Order Blocks have separate visibility and color settings.
The OB zones are analytical reference areas. They should not be treated as guaranteed reversal or entry locations.
9. FVG AND OB MITIGATION
Users can choose between two FVG mitigation methods.
First Touch:
The zone is considered mitigated when price first enters the FVG boundary.
Full Fill:
The zone remains active until price reaches the opposite boundary of the FVG.
When mitigation occurs, users can choose to:
• Keep the zone as faded historical information
• Hide the completed zone
The associated OB is updated together with its corresponding FVG.
Historical zones show where a valid structure-leg imbalance previously existed. They do not indicate that the zone remains tradable.
10. PREVIOUS DAY AND PREVIOUS WEEK LEVELS
The indicator can display:
• PDH — Previous Day High
• PDL — Previous Day Low
• PWH — Previous Week High
• PWL — Previous Week Low
These values are taken from completed daily and weekly periods.
PDH and PDL alert conditions are included. An alert can be triggered when price touches the active Previous Day High or Previous Day Low for the first time relative to the preceding chart bar.
The levels are contextual liquidity references and are not independent buy or sell signals.
11. OPTIONAL CANDLE ANALYSIS
The optional live candle-analysis panel displays:
• Candle status: live or closed
• Bullish, bearish, or doji classification
• Open, high, low, and close
• Candle-body percentage
• Upper and lower wick sizes
• Full-range or body-inside classification
• Direct 2CR or 2CG close test
Users can also enable candle coloring based on the same classifications.
The panel is intended for studying the conditions used by the structure engine. It is not an order-execution panel.
HOW TO USE THE INDICATOR
1. Use a standard candlestick chart.
2. Select the symbol and timeframe appropriate for your analysis.
3. Observe whether the script is tracking a bullish or bearish structural sequence.
4. Wait for a confirmed 2CR or 2CG marker.
5. Observe the waiting BOS line created at the preceding impulse extreme.
6. Wait for a candle close beyond the waiting BOS line to confirm BOS.
7. After BOS, monitor the newly created P.CHoCH level.
8. A CHoCH is confirmed only after two consecutive closes beyond the protected level.
9. Use structure-leg FVG, OB, Fibonacci, PDH, PDL, PWH, and PWL zones as additional context.
10. Apply independent risk management and entry confirmation before making any trading decision.
The indicator is best used as a chart-organization and market-structure tool rather than as a standalone trading system.
IMPORTANT SETTINGS
2CR / 2CG Settings:
Control retracement labels, zone visibility, colors, and the maximum number of displayed zones.
BOS Settings:
Control waiting BOS lines, confirmed BOS lines, labels, colors, widths, and styles.
CHoCH Settings:
Control confirmed and pending CHoCH levels, previous protected levels, labels, colors, widths, and styles.
Dual CHoCH Settings:
Control secondary CHoCH lines and labels.
BOS Fib Settings:
Control the current Fibonacci structure, previous structures, visible retracement levels, labels, colors, widths, and styles.
FVG Settings:
Control bullish and bearish FVG visibility, mitigation method, active zones, historical zones, scan distance, colors, and maximum stored zones.
Order Block Settings:
Control bullish and bearish OB visibility, active zones, historical zones, text, borders, and colors.
Previous Day / Week Levels:
Control PDH, PDL, PWH, and PWL visibility and PDH/PDL alerts.
Candle Analysis:
Control the live OHLC panel and optional candle classification colors.
REAL-TIME BEHAVIOR
The current candle’s high, low, close, classification, developing structure, and panel values can change while the candle is still open.
Close-dependent conditions such as:
• 2CR confirmation
• 2CG confirmation
• BOS confirmation
• CHoCH confirmation
• FVG body confirmation
should be evaluated after the relevant candle has closed.
Confirmed historical calculations do not intentionally use future candles. Previous-day and previous-week levels are taken from completed reference periods.
LIMITATIONS
• The script begins with an internal bullish structure state and then adapts as confirmed structure events occur.
• Market structure depends on the selected symbol, timeframe, data feed, and available chart history.
• Lower timeframes may produce more structural changes and visual noise.
• A confirmed BOS or CHoCH does not guarantee continuation or reversal.
• FVG, OB, Fibonacci, PDH, PDL, PWH, and PWL levels can be crossed without producing a reaction.
• The script does not account for spread, commission, slippage, economic news, liquidity conditions, or position sizing.
• The number of displayed historical objects is limited by the selected settings and TradingView’s drawing-object limits.
• Results can differ between brokers or exchanges because their OHLC data may differ.
ALERTS
The current version includes alert conditions for:
• Previous Day High touched
• Previous Day Low touched
Users should create alerts from TradingView’s alert menu after adding the indicator to a chart.
EDUCATIONAL DISCLAIMER
This indicator is provided for technical-analysis, educational, and informational purposes only.
It is not investment advice, financial advice, or a recommendation to buy or sell any financial instrument. No market-structure event, FVG, Order Block, Fibonacci level, or previous-period level can guarantee a profitable outcome.
Trading and investing involve substantial risk. Users are responsible for independently evaluating all information, testing the indicator, managing their risk, and making their own trading decisions. Past market behavior does not guarantee future results.
Wskaźnik

Trend Ribbon [MachineSuiteAI]Trend Ribbon
respect ranking, measured cross odds and auditable statistics
🟦 OVERVIEW
A five-average trend ribbon (8 / 21 / 50 / 100 / 200 by default; EMA, WMA, SMA, HMA or VWMA) built on one idea: the ribbon should measure itself.
Beyond the stack-based trend state and 50/100 cross markers, it keeps auditable statistics on the chart it is loaded on: which average price has actually been respecting (and how reliably), how every 50/100 cross resolved, what happened after squeeze expansions and after trend-health peaks — each statistic with its sample size, and each verifiable on the chart itself, dot by dot. It is built for traders who use layered moving averages and want the chart to answer two questions the ribbon genre normally leaves to folklore: which of these lines matters here, and what have these signals actually done on this symbol?
🟦 WHAT IS A TREND RIBBON?
Moving-average ribbons are a public-domain concept: several averages of increasing length plotted together. When they are stacked in order the trend is orderly; when they compress and interleave the market is ranging; crosses of a slower pair mark regime changes. Published ribbon scripts already color stacks, count touches, score trend strength and detect squeezes.
What the genre does not do is resolve outcomes. A ribbon will mark a "golden cross" without knowing how golden crosses have actually resolved on this chart; it will call an average "support" without a record of how often that support held. This script's contribution sits one level up: measurement with discipline, and evidence you can check.
🟦 WHY THIS SCRIPT IS ORIGINAL
- A cross odds engine. Every 50/100 cross is resolved N bars later (default 10) on the loaded symbol and timeframe: did the close move in the cross's direction? The win rate is tracked and split by volume confirmation, higher-timeframe agreement, and whipsaw-cluster membership — each split with its own sample size, greyed below a minimum. To the author's knowledge no published ribbon resolves its own crosses' outcomes, let alone per filter.
- Evidence-gated chart marks. The ✓ volume mark and ⚠ counter-HTF warning print on cross chips only where the measured split beats the chart's own base rate by a configurable margin with sufficient samples. Filters that have not helped on this chart do not decorate it.
- Auditable statistics. The respect record is drawn on the chart: numbered dots mark the counted touches of the leading average (gold = held, grey = failed) and a grey ✕ marks clean pass-throughs where nothing was tested and nothing entered the record. Every number in the panel can be verified visually — no other script found does this.
- Outcomes attached to the score and the squeeze. The 0–100 health score is not just decomposed from a stated formula — the panel reports how often the primary side was still intact at three horizons after past crossings above 80, on this chart. Squeeze expansions are likewise measured N bars later (median move, direction agreement, samples).
- Recency-weighted respect ranking. Touch counting exists in published scripts; here each average's last 12 touches form a rolling record where the newest touch weighs most, and the gold halo must be earned twice over: both the raw record and the weighted recent form have to clear a threshold. Below it the panel reads LOW RESPECT — price slicing through everything is itself information.
- Readability engineered like the statistics. Six engines share one chart only because the visual rules are strict: line identities never change (white 50, amber 100, thick grey 200 — the respect halo is an underlay beneath the leader's own line, never a recolor), whipsaw crosses are de-emphasized but never deleted so the visible ▲/▼ sequence always alternates, higher-timeframe levels identify themselves with end tags instead of a legend, and every mark on the chart has exactly one meaning. Nothing decorative, nothing unexplained.
🟦 HOW IT WORKS
- Trend state: the 50/100 pair picks the side; the state reads BULL or BEAR only when at least 3 of the 4 adjacent stack pairs agree, otherwise CHOP. Fill opacity scales with alignment.
- Respect engine: every touch of every average runs through a small state machine on confirmed bars. A touch requires the prior close beyond the average, a penetration into a tolerance band (default 0.25 × ATR(14)) and a close back on the original side; consecutive contacts merge into one event. The touch HOLDS if no close crosses the far tolerance edge within the resolve window (default 5 bars). Each average keeps its last 12 resolved touches; the best recency-weighted hold rate (minimum 5 touches) leads the ranking, and the leader earns a soft gold halo under its own line only when raw record and recent form both clear the threshold (default 50%).
- Cross odds engine: as described above — confirmed bars only, fixed-horizon resolution, per-filter splits, evidence-gated chip marks.
- Health score: 0–100 from a stated formula — 40% stack alignment + 25% slope consistency + 20% price position + 15% width behavior. The panel tooltip decomposes the live score and reports the measured survival after 80-crossings at half, full and double the outcome window.
- MTF strip and HTF anchors: a small table shows the 50/100 cross state on five timeframes, and up to three higher-timeframe averages plot as stepped level lines (default: the 50/100/200 one regime up, with an optional corridor fill between the pair, tinted by where price trades). Both are read from the last completed bar of their timeframe with confirmed-bar indexing, so they can appear one higher-timeframe bar late but never rewrite. Anchors render only once their timeframe has a full length of history — young symbols never show statistically meaningless levels.
- Squeeze and expansion: ribbon width (widest minus narrowest core average, as % of price) is percentile-ranked over a lookback (default 250 bars); below the threshold percentile the ribbon is squeezed. Every expansion out of a squeeze is measured N bars later: median move, direction agreement with the ribbon state, and an "A-grade" slice (state agreed with the higher timeframe AND volume confirmed) tracked separately.
- Cluster damping: several crosses inside a short window classify as whipsaw; rapid re-crosses shrink to dimmed dots rather than full chips — de-emphasized, never deleted, so the visible ▲/▼ sequence always alternates. A cross suppressed into a cluster can still print later, once, if the market settles on its side.
All statistics are collected on confirmed bars only.
🟦 HOW TO USE IT
- Line identities stay fixed: white 50, amber 100, thick grey 200, fast pair in the trend color. The pair that generates the signals is always findable.
- Read the panel top-down: state, health, stack, the respected average with its raw record and recent form, cross recency, the measured win-rate splits, then width and expansion.
- A typical workflow: before treating a pullback to an average as meaningful, check that average's record — the gold halo and its numbered dots are the evidence. Before taking a cross, check whether volume or higher-timeframe agreement has historically mattered on this particular chart — the ↑ marks in the odds rows answer that. Use the MTF strip for context and the HTF corridor as the higher-timeframe decision zone.
- Defaults suit swing timeframes (4H–1D); everything is length-adjustable.
🟦 SETTINGS
- Averages: type, five core lengths, up to three optional extras, curated price source.
- Respect engine: halo and audit-dot toggles, touch tolerance, hold window, ranking window, minimum touches, gold threshold, recency decay.
- Health score: panel row toggle, outcome window.
- Cross odds engine: outcome horizon, minimum sample, evidence-mark gating mode, improvement margin.
- MTF cross strip: five timeframes, strip position.
- HTF anchors: auto or fixed anchor timeframe, three levels with lengths and colors, corridor or lines-only rendering.
- Visuals and extras: marker style (chips/dots/off), cluster damping, line-coloring mode (stack state or per-line slope), price-scale labels, squeeze shading, conviction-scaled fill, panel position, colors, volume-confirmation multiple.
🟦 ALERTS
Primary 50/100 cross (bull/bear) · fast 8/21 cross (bull/bear) · full stack aligned (bull/bear) · cross + volume (bull/bear) · squeeze start · squeeze expansion + volume · respected-average touch · respected average changed · health crossed 80 · health dropped below 40.
🟦 REPAINT & DATA NOTES
- Chips, dots and all bookkeeping wait for bar confirmation; the live bar updates until it closes.
- Higher-timeframe reads use the last completed bar of their timeframe: repaint-safe, but up to one higher-timeframe bar late by construction.
- Statistics are computed over the loaded history and reset when the chart reloads with a different amount of history; low timeframes load fewer bars.
- Volume-based features — including the VWMA average type — require a feed that supplies volume.
- TradingView caps a script's labels at 500, so on long intraday histories the oldest cross chips drop off the left edge; the statistics still cover the full loaded history.
- MTF strip rows set below the chart's own timeframe show a dash: a lower timeframe cannot be read repaint-safely from a higher-timeframe chart.
- The higher-timeframe anchor levels can sit far from current price (a weekly 200 on a daily chart, for example), which widens the chart's auto-fitted price scale. Enable "Scale price chart only" in your chart settings — or switch anchors off — if you prefer a tight fit around price.
🟦 CREDITS
Moving averages, ribbons, MA crosses and squeeze concepts are public domain. The implementation — the respect state machine, cross odds engine, evidence gating, health decomposition with measured outcomes, repaint-safe MTF/anchor reads and the audit-dot system — was written from scratch for this script.
🟦 LIMITATIONS
- Moving averages lag; ranging markets whipsaw the state and the crosses. The cluster logic labels that condition, it does not remove it.
- All win rates, hold rates and outcome stats are historical measurements on the loaded chart only. They change with symbol, timeframe and loaded history, are greyed below the minimum sample, and do not predict future results.
- The outcome definition is direction-only over a fixed horizon — no stops, fees, or sizing; this is not a strategy backtest.
🟦 DISCLAIMER
This is an educational analysis tool, not investment advice. Historical measurements, however carefully computed, do not predict future results. Trading involves substantial risk. Wskaźnik

Liquidity Sweep Reversal [JOAT]═══ LIQUIDITY SWEEP REVERSAL ═══
Liquidity Sweep Reversal hunts the stop-run. Price wicks beyond a prior swing high or low to grab resting liquidity, then snaps back inside — and that reclaim is where the reversal often begins. This tool tracks those levels, validates the sweep, and frames a complete trade with stop, targets and live outcome stats. 🎯
▎ WHAT IT DOES
It maps recent swing highs and swing lows as liquidity pools, watches for a candle to pierce one and then close back on the correct side (the reclaim ), and prints a clean BUY or SELL label. Every valid signal is turned into a structured trade: an ATR-based stop beyond the swept wick and three R-multiple targets, all tracked to resolution on a self-scoring dashboard.
▎ HOW IT WORKS
• Liquidity mapping — Confirmed pivot highs and lows (lookback set by Swing Pivot Lookback ) are stored as active levels per side, capped in count and aged out after a maximum bar age so only relevant pools remain.
• Sweep + reclaim — A bullish setup needs the bar to wick below a tracked swing low, then close back above it (sell-side liquidity grabbed). A bearish setup wicks above a swing high, then closes back below it. The reclaim can complete on the sweep bar or within the Reclaim Window you allow.
• Wick-depth gate — The penetration beyond the level is measured in ATR. Too shallow (noise) or too deep beyond the Max Wick cap (a genuine breakout) is rejected, so only clean stop-hunts qualify.
• Confluence filters — Optional volume-spike confirmation, HTF trend alignment (BUY only above a higher-timeframe EMA, SELL only below), directional restriction, dual-side sweep blocking on wide bars, and a signal cooldown all thin the feed.
• Trade construction — Entry is the reclaim close. The stop sits beyond the swept wick by an ATR buffer, then is clamped between a min-risk floor and max-risk cap. That risk (1R) projects TP1 / TP2 / TP3 at your chosen R multiples.
• Outcome engine — Each trade is followed bar by bar. Same-bar stop-vs-target conflicts resolve by your chosen priority, and trades that never reach TP3 or stop are flattened at a bar timeout — every result feeds the stats.
▎ HOW TO USE IT
• A BUY pill under price marks a bullish reclaim; a SELL pill above price marks a bearish one. The dotted level line and SSL / BSL SWEEP tag show exactly which liquidity pool was raided.
• The green target zone spans entry to TP3; the red risk zone spans entry to stop. Lines and left-side labels print entry, SL and each TP with its R value.
• On close, a result label reports the outcome — TP3 , a protected partial TP , SL , or a TIME exit — with the realised R.
• Treat signals as a structured framework, not a black box: strongest reversals tend to appear at obvious swing extremes, with HTF alignment and a volume spike behind them.
▎ KEY SETTINGS
• Engine — pivot lookback, reclaim window, ATR length, tracked levels per side, level age, and signal direction (Both / Long / Short).
• Filters — min/max wick depth, volume-spike confirmation, HTF timeframe + EMA, dual-side blocking, and cooldown bars.
• Trade Model — stop buffer, min/max risk bounds, TP1/TP2/TP3 in R, same-bar priority, trade timeout, and drawn-trade history depth.
• Visuals — toggles for markers, sweep lines, zones, level labels, result labels, optional signal-candle tint, and a session VWAP ± σ band .
▎ DASHBOARD
A compact panel reports live state — Status (Waiting / Armed / Active), current active trade side, last sweep and its level — alongside performance: sweeps detected, signals taken, closed count, win rate , profit factor , average R , bull vs bear win%, current and max win/loss streak , and an optional TP1/TP2/TP3 vs SL/Timeout breakdown. Position and text size are configurable.
▎ ALERTS
• Bullish Sweep (BUY) and Bearish Sweep (SELL) on confirmed entries.
• TP3 Hit , Partial TP Hit (protected exit), and SL Hit on trade resolution.
▎ NOTES
• Works on all timeframes and all assets — instruments without volume simply pass the volume filter.
• Signals confirm on the reclaim close , so a printed BUY/SELL marker does not move once the bar closes.
• Every visual has a toggle — turn off zones, lines, labels or the dashboard for a minimalist chart.
• The on-chart statistics summarise historical signals only and are illustrative, not a forecast.
For research and education only. This is not financial advice. No indicator can predict the future, and past behaviour does not guarantee future results. Always manage your own risk.
Made with passion by JackOfAllTrades ⚡ Wskaźnik

Trend Direction Zone Trend Direction Zone is a compact trend-state indicator designed to answer one practical question:
Which market direction is currently confirmed by both price position and the movement of the trend line?
The indicator combines a lag-reduced trend line, an adaptive ATR-based zone, and filtered direction-change markers.
These are not separate indicators simply placed on the same chart. All components work together as one unified model for detecting and maintaining the current market direction:
🔹 the central line estimates the underlying direction of price movement;
🔹 the adaptive zone provides current volatility context;
🔹 confirmation filters determine when the active direction is allowed to change;
🔹 triangles mark only confirmed transitions from one direction to the other.
This structure allows traders to assess market direction quickly without cluttering the chart with repeated crossover signals, targets, probability percentages, dashboards, or calculations unrelated to the indicator’s primary purpose.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📈 How the trend line is calculated
The central trend line calculation begins with an exponential moving average of the selected price source.
A second exponential moving average is then calculated from the first EMA.
The difference between the first and second EMA is used as a lag-compensation component:
Trend Line = EMA + (EMA − EMA of EMA) × Lag Reduction
The Lag Reduction parameter controls how quickly the line responds:
🔹 a value of 0 produces the base EMA;
🔹 higher values allow the line to react more quickly to price changes;
🔹 excessively high values can increase sensitivity and produce greater overshoot during sharp price movements.
The Trend Length parameter defines the primary smoothing period.
Lower values make the line faster and more sensitive. Higher values create a slower and smoother directional reference.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🌊 How the adaptive zone works
The colored zone around the central line is calculated using Average True Range — ATR.
Instead of using only a fixed ATR multiplier, the script compares the current ATR value with the highest and lowest ATR values observed during the selected period.
This produces a normalized volatility level showing whether current volatility is relatively low or high compared with its recent range.
The zone width takes into account:
🔹 the current ATR value;
🔹 the position of the current ATR within its recent volatility range;
🔹 the user-defined Zone Width multiplier.
Therefore:
the zone contracts when volatility is relatively low;
the zone expands when volatility is elevated.
The zone is intended to provide volatility context around the trend line.
Its boundaries are not calculated as support, resistance, stop-loss, or profit-target levels.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🧭 How direction is determined
The indicator does not change direction based only on a simple crossover between price and the central line.
For a potential bullish direction, three conditions must be satisfied simultaneously:
🔹 the three-bar slope of the central line must be positive;
🔹 price must be above the central line;
🔹 the distance between price and the line must exceed the ATR-based Switch Filter.
For a potential bearish direction, the opposite conditions are required:
🔹 the slope of the central line must be negative;
🔹 price must be below the central line;
🔹 the distance between price and the line must exceed the selected ATR-based filter.
Before the active direction changes, the new conditions must remain valid for the selected number of closed bars.
The Minimum Bars Between Signals parameter defines the minimum number of bars required between opposite signals.
Its purpose is to reduce rapid switching between bullish and bearish states during short and noisy price movements.
Once a direction has been confirmed, the indicator maintains that state until the opposite direction is confirmed.
Temporary weakening of the current move does not immediately return the indicator to a neutral state.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎨 How to read the indicator
Green line and green zone
A bullish direction is currently confirmed.
Red line and red zone
A bearish direction is currently confirmed.
Green upward triangle
Marks the confirmation of a new bullish direction.
Red downward triangle
Marks the confirmation of a new bearish direction.
Bullish triangles are always positioned below the central line.
Bearish triangles are always positioned above the central line.
The distance between the triangles and the central line is calculated using ATR. This allows their placement to adapt to the price scale and volatility of the selected instrument.
The Signal Distance From Line parameter changes only the visual distance between the triangle and the central line.
It does not affect the direction calculation or the timing of the signal.
⚠️ The triangles should be interpreted as markers of a confirmed trend-state transition, not as automatic instructions to enter or exit a trade.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚙️ Default settings
Trend Length: 20
Lag Reduction: 1.2
ATR Length: 14
Zone Width: 2.0
Direction Confirmation: 2 closed bars
Switch Filter: 0.20 ATR
Minimum Bars Between Signals: 5 bars
Signal Distance From Line: 0.45 ATR
The default values are intended as a balanced starting point.
They are not optimized for any specific instrument, market, or timeframe.
Increasing Trend Length, Direction Confirmation, Switch Filter, or Minimum Bars Between Signals will generally result in:
🔹 fewer direction changes;
🔹 a more persistent trend state;
🔹 later confirmation of a new direction.
Reducing these values generally makes the indicator more responsive, but may increase the number of direction changes during sideways market conditions.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⏱ Real-time behavior
Direction changes, triangle markers, and alert conditions are confirmed only after the candle has closed.
The central line and adaptive zone use current price and volatility data, so they may move while the active candle is still forming.
A direction triangle is not confirmed on an unfinished candle.
The script uses data only from:
🔹 the current chart symbol;
🔹 the current chart timeframe.
It does not request data from higher timeframes and does not use calculations that reference future values.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔔 Alerts
The indicator includes two alert conditions:
Bullish Direction — a bullish direction has been confirmed.
Bearish Direction — a bearish direction has been confirmed.
The alerts correspond to confirmed direction changes.
When creating an alert, it is recommended to select Once Per Bar Close.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛡 Limitations
Trend Direction Zone is a visual trend-following tool.
It does not predict future prices or identify exact market tops and bottoms.
Like other trend-following methods, the indicator may confirm a direction change after the reversal has already begun.
In sideways or irregular markets, direction changes may occur without developing into sustained trends.
The confirmation and minimum-signal-spacing filters reduce some short-term switching. However, stronger filtering may also delay the recognition of fast reversals.
A wide zone means that current volatility is elevated relative to recent values.
It does not mean that price must remain inside the zone.
The indicator does not include:
🔹 position-size calculations;
🔹 stop-loss levels;
🔹 profit targets;
🔹 strategy backtesting;
🔹 performance statistics.
Trend Direction Zone should be used as one source of information about current market conditions alongside the trader’s own analysis and risk-management process. Wskaźnik

Flag Pattern Breakout [Dots3Red]█ FLAG PATTERN BREAKOUT
This script detects bull and bear flag patterns using two structural components: the staff (the impulsive pole) and the edge (the consolidation channel). Rather than relying on generic pivot-to-pivot zigzag lines, both components are built from regression-fitted geometry so the drawn shapes reflect the actual price structure rather than an approximation.
█ THE STAFF
The staff is the sharp, near-straight-line impulsive move that starts a flag. Two checks work together to identify it:
Structural continuity — instead of checking candle color (green vs red), the script checks whether each bar's wick still overlaps the bar before it. For a rising staff, a bar whose high fails to reach the previous bar's low counts as a break in the move. This catches genuine gaps in the advance while tolerating a normal red pullback candle that still overlaps the prior bar.
Straightness (R²) — a linear regression is fit through the closing prices of the candidate window, and its R² (coefficient of determination) is required to clear a minimum threshold (default 0.85). An R² of 1.0 would mean the closes sit exactly on a straight line; lower values reflect real curvature. Since real price data rarely produces a perfectly straight move, the threshold is adjustable rather than fixed at 1.0.
The search checks the longest possible window first and works down to shorter ones. A long window is only accepted if it clears both the wick-overlap test and the R² threshold — so the result favors the longest staff that still qualifies as straight, rather than the first short segment that happens to pass.
The staff line itself is drawn using the actual price at the two boundary bars (not the highest/lowest price found anywhere inside the scanning window), so it sits flush against the real candle wicks at both ends.
█ THE EDGE
The edge is the flag itself — a channel that runs opposite to the staff's direction. It is built as follows:
Slope — a running linear regression is fit through the highs (for a bull flag's falling edge) or the lows (for a bear flag's rising edge) of every bar since the staff ended. This produces one slope value that updates each bar as more data arrives.
Direction and steepness constraints — the edge's slope must run opposite to the staff (negative for a bull flag, positive for a bear flag) and must be shallower than the staff's own slope by a configurable ratio (default 60%). A flag that slopes as steeply as its pole is not behaving like a consolidation.
Width cap — the vertical distance between the tracked high and low extremes of the edge cannot exceed a percentage of the staff's height (default 60%). This is measured in absolute price distance, not bar count, so a slow-forming edge and a fast-forming edge are held to the same physical size constraint.
Breakout confirmation — the pattern is not finalized as soon as it meets minimum criteria. It keeps extending, bar by bar, for as long as price stays inside the channel. Confirmation only happens when price closes beyond the channel boundary by a configurable ATR buffer, in the direction that continues the original staff move (upward for a bull flag, downward for a bear flag). This means the edge is drawn at its full, longest actual duration rather than being cut short at an arbitrary minimum.
Envelope construction — once a pattern confirms, the two boundary lines are built by taking the regression-fitted line and shifting it by the maximum deviation observed on each side across every bar in the edge. The upper boundary is shifted up by the largest high-to-line distance seen; the lower boundary is shifted down by the largest line-to-low distance seen. Both lines share the identical slope, so they are parallel by construction, and together they contain the full price range of the consolidation rather than only touching two points.
█ VISUALS
The staff is drawn with a glow layer behind a sharp core line, color-coded green for bull and red for bear. The edge channel is filled with a soft translucent tint between its two boundary lines. A label at the breakout point shows the staff's height in ATR units, the edge's duration in bars, and the channel's width in ATR units.
█ SETTINGS
Staff
• Min Staff Height (×ATR) — minimum impulsive move size relative to ATR
• Min/Max Staff Duration (bars) — bounds on how many bars the staff can span
• Max Opposite-Direction Bars — structural wick-overlap tolerance
• Min Straightness (R²) — how closely the staff must fit a straight line
Edge
• Min Bars Before Breakout Eligible — minimum edge duration before a breakout can confirm
• Max Edge Duration (bars) — safety cap; abandons the pattern if no breakout occurs in time
• Max Channel Width (% of Staff Height) — absolute-distance cap on the edge's vertical size
• Max Edge Slope (× staff slope) — how much shallower the edge must be than the staff
• Min Edge Slope (×ATR per bar) — minimum slope magnitude so the edge counts as genuinely sloped
• Breakout Buffer (×ATR) — margin required beyond the boundary to confirm a breakout
█EXAMPLE ( DAILY APPLE STOCK )
█ NOTES
Because confirmation only happens at breakout, the pattern appears on the chart once the move has already resumed — this script identifies completed flag-and-breakout structures for review and study, not an early-warning signal before the breakout occurs. Works on any timeframe; behavior depends on how the ATR-based thresholds interact with the instrument's typical volatility.
However (!), with the ATR Breakout setting, it is possible to set a lower value, and by doing so we might "anticipate" Flag Development and consequent Breakout.
█ DISCLAIMER
This is a pattern visualization tool. It does not generate trade signals and does not constitute financial advice. Historical pattern detection does not guarantee that similar structures will behave the same way in the future. Wskaźnik
