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

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

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

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

مؤشر

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

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

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

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

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

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

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

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

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

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

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

OBV Signal Confluence [MarkitTick]💡 This advanced technical utility provides a comprehensive evaluation of market momentum by synthesizing cumulative volume flow with structural trend dynamics and dynamic support levels. Designed for rigorous market analysis, it evaluates directional shifts by demanding strict confluence across multiple dimensions, including momentum divergence, historical trend validation, and volatility expansion. Rather than relying on isolated price action, this tool builds a holistic profile of market participation, delivering a complete framework for structured trade management and robust signal verification.
● ✨ Originality and Utility
Most traditional momentum oscillators evaluate price velocity in a vacuum, completely ignoring the underlying participation required to sustain a trend. This utility stands apart by merging volume-weighted momentum with strict filtering mechanisms to evaluate the true strength of a market move. By integrating a multi-tiered filtration system, it effectively isolates high-probability directional shifts while filtering out low-participation market noise.
The utility is entirely self-contained, projecting dynamic trade management levels directly onto the chart when momentum alignment is confirmed. It seamlessly bridges the gap between raw data analysis and actionable trade management. By establishing precise entry, invalidation, and multiple target zones based on current market volatility, it transforms raw volume data into a structured operational blueprint.
Furthermore, the inclusion of a comprehensive heads-up display ensures that all underlying metrics—from momentum strength to historical trend states—are continuously aggregated and visually accessible, allowing for rapid contextual assessment without cluttering the primary analytical workspace.
● 🔬 Methodology and Concepts
This tool operates on a sophisticated, multi-layered evaluative engine. To protect the integrity of the underlying architecture, the methodology is described conceptually:
Cumulative Volume Flow: The primary engine evaluates the continuous flow of market volume, categorizing buying and selling pressure based on specific price action thresholds. This cumulative data is then smoothed against a dynamic, user-selectable baseline to establish the core momentum trajectory.
Higher Timeframe Confluence: To prevent acting on insignificant intraday fluctuations, the engine references the structural momentum of a higher timeframe. Signals are strictly gated unless the localized momentum aligns with this broader, macro-level directional bias.
Momentum Divergence Detection: The utility continuously scans for structural discrepancies between price pivot extremes and the corresponding extremes in the volume flow. When price establishes new structural boundaries without validating volume participation, the system flags these areas as potential exhaustion or reversal zones.
Volatility and Participation Filters: Trend strength and volume ratios are continuously measured against established historical averages. The engine requires both a minimum threshold of directional strength and a surge in relative volume participation to validate any momentum shift, ensuring that structural breaks are supported by actual market activity.
Dynamic Risk Profiling: Upon signal confirmation, the tool automatically calculates an invalidation level utilizing a multiplier of the underlying asset's average true volatility. Profit targets are then extrapolated from this established risk parameter, ensuring that every projected setup adheres to strict, predefined risk-to-reward ratios.
● 🎨 Visual Guide
The visual interface is designed to provide immediate contextual awareness while maintaining a clean charting environment:
Momentum Histogram: Plotted as columns, this visualizes the delta between the cumulative volume flow and its dynamic baseline. Color intensity shifts dynamically to reflect both the direction and the immediate acceleration or deceleration of the momentum.
Heat Candles: When enabled, this feature overrides the native chart candles, painting the price action to match the underlying volume momentum state, allowing for rapid visual confirmation of the current trend environment.
Divergence Markers: Distinct upward and downward triangular shapes are plotted directly on the chart to indicate areas where structural price action has diverged from the supporting volume flow.
Trade Management Levels: Upon a confirmed momentum shift, dashed horizontal lines appear to project the Entry, Stop Loss (SL), and three tiered Take Profit (TP) zones.
Risk/Reward Shading: Shaded background zones visually map the risk parameters, contrasting the invalidation zone against the projected reward territory to provide an immediate assessment of the trade's structural viability.
Heads-Up Dashboard: A customizable table anchored to the chart corner. It provides a real-time aggregate readout of all critical internal metrics, including current trend state, raw momentum values, divergence status, participation ratios, and active trade progression percentages.
● 📖 How to Use
Establish Context: Monitor the Heads-Up Dashboard to evaluate the current macro trend state and participation ratios. Wait for the dashboard to indicate alignment between directional momentum, volume participation, and trend strength.
Identify Confluence: Look for structural momentum shifts indicated by the histogram crossing its zero-line, strictly validated by the alignment of the Heat Candles. Divergence markers appearing prior to these shifts serve as early warning signs of an impending structural rotation.
Signal Confirmation: Wait for the current bar to close. The utility is engineered to execute calculations on confirmed data to ensure structural stability. A confirmed signal will instantly plot the dynamic trade management levels.
Execute and Manage: Utilize the projected Entry, Stop Loss, and Take Profit levels to structure your position. The Risk/Reward shading and the progress tracker on the dashboard will provide continuous feedback as the price action develops toward the established targets.
Alert Integration: For automated tracking, configure the built-in alert conditions which generate structured data payloads for long entries, short entries, position closures, and individual target strikes.
● ⚙️ Inputs and Settings
Core: Define the source data for momentum calculations and select the preferred baseline calculation method and lookback length. This also includes the pivot length for divergence detection.
Filters: Activate and calibrate the higher timeframe alignment constraints. Set the specific lengths and minimum thresholds for directional strength and volume participation multipliers to strictly define what constitutes a valid breakout.
Trade: Toggle the visibility of the dynamic management levels. Adjust the volatility lookback, the invalidation multiplier, and customize the exact risk-to-reward ratios for all three projected profit targets.
Vis: Control the visual clutter by toggling the histogram, zero line, divergence signals, and heat candles on or off according to personal preference.
Dash: Enable or disable the Heads-Up Dashboard and anchor it to any of the four chart corners for optimal workspace organization.
Alerts: Define custom action strings and dynamic payload identifiers to integrate seamlessly with external execution engines or tracking software.
Colors: Fully customize the aesthetic profile of the indicator. Modify the specific hex values and opacities for the histogram states, trade levels, risk shading, divergence markers, and the internal dashboard elements to match your charting theme.
● 🔍 Deconstruction of the Underlying Scientific and Academic Framework
The foundation of this utility is deeply rooted in the principles of Auction Market Theory and the Law of Effort versus Result. In any financial market, price discovery is driven by the continuous auction process between buyers and sellers. However, price alone is a one-dimensional metric. Volume represents the actual energy or "effort" expended to move that price. By systematically analyzing the relationship between price displacement and volume flow, this tool effectively maps the true liquidity absorption within the market.
When a market establishes a new structural price extreme, fundamental market mechanics dictate that this move must be supported by an equivalent expansion in volume participation. If the aggregate volume flow begins to decelerate while price continues to advance, a structural divergence is formed. This indicates a severe lack of liquidity supporting the current auction, highlighting an area where the prevailing trend is highly vulnerable to mean reversion or a complete structural failure.
Furthermore, the integration of volatility-based risk profiling adheres to established quantitative risk management principles. Market volatility is not static; it constantly expands and contracts in cyclical phases. By anchoring invalidation levels to a dynamic multiplier of average true volatility, the utility ensures that risk parameters adapt to the current market environment. This prevents premature invalidation during periods of high liquidity expansion while maintaining tight structural constraints during periods of market consolidation.
⚠️ 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. مؤشر

Trend Pulse MSL Trend Pulse is a comprehensive indicator designed to analyze the current market regime, buying and selling pressure, and the strength of completed bullish and bearish waves.
The indicator is built around three interconnected calculation components:
Predictive Balance — a predictive market-equilibrium level.
Pressure Pulse — an oscillator measuring current directional pressure.
Wave Memory — a system for evaluating completed bullish and bearish pressure waves.
Each component has a distinct purpose, but none of them operates independently. The output of one calculation block becomes an input for the next, creating a single integrated market-state model.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎯 What the indicator is designed to answer
MSL Trend Pulse helps traders evaluate five questions in sequence:
What directional market regime is currently active?
Which side is applying more pressure: buyers or sellers?
Is current pressure aligned with the broader Bias or moving against it?
How strong is the current pressure?
Is that pressure strengthening, fading, expanding, cooling, or becoming overheated?
This is not a mechanical entry-and-exit system and not a simple collection of several standard indicators placed in one script.
MSL Trend Pulse was designed as a unified analytical model in which:
Predictive Balance identifies the price regime;
Pressure Pulse measures current directional pressure;
Wave Memory evaluates the strength of completed waves;
Dashboard combines the results into a readable market-state interpretation.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🧠 Why these components are combined
Predictive Balance estimates a dynamic market-equilibrium level and the direction in which that equilibrium is moving.
The movement of Predictive Balance and the distance between price and the balance level are then used as inputs in the calculation of Pressure Pulse.
Pressure Pulse determines:
the direction of current pressure;
the intensity of that pressure;
the beginning of a new pressure wave;
the completion of the previous pressure wave.
Completed pressure sequences are passed to Wave Memory.
Wave Memory separately maintains reference strength for:
bullish waves;
bearish waves.
These reference values are used to calculate the slower-moving market Bias.
Each component therefore adds a different layer of information:
Predictive Balance describes the price regime;
Pressure Pulse describes current pressure;
Wave Memory describes the historical wave context;
Dashboard provides the final interpretation.
Standard Pine Script functions, including ATR and EMA, are used only for volatility normalization and smoothing.
They are not used as standalone trade signals and do not form a conventional moving-average crossover system.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚖️ Predictive Balance
Predictive Balance is a recursive level-and-drift model.
The calculation uses a weighted price source:
Price Source = (High + Low + 2 × Close) / 4
The closing price receives additional weight because Close represents the final price accepted during the current period.
The indicator then measures directional path efficiency over the selected Direction Window.
Path efficiency compares:
the net distance between the beginning and end of the calculation window;
the total absolute path traveled by price during the same period.
High path efficiency
Price moved consistently and predominantly in one direction.
Low path efficiency
Price traveled through a large number of alternating movements but made relatively little net progress.
The resulting efficiency value controls how quickly Predictive Balance reacts.
The model first projects the next balance level by:
taking the previous balance value;
adding the previously estimated directional drift.
It then calculates the prediction error: the difference between the projected level and the current weighted price.
This prediction error updates two elements simultaneously:
the current Predictive Balance level;
the direction and speed of the drift.
As a result, the line can:
react faster during efficient directional movement;
become more stable during noisy or sideways conditions;
account not only for the position of price, but also for the direction of its own estimated movement.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔺 Market regime changes
The market regime does not change simply because price touches or briefly crosses Predictive Balance.
An adaptive confirmation zone is calculated around the balance line using:
current ATR;
directional path efficiency;
the base band width;
the selected level of noise protection.
During irregular or inefficient price movement, the zone becomes wider.
During consistent directional movement, the zone can become narrower.
Bullish regime confirmation
A bullish regime change requires both conditions:
price closes above the upper boundary of the adaptive zone;
Predictive Balance drift is positive.
Bearish regime confirmation
A bearish regime change requires both conditions:
price closes below the lower boundary of the adaptive zone;
Predictive Balance drift is negative.
This state-retention logic reduces frequent bullish and bearish switches around the balance line.
A green upward-pointing triangle marks a confirmed transition into a bullish regime.
A red downward-pointing triangle marks a confirmed transition into a bearish regime.
The triangles represent changes in the calculated regime. They are not standalone recommendations to buy or sell an asset.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 Pressure Pulse
Pressure Pulse measures current directional pressure using four interconnected price characteristics.
1. Candle body pressure — 35%
The distance between Open and Close is normalized by ATR.
This component measures the directional displacement of the candle relative to current market volatility.
2. Closing-location pressure — 25%
Close is evaluated relative to the candle’s full High–Low range.
A close near the High increases positive pressure.
A close near the Low increases negative pressure.
A close near the middle of the range produces a more neutral reading.
3. Predictive Balance movement — 25%
The change in Predictive Balance is normalized by ATR.
This component reflects the direction and speed of the estimated equilibrium level.
4. Price stretch — 15%
The distance between Close and Predictive Balance is normalized by ATR.
This component measures how far price has extended from the estimated market equilibrium.
After the four components are combined, the result passes through an adaptive pressure-memory process.
In noisy market conditions
Pressure memory becomes shorter, allowing weak and irregular pressure to decay more quickly.
In directional market conditions
Pressure memory becomes longer, allowing persistent pressure to remain visible for a longer period.
The accumulated result is then:
normalized against its own recent average amplitude;
smoothed;
softly compressed to maintain a comparable visual scale across different instruments and timeframes.
Reading the histogram
Above zero — bullish pressure is dominant.
Below zero — bearish pressure is dominant.
Rising bars — directional pressure is increasing.
Shrinking bars — directional pressure is fading.
High amplitude — strong normalized pressure.
Low amplitude — weak pressure.
Pressure Pulse does not reset when price crosses Predictive Balance.
This makes it possible to follow the development of pressure independently of a single price-to-line crossover.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🌊 Wave Memory
Wave Memory analyzes completed sequences of bullish and bearish pressure.
Beginning of a bullish wave
A bullish wave begins when Pressure Pulse moves above the positive Wave Deadband boundary.
Beginning of a bearish wave
A bearish wave begins when Pressure Pulse moves below the negative Wave Deadband boundary.
The neutral area around zero prevents every small histogram fluctuation from creating a new wave.
For each completed wave, the script calculates:
average absolute pressure;
peak absolute pressure;
duration in bars;
price-path efficiency.
Price-path efficiency compares:
the net price movement from the beginning to the end of the wave;
the total absolute price path traveled during that wave.
If price moved predominantly in one direction, efficiency will be high.
If the wave contained substantial movement but produced little net price change, efficiency will be low.
The final wave-strength calculation incorporates:
70% average pressure;
30% peak pressure;
the square root of wave duration;
an adjustment for price-path efficiency.
Bullish and bearish waves update separate historical reference values.
A newly completed wave does not immediately replace the previous reference. Instead, it gradually updates the corresponding reference according to the Reference Update setting.
This process creates a more stable wave-based Bias.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🧭 Dashboard
The Dashboard displays four characteristics of the current market state:
Phase — the relationship between current pressure and Bias.
Magnitude — the current strength of Pressure Pulse.
Bias — the relative strength of completed bullish and bearish waves.
State — the current development stage of directional pressure.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Phase — market phase
Bullish Impulse
Bullish pressure is aligned with bullish Bias.
Current movement supports the broader bullish wave context.
Bearish Impulse
Bearish pressure is aligned with bearish Bias.
Current movement supports the broader bearish wave context.
Bullish Pullback
Bullish pressure is developing against bearish Bias.
This may represent a corrective movement within a broader bearish context.
Bearish Pullback
Bearish pressure is developing against bullish Bias.
This may represent a corrective decline within a broader bullish context.
Bullish Pressure
Bullish pressure is active, but completed waves have not yet established a clear directional Bias.
Bearish Pressure
Bearish pressure is active, but completed waves have not yet established a clear directional Bias.
Balanced
Pressure Pulse remains inside the neutral deadband, so meaningful directional pressure is not currently present.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Magnitude — pressure strength
Magnitude is based on the absolute value of the current normalized Pressure Pulse:
Weak — below 0.40.
Normal — from 0.40 to 0.85.
Strong — from 0.85 to 1.30.
Extreme — 1.30 and above.
Magnitude measures the current intensity of pressure. It does not represent the probability of a future move and does not predict how far price may travel.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Bias — wave direction
Bullish
Completed bullish waves are stronger on average than completed bearish waves.
Bearish
Completed bearish waves are stronger on average than completed bullish waves.
Neutral
Neither side has established sufficient relative dominance.
Bias is calculated from completed pressure waves and therefore intentionally changes more slowly than Pressure Pulse.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
State — pressure development
Building
Pressure is increasing while Bias remains neutral.
Fading
Pressure is decreasing while Bias remains neutral.
Expansion
Pressure is aligned with a directional Bias and continues to increase.
Cooling
Pressure is moving against Bias or is beginning to lose strength.
Overheated
Pressure has reached an extreme level but has already started to weaken.
Balanced
No meaningful directional-pressure state is currently present.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📌 How to use the indicator
A practical analysis sequence is:
Identify the active regime using the color of Predictive Balance and the most recent triangle.
Review Bias to determine which side has produced stronger completed waves.
Use Phase to determine whether current pressure supports Bias or represents a counter-move.
Use Magnitude to evaluate the current intensity of pressure.
Use State to determine whether pressure is strengthening or losing momentum.
Example 1
Bullish Bias + Bullish Impulse + Expansion
Bullish pressure supports the broader bullish wave context and continues to strengthen.
Example 2
Bullish Bias + Bearish Pullback + Cooling
Bearish pressure is developing against bullish Bias, but the counter-move is losing strength.
Example 3
Bearish Bias + Bullish Pullback + Cooling
Bullish pressure is present against the broader bearish context but has begun to weaken.
Example 4
Neutral Bias + Bullish Pressure + Building
Bullish pressure is increasing, but completed waves have not yet established a sustained advantage for buyers.
Possible applications
MSL Trend Pulse can be used for:
market-regime confirmation;
pullback analysis;
current momentum assessment;
evaluating alignment between current pressure and Bias;
filtering trading scenarios;
monitoring the strengthening and weakening of directional movement.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔔 Alerts
The indicator includes four alert conditions:
MSL Bull Flip — a transition into a bullish regime has been confirmed.
MSL Bear Flip — a transition into a bearish regime has been confirmed.
MSL Pressure Up — Pressure Pulse crossed above zero.
MSL Pressure Down — Pressure Pulse crossed below zero.
When Confirm Flips On Bar Close is enabled, regime changes and corresponding alerts are confirmed only after the candle closes.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚙️ Main settings
Direction Window
Controls the period used to measure directional path efficiency.
Minimum Reaction / Maximum Reaction
Define the lower and upper limits of Predictive Balance reaction speed.
Drift Learning
Controls how quickly the model learns changes in market direction and movement speed.
Drift Damping
Controls how quickly previously estimated drift loses its influence.
Volatility Length
Defines the ATR period used for volatility normalization.
Flip Band Base
Sets the minimum width of the adaptive regime-confirmation zone.
Noise Protection
Widens the regime-change zone during noisy or inefficient market movement.
Normalisation Length
Defines the period used to normalize Pressure Pulse against its own recent amplitude.
Pulse Smoothing
Controls the final smoothing applied to the Pressure Pulse histogram.
Minimum Memory / Maximum Memory
Define the lower and upper limits of pressure persistence.
Wave Deadband
Defines the neutral zone used to separate bullish and bearish pressure waves.
Reference Update
Controls how strongly each completed wave updates its corresponding historical reference.
Minimum Wave Bars
Defines the minimum wave duration required before a completed wave can update Wave Memory.
Window
Allows wave statistics to use all available chart history or begin from a selected date.
Reactive Candles
Colors candles according to the direction and intensity of Pressure Pulse.
Glow Effect / Glow Intensity
Control the visual glow applied to Predictive Balance and the Pressure Pulse histogram.
These settings affect presentation only. They do not change calculations, regime logic, or alerts.
Dashboard Position
Allows the Dashboard to be placed in the upper-right, middle-right, or lower-right area of the chart.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠️ Calculation behavior and limitations
The indicator does not use future bars.
Values on closed historical candles remain fixed after those candles are completed.
Values on the active candle may change before it closes because High, Low, and Close are not yet final.
Bias is based on completed waves and therefore reacts more slowly than Pressure Pulse.
During the early stage of a reversal, Bias may temporarily retain its previous direction.
Sudden gaps and news-driven candles can cause rapid changes in Predictive Balance and Pressure Pulse.
Results may be less stable on low-liquidity instruments.
Indicator behavior depends on the instrument, volatility environment, and selected timeframe.
MSL Trend Pulse does not calculate:
position size;
stop-loss placement;
profit targets;
acceptable trade risk;
mechanical entry or exit points.
The indicator is designed to analyze market context. No individual Dashboard state, line color, triangle, or histogram reading should be interpreted as a guaranteed forecast of future price movement. مؤشر

Machine Learning Neural Network EngineMachine Learning Neural Network Engine turns complex Daily market behavior into three clear states: LONG, WATCH and CASH.
Instead of relying on one fixed trend signal, the indicator combines an adaptive neural network, continuous model validation and an independent crisis detector. The result is a simple visual interface backed by a fully causal machine-learning process.
HOW IT WORKS
At its core is a compact 6-5-1 neural network trained directly on the chart.
It analyzes six normalized features:
Short- and medium-term trend structure
RSI momentum
Deviation from linear regression
Directional price efficiency
Relative volatility
Candle pressure adjusted by relative volume
The network learns sequentially from completed market outcomes. On each confirmed Daily bar, it can only train on information from an earlier bar whose result has become known. Current predictions never use future data.
Training uses nonlinear neurons, RMS-scaled gradient updates, error clipping and regularization. This is an adaptive online model, not a set of fixed coefficients labelled as machine learning.
SELF-AUDITING MACHINE LEARNING
The neural network is continuously compared with an independent structural trend model.
When the network’s matured predictions provide useful additional information, its influence increases. When its recent error becomes worse than the structural baseline, its influence is automatically reduced.
This live validation mechanism prevents the indicator from trusting its machine-learning component unconditionally.
CRISIS DETECTION
A separate stress engine monitors:
Rapid 10-day declines
Drawdown from the 63-day high
Abnormal ATR expansion
Long-term price structure
This layer can trigger a defensive state independently of the neural model, helping the indicator respond to sudden market deterioration.
HOW TO READ IT
LONG — Green
The model, trend structure and confirmation rules support a constructive market environment.
WATCH — Amber
The market remains structurally LONG, but risk or exit evidence is increasing.
CASH — Red
The environment is defensive because of persistent weakness or confirmed crisis stress. The indicator never takes short positions.
The colored neural axis and surrounding halo display the active state without covering the chart with labels. Transition pulses identify confirmed changes, while the dashboard shows bull probability, neural risk and the current machine-learning audit.
WHAT MAKES IT DIFFERENT
The script integrates four distinct functions:
1. Online neural-network learning
2. Live error-based model validation
3. Independent downside-stress detection
4. A confirmed state machine designed to limit excessive switching
These components are not combined as a simple indicator vote. Each has a separate role in learning, validation, protection or state stabilization.
SETTINGS
ML response controls adaptation speed and signal stability:
Fast reacts sooner.
Balanced is the recommended starting point.
Smooth prioritizes stability.
ML selectivity controls how much evidence is required before LONG or CASH is confirmed.
The indicator is designed exclusively for standard Daily charts.
BUILT-IN COMPARISON
The dashboard includes a lagged long/cash comparison with buy-and-hold. It applies the selected transition cost and openly displays periods when the model underperforms.
This comparison is a diagnostic tool, not a complete strategy backtest. It does not include every possible spread, slippage, tax, financing or execution constraint.
IMPORTANT LIMITATIONS
The bull probability is an internal normalized score, not a statistically calibrated probability of profit. The model can react late, generate false transitions in sideways markets and cannot eliminate gap risk.
The developing Daily bar may change before closing. Confirmed historical states use no future data, no lookahead and no higher-timeframe security calls.
This indicator provides market context, not financial advice or guaranteed performance. Online learning does not imply future outperformance.
مؤشر

Chart Patterns [FEELS]Classical chart patterns, drawn only after price confirms them, each one carrying a running count of how often that pattern has reached its measured target on this chart.
No pattern appears until its neckline breaks. Once drawn, it never moves.
FEATURES
- Four classical reversal patterns: Double Top, Double Bottom, Head & Shoulders, Inverse Head & Shoulders
- Confirmed-only: a pattern is drawn after its neckline breaks, not while it is still forming
- Non-repaint: once drawn, the geometry never changes
- Measured target and neckline plotted for every pattern
- Live per-pattern hit-rate table: how often each type reached its target on the current chart
- Target-reached and invalidated outcomes marked on the chart
- ATR-based tolerances that adapt to each symbol
- Close or wick neckline confirmation, optional weaker-second-peak filter
- Four alerts, fully adjustable colors, labels and text
WHAT IT DETECTS
Four of the most widely taught reversal patterns: Double Top, Double Bottom, Head & Shoulders, and Inverse Head & Shoulders. Each is built from confirmed swing pivots, so the shape on the chart is the same shape a trader would draw by hand.
HOW IT WORKS
The engine keeps a zigzag of confirmed swing highs and lows and checks the most recent pivots against each pattern template: two equal tops over a shared low for a Double Top, a higher head between two level shoulders for Head & Shoulders, and so on. A candidate is not shown yet. It is only drawn once price breaks through the neckline, which is the point at which the pattern is considered complete. From that bar the geometry is locked.
- Neckline: the line the pattern breaks. Horizontal for double tops and bottoms, sloped through the two inner pivots between the shoulders and the head for Head & Shoulders and its inverse.
- Measured target: the pattern height projected from the break, drawn as a dotted line. This is the standard textbook objective, not a forecast.
- Outcome tracking: after a pattern confirms, the script follows it for a set number of bars to see whether price reached the measured target, closed back past the pattern, or did neither in time. All three outcomes feed the table.
- Hit-rate table: for every pattern type it shows how many confirmed patterns reached their target, out of every pattern that has finished tracking, as a running count on the current symbol and timeframe. Head & Shoulders reaching target less often than a Double Bottom is information, not a defect.
HOW TO READ IT
1. Wait for the break. A shape only appears after the neckline gives way, so what you see is a completed pattern, not a guess about one still forming.
2. Use the table as context. A pattern type that has historically reached its target often on this chart carries more weight than one that rarely has. The sample size is shown next to the percentage so you can judge how much to trust it.
3. The measured target is the reference objective. A pattern is only marked invalidated when price closes back past its own extreme, the high of a double top or the right shoulder of a head and shoulders, so the invalidation mark sits at that level rather than at the neckline. How you act on either is your decision.
ORIGINALITY
This script waits for the neckline break before drawing anything, locks the geometry once a pattern is drawn, and keeps a live per-pattern tally of how each one resolved on the chart you are looking at. The idea is to combine the shape a trader would draw by hand with a running record of what happened after that shape completed, on this exact symbol and timeframe. The zigzag, the pattern templates, the neckline construction and the outcome tracking are written from scratch for this script.
HONESTY
- A swing pivot confirms only after the Swing size number of bars, so a pattern appears on the chart once its break is confirmed, and its earlier points are drawn back to where they occurred. On a bar replay this looks like a shape appearing into the past. That is the cost of the no-repaint rule, not a glitch. After a pattern is drawn its position never changes, and the break is evaluated on bar close.
- The hit-rate table is a historical count on the current symbol and timeframe. Reaching target means price hit the measured objective within the tracking window; a pattern that neither reached target nor closed back past its extreme within that window counts against the rate, not as a skipped sample. Only patterns that reached target or invalidated print a mark on the chart, so a timed-out pattern is counted in the table but not tagged, and the visible marks are fewer than the table total. It describes what happened after past patterns, it does not predict future ones, and a small sample can move a lot. It is not a performance claim.
- Tolerances are ATR-based, so the definition of equal tops or a clean break adapts to each symbol's volatility instead of a fixed percentage.
- The tool is most useful on liquid symbols and on intraday-to-daily timeframes, where enough clean swings form. On very long histories only the most recent patterns stay drawn to keep the chart readable.
ALERTS
Bearish pattern confirmed · Bullish pattern confirmed · Target reached · Pattern invalidated.
SETTINGS
Every input has a tooltip. The main ones: "Swing size" sets how many bars on each side define a swing, "Neckline break" chooses close or wick confirmation, "Second peak / bottom" can require the classic weaker-second-peak form, "Patterns kept" caps how many stay on the chart, and the table, colors, outcome text and both text sizes are all adjustable.
This is a descriptive tool for reading classical chart patterns. It is not financial advice and does not predict price. مؤشر

FVG Sweep Magnet Engine [PhenLabs]📊 FVG Sweep Magnet Engine
Version: PineScript™ v6
📌 Description
The FVG Sweep Magnet Engine turns displacement-born Fair Value Gaps into scored magnetic targets that only arm after a real liquidity sweep. Instead of treating every imbalance as tradeable, FSME waits for buy-side or sell-side liquidity to be raided, then confirms when price is pulled back into a high-quality FVG.
This solves the two biggest failure modes retail ICT tools create: trading empty gaps with no context, and chasing sweeps that never reclaim structure. Neon multi-layer magnet beams, graded gap boxes, and a live regime dashboard make the confluence readable in one glance — built for dark-chart screenshots and fast decision-making on futures, indices, FX, and crypto.
🚀 Points of Innovation
Displacement-validated FVG detection filters out micro-noise gaps that never attract price
Liquidity sweep gate (BSL/SSL raid + rejection) must print before any magnet signal arms
0–10 quality score blends gap size, displacement strength, freshness, and volume impulse
Clean visual hierarchy: soft FVG zones + single CE midline by default; neon only on MAG
Partial-fill fade and full mitigation cleanup keep the chart honest as gaps get consumed
Live FSME dashboard tracks bias, live gaps, best score, sweep state, and last signal
🔧 Core Components
Displacement FVG Engine: Detects classic 3-candle bullish/bearish imbalances only when the middle candle body clears an ATR displacement threshold and the gap clears a minimum ATR size filter
Liquidity Rail Tracker: Maintains confirmed swing BSL/SSL pools as dotted rails and classifies wick-rejection raids that reclaim the level
Magnet Confluence Gate: Arms a signal only when a fresh sweep window overlaps a live scored FVG that price re-enters with directional close confirmation
Target Projector: Extends dotted neon target rays from the FVG midline by ATR multiple after a magnet print
Regime Dashboard: Compact top-right table summarizing bull/bear FVG count, best score, sweep state, last signal, nearest magnet mid, and ATR
🔥 Key Features
Non-repaint pivot liquidity and confirmed-bar FVG logic suitable for alerts and live trading
Configurable displacement, gap size, magnet window, min score, and target extension
Bull cyan / bear magenta neon palette with independent fill, border, rail, and beam colors
Optional faded mitigated FVGs for study mode, or hard-delete cleanup for clean charts
Alertconditions for bull/bear magnets, BSL/SSL sweeps, and new displacement FVGs
Works as a standalone SMC overlay or confluence layer on top of session/order-block tools
🎨 Visualization
FVG zones: Soft teal/red translucent boxes (high transparency so candles stay readable) with score on the right edge
CE midline: Single thin dashed line at the gap center — no permanent multi-layer beam cage
Neon on MAG only: Triple glow beam + TP ray appear only when a magnet signal arms
MAG labels: Clear ▲ MAG / ▼ MAG tags offset above/below the bar (not stacked on wicks)
Optional extras (off by default): liquidity rails and sweep diamonds for power users
Signal highlight: Soft bar tint only on confirmed MAG bars
Dashboard: Compact 6-row panel — Bias, Live Gaps, Best Score, Sweep, Last Signal
📖 Usage Guidelines
Max Active FVGs — Default: 10 — Range: 2-40 — Keep low for a clean chart
Displacement ATR Mult — Default: 1.25 — Range: 0.3-5.0 — Raise on noisy lower TFs
Min Gap Size (ATR) — Default: 0.25 — Range: 0.05-3.0 — Higher = fewer, cleaner zones
Require Displacement Candle — Default: true — Keep on for quality
Max FVG Age (bars) — Default: 60 — Range: 10-300 — Expires stale magnets
Magnet Window — Default: 18 — Range: 3-80 — Bars after a sweep for FVG entry confirm
Min Score for Signal — Default: 5 — Range: 0-10 — Raise to 7+ for selective setups
Show FVG Midline (CE) — Default: true — Single dashed CE line per zone
Neon Beam Only on MAG — Default: true — Neon appears only on confirmed signals
Show Liquidity Rails — Default: false — Optional; off keeps chart readable
Show Sweep Diamonds — Default: false — Optional; off by default to reduce noise
✅ Best Use Cases
ICT/SMC traders waiting for liquidity raids into unfilled FVGs instead of blind gap fades
Intraday index and futures traders (ES, NQ, YM) on 1m–15m seeking clean reversal confluence
FX and crypto traders mapping displacement legs during London/NY expansion
Prop-style discretionary traders who want scored setups with explicit invalidation (full gap fill)
Content creators capturing high-contrast neon dark-chart screenshots for TradingView publish art
⚠️ Limitations
FVG detection is geometric (3-candle imbalance) and does not use true order-book data
Sweep logic uses confirmed swing pivots, so very fresh local highs/lows need pivot length bars to register
High-volatility news spikes can create large displacement gaps that score well but fail if context is one-way trend
Neon beams and boxes are object-limited; extreme settings (max FVGs + long age) can hit TradingView object caps
This is a confluence overlay, not a complete strategy — always pair with risk rules and higher-timeframe bias
💡 What Makes This Unique
Sweep-gated magnets: FVGs stay passive until liquidity is actually raided — reverse of “every gap is a signal” tools
Scored gaps: Traders see why a zone matters (size, displacement, age, volume) instead of binary boxes
Signal-first visuals: zones stay quiet until confluence arms — neon and TP only on MAG
PhenLabs DNA: Liquidity + engine naming + dashboard, fused with this week’s dominant FVG/ICT community demand
🔬 How It Works
Displacement scan: On each bar the engine checks for a 3-candle bullish or bearish FVG, requires the middle candle body to clear ATR × displacement mult, and rejects gaps smaller than ATR × min gap size
Score + draw: Qualifying gaps receive a 0–10 score and are rendered as translucent boxes with a three-layer neon midline beam and optional score label
Liquidity map: Confirmed pivot highs/lows become BSL/SSL rails; a sweep prints when price raids the level with sufficient wick and closes back through it
Magnet arming: For a limited bar window after the sweep, if price re-enters a live same-direction FVG that clears the min score and closes in the reclaim direction, a MAG signal fires
Projection + lifecycle: Dotted ATR targets extend from the magnet mid; partial fills fade the box, full fills or max age invalidate the gap and clean objects unless faded mode is enabled
💡 Note:
Use FSME as a visual decision-support layer for liquidity-to-imbalance workflows. Confirm higher-timeframe bias, define risk beyond the opposite side of the FVG or swept pool, and never treat magnet markers as guaranteed entries. This script is an analytical aid only and does not constitute financial advice.
مؤشر

Swing Trade Scanner Setup Grade and VerdictGrades the stock on your chart as a long swing setup — a 0–100 score, an A+ to D grade, and a plain-English verdict.
You've found a stock. Is it actually a setup? Swing Trade Scanner grades the chart in front of you the way a swing trader reads it — trend, momentum, relative strength, volume — and gives you one honest answer: a score, a grade, and a verdict in plain English.
It works on its own — nothing else required.
Why one score instead of five separate indicators?
Every check in this script exists on its own — but alone, each one whipsaws. What makes a swing setup is confluence: trend, momentum, proximity to highs, relative strength, and volume confirming each other at the same time.
The Scanner's contribution is the weighting and the interaction between the checks: MA alignment counts most because trend is what pays swing traders, and the extension penalty can override an otherwise perfect score — because the same chart that grades well near the fast MA is a bad entry 8% above it. That interaction is what a stack of separate indicators won't show you.
What goes into the score (0–100)
Five checks, each weighted by how much it matters:
MA alignment (up to 35 pts) — is price stacked cleanly above the 4-MA ribbon? A full bull stack (price > fast MA > each slower MA) earns full points.
Momentum (up to 20) — how far price has moved over the lookback (60 bars by default).
Distance from the recent high (up to 20) — leaders sit near their highs; a stock 10% below its high has repair work to do first.
Relative strength vs SPY (up to 15) — is the stock beating the market (SPY = S&P 500 ETF), not just rising with it?
Volume (up to 10) — is it trading above its 20-day average?
Then one guardrail: the extension penalty . More than 6% above the fast MA and the score gets docked (−12 points, −20 past 10%). Chasing a stretched chart is how good setups become bad entries — the Scanner won't grade one highly.
The verdict reads in plain English
HIGH QUALITY (score 75+) — everything lined up.
MODERATE (55–74) — decent, not complete.
WEAK (40–54) — most of the checklist is missing.
AVOID (under 40) — not a long setup right now.
EXTENDED / WAIT — the setup grades well BUT price is stretched more than 6% above the fast MA. Good stock, bad moment. Let it pull in.
What you see on the chart
The 4-MA ribbon — four moving averages (EMA 20 / 50 / 100 / 200 by default; EMA, SMA or WMA), with the zone between the two fastest shaded green in an uptrend, red in a downtrend.
Candle coloring (optional) — green in a full bull stack, teal in a partial one, red in a full bear stack, so the trend state reads at a glance.
The dashboard — grade + score up top, then the four core metrics (MA Alignment, 60-bar Momentum, RS vs SPY, Volume Ratio) and the Verdict row.
Long setups only
This tool grades the long (buy) side. On a downtrending chart it won't invent an opportunity — it shows Full Bear and AVOID and tells you to look elsewhere.
Settings — defaults work out of the box
MA ribbon — four lengths, MA type, and colors.
Lookback (60 bars) — the window for momentum, relative strength, and the recent high.
Volume MA length (20).
Table position, text size, dark/light theme, and status colors.
⚠ Educational tool for reading and grading charts. The grade measures how complete a setup is by these rules — it does not generate buy/sell signals or predict price. Not financial advice. مؤشر

ICT Kill Zone Sniper [JOAT]═══ ICT KILL ZONE SNIPER ⚡ ═══
A session-aware sniper tool that paints every candle by its active kill zone, tracks the liquidity pool each session leaves behind, and fires a single clean BUY or SELL only after price sweeps the prior pool and reverses back inside the current kill zone. Built for traders who wait for the liquidity grab, not the breakout.
▎ WHAT IT DOES
It splits the trading day into four classic kill zones — Asia , London , NY-AM and NY-PM — colors the candles inside each one, and records the high and low that every finished session builds. Those prior highs/lows become the liquidity pools hunted in the next window. When the current kill zone reaches into one of those pools and then closes back through it, the tool marks the sweep and projects a full trade: entry, ATR stop, and an R-based target zone.
▎ HOW IT WORKS
• Kill-zone clock — each session window is evaluated in a chosen wall-clock timezone (New York by default). Membership is na-guarded, so it behaves correctly on any intraday timeframe and simply idles on higher timeframes.
• Session state machine — while a kill zone is live, the tool expands that session's running high and low. When the session ends, that high/low is frozen as the prior liquidity pool and drawn as dashed projection lines carried into the next window.
• Sweep + reversal detection — a high sweep needs price to trade above the prior pool high yet close back below it; a low sweep needs a dip below the prior pool low with a close back above. A Min Sweep Depth (× ATR) filter rejects micro-penetrations caused by spread and tick noise.
• Confirmation — sweeps can be evaluated on confirmed bar close only, so signals do not repaint intrabar. At most one long and one short can print per kill-zone occurrence when the one-per-side lock is on.
• Optional HTF bias — a higher-timeframe EMA (requested with lookahead off) can gate direction: longs only above it, shorts only below it.
• Trade projection — on a valid signal the stop is placed beyond the swept extreme plus an ATR buffer, risk is measured from entry to stop, and the target is set at your chosen R multiple. Reward and risk are drawn as tinted zone boxes with entry/SL/TP lines and level labels.
• Optional VWAP — a session-anchored VWAP with a ±σ band is available as extra context.
▎ HOW TO USE IT
• Wait for a BUY or SELL pill to print inside a colored kill zone — it means the prior pool was swept and price reversed back through it.
• The green zone box is the reward leg toward the R-target; the red zone box is the risk leg to the stop. The label pill shows the session and the R multiple.
• Use the dashed prior high/low lines as the liquidity being hunted this session — signals cluster around them.
• Treat the HTF bias as a directional filter and the sweep tags as confirmation that liquidity was actually taken before you commit.
• Combine with your own structure read; the tool marks the setup, you manage the trade.
▎ KEY SETTINGS
• Kill Zones — timezone plus editable session windows for Asia, London, NY-AM and NY-PM.
• Signal Engine — ATR length, confirm-on-close, one-signal-per-side lock, and minimum sweep depth.
• HTF Bias — toggle, higher timeframe, and EMA length.
• Trade Model — stop buffer beyond the sweep, risk/reward target in R, projection length, and how many past signals to keep.
• Visuals — candle tinting and transparency, session boxes, pools, sweep tags, signal labels, SL/TP lines and zone boxes, VWAP bands, and label size.
• Dashboard — show/hide, position, and text size.
▎ DASHBOARD
A cyberpunk chrome-gradient panel reporting the active session , current session high/low , a countdown to the next kill zone , the HTF bias state, the last liquidity grab side, the active signal with bars-since, the last entry , its stop / target , the current ATR , and a running long / short signal tally .
▎ ALERTS
• KZ Sniper Long — prior-pool low sweep plus bullish reversal inside a kill zone.
• KZ Sniper Short — prior-pool high sweep plus bearish reversal inside a kill zone.
▎ NOTES
• Works across assets; the session logic is intended for intraday timeframes and idles on higher ones.
• Confirm-on-close keeps signals non-repainting; the HTF EMA is requested with lookahead off.
• Nearly every visual has a toggle, so you can strip it down to just the candles and signals for a clean chart.
• Any on-chart tallies reflect historical signals only.
For research and education only. This is not financial advice. No indicator can predict the future, and past behavior does not guarantee future results. Always manage your own risk.
Made with passion by JackOfAllTrades ⚡ مؤشر
