Volume Profile on Grid with Zscore ColoringThis indicator takes (DeadCatCode) volume profile and starts a new profile when price reaches a new Grid Interval, chosen in the settings.
The candles are also colored by Z score (colors pulled from ChartPrime) based on the 5 deviations from the Daily TWAP, which is anchored from previous days settlement time, 14:59:30CT. The max number of deviations can be changed in the settings to change the sensitivity of the z score coloring.
Indicateurs et stratégies
Cold Brew Ranges🧭 Core Logic and Calculation
The fundamental logic for each range (OR and CR) is identical:
Time Definition: Each range is defined by a specific Start Time and a fixed 30-second duration. The timestamp function, using the "America/New_York" time zone, is used to calculate the exact start time in Unix milliseconds for the current day.
Example: t0200 = timestamp(TZ, yC, mC, dC, 2, 0, 0) sets the start time for the 02:00 OR to 2:00:00 AM NY time.
Range Data Collection: The indicator uses the request.security_lower_tf() function to collect the High (hArr) and Low (lArr) prices of all bars that fall within the defined 30-second window, using a user-specified, sub-chart-timeframe (openrangetime, defaulted to "1" second, "30S", or "5" minutes). This ensures high precision in capturing the exact high and low during the 30-second window.
High/Low Determination: It iteratively finds the absolute highest price (OR_high) and the absolute lowest price (OR_low) recorded by the bars during that 30-second window.
Range Locking: Once the current chart bar's time (lastTs) passes the 30-second End Time (tEnd), the High and Low are locked (OR_locked = true), meaning the range calculation is complete for the day.
Drawing: Upon locking, the range is drawn on the chart using line.new for the High, Low, and Equilibrium, and box.new for the shaded fill. The lines are extended to a subsequent time anchor point (e.g., the 02:00 OR is extended to 08:20, the 09:30 OR is extended to 16:00).
Equilibrium (EQ): This is calculated as the simple average (midpoint) of the High and Low of the range.
EQ=
2
OR_High+OR_Low
⏰ Defined Trading Ranges
The indicator defines and tracks the following specific 30-second ranges:
Range Name Type Start Time (NY) Line Extension End Time (NY) Common Market Context
02:00 OR Opening 02:00:00 08:20:00 Asian/European Market Overlap
08:20 OR Opening 08:20:00 16:00:00 Pre-New York Open
09:30 OR Opening 09:30:00 16:00:00 New York Stock Exchange Open (Most significant OR)
18:00 OR Opening 18:00:00 20:00:00 Futures Market Open (Sunday/Monday)
20:00 OR Opening 20:00:00 Next Day's session start Asian Session Start
15:50 CR Closing 15:50:00 20:00:00 New York Close Range
⚙️ Key User Inputs and Customization
The script offers extensive control over which ranges are displayed and how they are visualized:
Range Time & History
openrangetime: Sets the sub-timeframe (e.g., "1" for 1 second) used to calculate the precise High/Low of the 30-second range. Crucial for accuracy.
showHistory: A toggle to show the ranges from previous days (up to a histCap of 50 days).
Range Toggles and Styling
On/Off Toggles: Independent input.bool (e.g., OR_0200_on) to enable or disable the display of each individual range.
Colors & Width: Separate color and width inputs for the High/Low lines (hlC), the Equilibrium line (eqC), and the background fill (fillC) for each range.
Line Styles: Global inputs for the line styles of High/Low (lineStyleInput) and Equilibrium (eqLineStyleInput) lines (Solid, Dotted, or Dashed).
showFill: Global toggle to enable the shaded background box that highlights the area between the High and Low.
Extensions
The script calculates and plots extensions (multiples of the initial range) above the High and below the Low.
showExt: Toggles the visibility of the extension lines.
useRangeMultiples: If true, the step size for each extension level is equal to the initial range size:
Step=Range=OR_High−OR_Low
If false, the step size is a fixed value defined by stepPts (e.g., 60.0 points, which is a common value for NQ futures).
stepCnt: Determines how many extension levels (multiples) are drawn above and below the range (default is 10).
📈 Trading Strategy Implications
The Cold Brew Ranges indicator is a tool for session-based support and resistance and range breakout/reversal strategies.
Key Support/Resistance: The High and Low of these defined opening ranges often act as strong, predefined price levels. Traders look for price rejection off these boundaries or a breakout with conviction.
Equilibrium (Midpoint): The EQ often represents a fair value for that specific session's opening. Movements away from it are seen as opportunities, and a return to it is common.
Extensions: The range extensions serve as potential profit targets or stronger, layered support/resistance levels if the market trends aggressively after the opening range is set.
The core idea is that the activity in the first 30 seconds of a significant trading session (like the NYSE or a market session open) sets a bias and initial boundary for the trading period that follows.
MeanReversion_tradeALERTOverview The Apex Reversal Predictor v2.5 is a specialized mean reversion strategy designed for scalping high-volatility assets like NQ (Nasdaq), ES (S&P 500), and Crypto. While most indicators chase breakouts, this system hunts for "Liquidity Sweeps"—moments where the market briefly breaks a key level to trap retail traders before snapping back to the true value (VWAP).
This is not just a signal indicator; it is a full Trade Manager that calculates your Entry, Stop Loss, and Take Profit levels automatically based on volatility (ATR).
The Logic: Why This Works Markets act like a rubber band. They can only stretch so far from their average price before snapping back. This script combines three layers of logic to identify these snap-back points:
The Stretch (Sigma Score): Measures how far price is from the VWAP relative to ATR. If the score > 2.0, the "rubber band" is overextended.
The Trap (Liquidity Sweep): Identifies Pivot Highs/Lows. It waits for price to break a pivot (luring in breakout traders) and then immediately reverse (trapping them).
The Exhaustion (RSI): Confirms that momentum is Overbought/Oversold to prevent trading against a strong trend.
Key Features
Dynamic Lines: Automatically draws Blue (Entry), Red (SL), and Green (TP) lines on the chart for active trades.
Smart Targets: Two modes for taking profit:
Mean Reversion: Targets the VWAP line (High Win Rate).
Fixed Ratio: Targets a specific Risk:Reward (e.g., 1:2).
Live Dashboard: Tracks Win Rate, Net Points, and the live "Stretch Score" in the bottom right corner.
Alert Ready: Formatted JSON alerts for easy integration with Discord or trading bots.
How & When to Use (User Guide)
1. Best Timeframes
5-Minute (5m): Best for NQ and volatile stocks (TSLA, NVDA). Filters out 1-minute noise but catches the intraday reversals.
15-Minute (15m): Best for Forex or slower-moving indices (ES).
2. The Setup Checklist Before taking a trade, look at the Dashboard in the bottom right:
Step 1: Check the "Stretch (Sigma)". Is it Orange or Red? This means price is extended and ripe for a reversal. If it's Green, the market is calm—be careful.
Step 2: Wait for the Signal.
"Apex BUY" (Green Label): Price swept a low and closed green.
"Apex SELL" (Red Label): Price swept a high and closed red.
Step 3: Execute. Enter at the close of the signal candle. Set your stop loss at the Red Line provided by the script.
3. Warning / When NOT to Use
Strong Trending Days: If the market is trending heavily (e.g., creating higher highs all day without looking back), do not fight the trend.
News Events: Avoid using this during CPI, FOMC, or NFP releases. The "rubber band" logic breaks during news because volatility expands indefinitely.
Open Interest RSI [BackQuant]Open Interest RSI
A multi-venue open interest oscillator that aggregates OI across major derivatives exchanges, converts it to coin or USD terms, and runs an RSI-style engine on that aggregated OI so you can track positioning pressure, crowding, and mean reversion in leverage flows, not just in price.
What this is
This tool is an RSI built on top of aggregated open interest instead of price. It pulls futures OI from several major exchanges, converts it into a unified unit (COIN or USD), sums it into a single synthetic OI candle, then applies RSI and smoothing to that combined series.
You can then render that Open Interest RSI in different visual modes:
Clean line or colored line for classic oscillator-style reads.
Column-style oscillator for impulse and compression views.
Flag mode that fills between OI RSI and its EMA for trend/mean reversion blends. See:
Heatmap mode that paints the panel based on OI RSI extremes, ideal for scanning. See:
On top of that it includes:
Aggregated OI source selection (Binance, Bybit, OKX, Bitget, Kraken, HTX, Deribit).
Choice of OI units (COIN or USD).
Reference lines and OB/OS zones.
Extreme highlighting for either trend or mean reversion.
A vertical OI RSI meter that acts as a quick strength gauge.
Aggregated open interest source
Under the hood, the indicator builds a synthetic open interest candle by:
Looping over a list of supported exchanges: Binance, Bybit, OKX, Bitget, Kraken, HTX, Deribit.
Looping over multiple contract suffixes (such as USDT.P, USD.P, USDC.P, USD.PM) to capture different contract types on each venue.
Requesting OI candles from each venue + contract combination for the same underlying symbol.
Converting each OI stream into a common unit: In COIN mode, everything is normalized into coin-denominated OI. In USD mode, coin OI is multiplied by price to approximate notional OI.
Summing up open, high, low and close of OI across venues into a single aggregated OI candle.
If no valid OI is available for the current symbol across all sources, the script throws a clear runtime error so you know you are on an unsupported market.
This gives you a single, exchange-agnostic open interest curve instead of being tied to one venue. That aggregated OI is then passed into the RSI logic.
How the OI RSI is calculated
The RSI side is straightforward, but it is applied to the aggregated OI close:
Compute a base RSI of aggregated OI using the Calculation Period .
Apply a simple moving average of length Smoothing Period (SMA) to reduce noise in the raw OI RSI.
Optionally apply an EMA on top of the smoothed OI RSI as a moving average signal line.
Key parameters:
Calculation Period – base RSI length for OI.
Smoothing Period (SMA) – extra smoothing on the RSI value.
EMA Period – EMA length on the smoothed OI RSI.
The result is:
oi_rsi – raw RSI of aggregated OI.
oi_rsi_s – SMA-smoothed OI RSI.
ma – EMA of the smoothed OI RSI.
Thresholds and extremes
You control three core thresholds:
Mid Point – central reference level, typically 50.
Extreme Upper Threshold – high-level OI RSI edge (for example 80).
Extreme Lower Threshold – low-level OI RSI edge (for example 20).
These thresholds are used for:
Reference lines or OB/OS zone fills.
Heatmap gradient bounds.
Background highlighting of extremes.
The Extreme Highlighting mode controls how extremes are interpreted:
None – do nothing special in extreme regions.
Mean-Rev – background turns red on high OI RSI and green on low OI RSI, framing extremes as contrarian zones.
Trend – background turns green on high OI RSI and red on low OI RSI, framing extremes as participation zones aligned with the prevailing move.
Reference lines and OB/OS zones
You can choose:
None – clean plotting without guides.
Basic Reference Lines – mid, upper and lower thresholds as simple gray horizontals.
OB/OS Levels – filled zones between:
Upper OB: from the upper threshold to 100, colored with the short/overbought color.
Lower OS: from 0 to the lower threshold, colored with the long/oversold color.
These guides help visually anchor the OI RSI within "normal" versus "extreme" regions.
Plotting modes
The Plotting Type input controls how OI RSI is drawn. All modes share the same underlying OI and RSI logic, but emphasise different aspects of the signal.
1) Line mode
This is the classic oscillator representation:
Plots the smoothed OI RSI as a simple line using RSI Line Color and RSI Line Width .
Optionally plots the EMA overlay on the same panel.
Works well when you want standard RSI-style signals on leverage flows: crosses of the midline, divergences versus price, and so on.
2) Colored Line mode
In this mode:
The OI RSI is plotted as a line, but its color is dynamic.
If the smoothed OI RSI is above the mid point, it uses the Long/OB Color .
If it is below the mid point, it uses the Short/OS Color .
This creates an instant visual regime switch between "bullish positioning pressure" and "bearish positioning pressure", while retaining the feel of a traditional RSI line.
3) Oscillator mode
Oscillator mode renders OI RSI as vertical columns around the mid level:
The smoothed OI RSI is plotted as columns using plot.style_columns .
The histogram base is fixed at 50, so bars extend above and below the mid line.
Bar color is dynamic, using long or short colors depending on which side of the mid point the value sits.
This representation makes impulse and compression in OI flows more obvious. It is especially useful when you want to focus on how quickly OI RSI is expanding or contracting around its neutral level. See:
4) Flag mode
Flag mode turns OI RSI and its EMA into a two-line band with a filled area between them:
The smoothed OI RSI and its EMA are both plotted.
A fill is drawn between them.
The fill color flips between the long color and the short color depending on whether OI RSI is above or below its EMA.
Black outlines are added to both lines to make the band clear against any background.
This creates a "flag" style region where:
Green fills show OI RSI leading its EMA, suggesting positive positioning momentum.
Red fills show OI RSI trailing below its EMA, suggesting negative positioning momentum.
Crossovers of the two lines can be read as shifts in OI momentum regime.
Flag mode is useful if you want a more structural view that combines both the level and slope behaviour of OI RSI. See:
5) Heatmap mode
Heatmap mode recasts OI RSI as a single-row gradient instead of a line:
A single row at level 1 is plotted using column style.
The color is pulled from a gradient between the lower and upper thresholds: Near the lower threshold it approaches the short/oversold color and near the upper threshold it approaches the long/overbought color.
The EMA overlay and reference lines are disabled in this mode to keep the panel clean.
This is a very compact way to track OI RSI state at a glance, especially when stacking it alongside other indicators. See:
OI RSI vertical meter
Beyond the main plot, the script can draw a small "thermometer" table showing the current OI RSI position from 0 to 100:
The meter is a two-column table with a configurable number of rows.
Row colors form an inverted gradient: red at the top (100) and green at the bottom (0).
The script clamps OI RSI between 0 and 100 and maps it to a row index.
An arrow marker "▶" is drawn next to the row corresponding to the current OI RSI value.
0 and 100 labels are printed at the ends of the scale for orientation.
You control:
Show OI RSI Meter – turn the meter on or off.
OI RSI Blocks – number of vertical blocks (granularity).
OI RSI Meter Position – panel anchor (top/bottom, left/center/right).
The meter is particularly helpful if you keep the main plot in a small panel but still want an intuitive strength gauge.
How to read it as a market pressure gauge
Because this is an RSI built on aggregated open interest, its extremes and regimes speak to positioning pressure rather than price alone:
High OI RSI (near or above the upper threshold) indicates that open interest has been increasing aggressively relative to its recent history. This often coincides with crowded leverage and a buildup of directional pressure.
Low OI RSI (near or below the lower threshold) indicates aggressive de-leveraging or closing of positions, often associated with flushes, forced unwinds or post-liquidation clean-ups.
Values around the mid point indicate more balanced positioning flows.
You can combine this with price action:
Price up with rising OI RSI suggests fresh leverage joining the move, a more persistent trend.
Price up with falling OI RSI suggests shorts covering or longs taking profit, more fragile upside.
Price down with rising OI RSI suggests aggressive new shorts or levered selling.
Price down with falling OI RSI suggests de-leveraging and potential exhaustion of the move.
Trading applications
Trend confirmation on leverage flows
Use OI RSI to confirm or question a price trend:
In an uptrend, rising OI RSI with values above the mid point indicates supportive leverage flows.
In an uptrend, repeated failures to lift OI RSI above mid point or persistent weakness suggest less committed participation.
In a downtrend, strong OI RSI on the downside points to aggressive shorting.
Mean reversion in positioning
Use thresholds and the Mean-Rev highlight mode:
When OI RSI spends extended time above the upper threshold, the crowd is extended on one side. That can set up squeeze risk in the opposite direction.
When OI RSI has been pinned low, it suggests heavy de-leveraging. Once price stabilises, a re-risking phase is often not far away.
Background colours in Mean-Rev mode help visually identify these periods.
Regime mapping with plotting modes
Different plotting modes give different perspectives:
Heatmap mode for dashboard-style use where you just need to know "hot", "neutral" or "cold" on OI flows at a glance.
Oscillator mode for short term impulses and compression reads around the mid line. See:
Flag mode for blending level and trend of OI RSI into a single banded visual. See:
Settings overview
RSI group
Plotting Type – None, Line, Colored Line, Oscillator, Flag, Heatmap.
Calculation Period – base RSI length for OI.
Smoothing Period (SMA) – smoothing on RSI.
Moving Average group
Show EMA – toggle EMA overlay (not used in heatmap).
EMA Period – length of EMA on OI RSI.
EMA Color – colour of EMA line.
Thresholds group
Mid Point – central reference.
Extreme Upper Threshold and Extreme Lower Threshold – OB/OS thresholds.
Select Reference Lines – none, basic lines or OB/OS zone fills.
Extreme Highlighting – None, Mean-Rev, Trend.
Extra Plotting and UI
RSI Line Color and RSI Line Width .
Long/OB Color and Short/OS Color .
Show OI RSI Meter , OI RSI Blocks , OI RSI Meter Position .
Open Interest Source
OI Units – COIN or USD.
Exchange toggles: Binance, Bybit, OKX, Bitget, Kraken, HTX, Deribit.
Notes
This is a positioning and pressure tool, not a complete system. It:
Models aggregated futures open interest across multiple centralized exchanges.
Transforms that OI into an RSI-style oscillator for better comparability across regimes.
Offers several visual modes to match different workflows, from detailed analysis to compact dashboards.
Use it to understand how leverage and positioning are evolving behind the price, to gauge when the crowd is stretched, and to decide whether to lean with or against that pressure. Attach it to your existing signals, not in place of them.
Also, please check out @NoveltyTrade for the OI Aggregation logic & pulling the data source!
Here is the original script:
Setup Keltner BandS MMS + RSI SIGNALS
📊 Keltner Bands with RSI Confirmation – TradingView Script
Introduction
This script combines Keltner Channel logic with Relative Strength Index (RSI) confirmation to provide traders with visual signals and alerts for potential reversals. It is designed for scalping and short-term trading strategies, where precision and quick decision-making are essential.
🔧 How It Works
• Keltner Bands (ATR-based):
• Two sets of bands are plotted around a moving average:
• Band 3 (ATR × 3) – more sensitive, suitable for aggressive entries.
• Band 5 (ATR × 5) – wider, used as a filter or confirmation zone.
• Signals are generated when the price crosses back inside the bands from outside.
• RSI Confirmation:
• RSI is calculated with a customizable period (default: 14).
• Overbought and oversold levels (default: 70/30) are used to filter signals.
• A bearish reversal is confirmed only if RSI is above the overbought level.
• A bullish reversal is confirmed only if RSI is below the oversold level.
📌 Functions and Features
• Visual Signals:
• Triangles plotted above/below candles for Keltner-only signals.
• Additional colored triangles for Keltner + RSI confirmed signals.
• Alerts:
• Configurable alerts for both Keltner-only and RSI-confirmed conditions.
• Messages include the type of reversal and the band level.
• Customizable Parameters:
• Moving average length.
• ATR multipliers (3 and 5).
• RSI length and thresholds.
• Colors for band fills and signals.
🎯 Usage
1. Apply the script to your chart in TradingView.
2. Adjust parameters to fit your trading style (scalping, intraday, swing).
3. Watch for signals:
• Red/green/orange/teal triangles → Keltner-only reversals.
• Maroon/lime/purple/blue triangles → RSI-confirmed reversals.
4. Set alerts to receive notifications when conditions are met.
5. Use RSI confirmation to filter out false signals and increase accuracy.
✅ Benefits
• Clear visualization of reversal zones.
• Dual-layer confirmation (Keltner + RSI).
• Flexible for different timeframes and trading styles.
• Ready-to-use alerts for automation or manual trading.
AlphaNatt | FINAL REVELATION [Visual God]AlphaNatt | The Final Revelation
"Where Information Theory meets Market Geometery."
The AlphaNatt is a comprehensive market structure and volumetric analysis suite designed for the institutional-grade trader. It merges advanced quantitative concepts—specifically Shannon Entropy and Neural Pattern Filtering—with a "Holographic" visual interface that prioritizes clarity over clutter.
This is not just an indicator; it is a complete decision-support system that answers three critical questions:
Is the market chaotic or ordered? (Entropy Engine)
Where is the liquidity? (Volumetric Heatmap)
What is the true structure? (Fractal Geometry)
🌌 The Gen 100 Math Engine
At the core of this script lies a unique implementation of Information Theory.
1. Shannon Entropy (The Chaos Filter)
Most indicators fail because they try to predict "Noise". This script calculates the Entropy (in Bits) of the recent price action.
High Entropy: The market is in a "Random Walk" state. Visuals fade out, transparency increases, and signals are suppressed.
Low Entropy: The market is "Ordered" and approaching a singularity/decision point. Visuals glow brightly to indicate a high-probability environment.
2. Neural Pattern Recognition
The diamond signals (Cyan/Magenta) are not simple simple crossovers. They are driven by a composite logic simulating a neural filter:
Inputs: Normalised RSI + Momentum Divergence + Volatility State.
Logic: Signals only trigger when the market is statistically overextended AND showing signs of momentum decay.
💎 Holographic Features
🔥 Volumetric Heatmap
The script scans historical price action to build a Volume Profile Heatmap on the right side of the chart.
Purple/Blue Zones: These represent High Volume Nodes (HVNs). These act as "Gravity Wells" for price—often stopping trends or acting as launchpads for reversals.
POC (Point of Control): The bright green line indicates the price level with the absolute highest volume in the lookback period.
🌀 Fractal Structure Lines
Price action is often noisy. The script uses a Fractal Pivot Algorithm (Length 5) to identify the "True Highs" and "True Lows".
It connects these points with dashed "Neural Lines" to show the naked market skeleton.
This instantly reveals if you are in a trend of Higher Highs or a breakdown of Lower Lows.
🖥️ The Heads-Up Display (HUD)
A minimalist dashboard keeps you informed of the math underneath:
ENTROPY: The raw bit-score of market chaos.
REGIME: Tells you instantly if you are in "ORDER" (Tradeable) or "CHAOS" (Sit out).
STRUCT: Real-time status of the fractal structure (Breakout/Breakdown/Ranging).
⚙️ Settings & Configuration
Theme: Choose between "Cyber" (Neon), "Aeon" (Deep Blue), or "Gold" (Luxury).
Max Entropy: Adjust the sensitivity of the Chaos Filter. Lower values = stricter filtering (fewer trades).
Heatmap Depth: Control how far back the volume profile scans.
⚠️ Disclaimer
This tool is designed for educational market analysis. "Entropy" and "Neural" refer to the mathematical algorithms used to process price data and do not guarantee future performance. Always manage risk responsible.
Liquidation Heatmap [Alpha Extract]A sophisticated liquidity zone visualization system that identifies and maps potential liquidation levels based on swing point analysis with volume-weighted intensity measurement and gradient heatmap coloring. Utilizing pivot-based pocket detection and ATR-scaled zone heights, this indicator delivers institutional-grade liquidity mapping with dynamic color intensity reflecting relative liquidity concentration. The system's dual-swing detection architecture combined with configurable weight metrics creates comprehensive liquidation level identification suitable for strategic position planning and market structure analysis.
🔶 Advanced Pivot-Based Pocket Detection
Implements dual swing width analysis to identify potential liquidation zones at pivot highs and lows with configurable lookback periods for comprehensive level coverage. The system detects primary swing points using main pivot width and optional secondary swing detection for increased pocket density, creating layered liquidity maps that capture both major and minor liquidation levels across extended price history.
🔶 Multi-Metric Weight Calculation Engine
Features flexible weight source selection including Volume, Range (high-low spread), and Volume × Range composite metrics for liquidity intensity measurement. The system calculates pocket weights based on market activity at pivot formation, enabling traders to identify which liquidation levels represent higher concentration of potential stops and liquidations with configurable minimum weight thresholds for noise filtering.
🔶 ATR-Based Zone Height Framework
Utilizes Average True Range calculations with percentage-based multipliers to determine pocket vertical dimensions that adapt to market volatility conditions. The system creates ATR-scaled bands above swing highs for short liquidation zones and below swing lows for long liquidation zones, ensuring zone heights remain proportional to current market volatility for accurate level representation.
🔶 Dynamic Gradient Heatmap Visualization
Implements sophisticated color gradient system that maps pocket weights to intensity scales, creating intuitive visual representation of relative liquidity concentration. The system applies power-law transformation with configurable contrast adjustment to enhance differentiation between weak and strong liquidity pockets, using cyan-to-blue gradients for long liquidations and yellow-to-orange for short liquidations.
🔶 Intelligent Pocket State Management
Features advanced pocket tracking system that monitors price interaction with liquidation zones and updates pocket states dynamically. The system detects when price trades through pocket midpoints, marking them as "hit" with optional preservation or removal, and manages pocket extension for untouched levels with configurable forward projection to maintain visibility of approaching liquidity zones.
🔶 Real-Time Liquidity Scale Display
Provides gradient legend showing min-max range of pocket weights with 24-segment color bar for instant liquidity intensity reference. The system positions the scale at chart edge with volume-formatted labels, enabling traders to quickly assess relative strength of visible liquidation pockets without numerical clutter on the main chart area.
🔶 Touched Pocket Border System
Implements visual confirmation of executed liquidations through border highlighting when price trades through pocket zones. The system applies configurable transparency to touched pocket borders with inverted slider logic (lower values fade borders, higher values emphasize them), providing clear historical record of liquidated levels while maintaining focus on active untouched pockets.
🔶 Dual-Swing Density Enhancement
Features optional secondary swing width parameter that creates additional pocket layer with tighter pivot detection for increased liquidation level density. The system runs parallel pivot detection at both primary and secondary swing widths, populating chart with comprehensive liquidity mapping that captures both major swing liquidations and intermediate level clusters.
🔶 Adaptive Pocket Extension Framework
Utilizes intelligent time-based extension that projects untouched pockets forward by configurable bar count, maintaining visibility as price approaches potential liquidation zones. The system freezes touched pocket right edges at hit timestamps while extending active pockets dynamically, creating clear distinction between historical liquidations and forward-projected active levels.
🔶 Weight-Based Label Integration
Provides floating labels on untouched pockets displaying volume-formatted weight values with dynamic positioning that follows pocket extension. The system automatically manages label lifecycle, creating labels for new pockets, updating positions as pockets extend, and removing labels when pockets are touched, ensuring clean chart presentation with relevant liquidity information.
🔶 Performance Optimization Framework
Implements efficient array management with automatic clean-up of old pockets beyond lookback period and optimized box/label deletion to maintain smooth performance. The system includes configurable maximum object counts (500 boxes, 50 labels, 100 lines) with intelligent removal of oldest elements when limits are approached, ensuring consistent operation across extended timeframes.
This indicator delivers sophisticated liquidity zone analysis through pivot-based detection and volume-weighted intensity measurement with intuitive heatmap visualization. Unlike simple support/resistance indicators, the Liquidation Heatmap combines swing point identification with market activity metrics to identify where concentrated liquidations are likely to occur, while the gradient color system instantly communicates relative liquidity strength. The system's dual-swing architecture, configurable weight metrics, ATR-adaptive zone heights, and intelligent state management make it essential for traders seeking strategic position planning around institutional liquidity levels across cryptocurrency, forex, and futures markets. The visual heatmap approach enables instant identification of high-probability reversal zones where cascading liquidations may trigger significant price reactions.
Advanced Breakout SystemAdvanced Breakout System
Developed by: Mohammed Bedaiwi
This script hunts for high-probability breakouts by combining price consolidation zones, volume spikes vs. average volume, smart money flow (OBV), and a Momentum Override for explosive moves that skip consolidation. Additionally, it automatically identifies and plots Support and Resistance levels with price labels to help you visualize market structure.
The system follows a "Watch & Confirm" logic: it first prints a WATCH setup, then a BUY only if price confirms strength.
🔑 Color Legend (Visual Guide)
🟡 WATCH – Setup (Yellow Arrow Down) :
Potential breakout setup detected. Monitor the stock and do not enter yet. Triggered when price breaks out of a recent consolidation with strong volume or makes a big momentum move (e.g. >5%) in a single bar.
🟢 BUY – Confirmation (Green Arrow Up) :
Confirmed breakout. Consider entering a long position according to your own rules. Triggered when price trades above the high of the WATCH candle.
🟠 SELL – Break (Orange Arrow) :
Short-term trend weakness. Triggered when price closes below the Fast EMA (9). Used as a protective exit or partial profit-taking.
🔴 SELL – Dump (Dark Red Arrow) :
Distribution / volume dump. Triggered by a bearish candle with abnormally high volume compared to the average (e.g. ≥ Dump Volume Multiplier × average volume).
🟣 SELL – Pattern (Purple Arrow) :
Bearish price-action pattern (such as a bearish engulfing). Indicates a possible top or reversal.
🔴/🟢 Support & Resistance Lines :
Small horizontal lines plotted at key swing points. Red Line: Resistance (Swing High). Green Line: Support (Swing Low). Both include exact price labels for quick reference.
⚙️ Inputs
Entry settings: Consolidation Lookback (default 20) = bars used to detect consolidation. Consolidation Range % (default 12%) = max allowed range size; higher values make the script more sensitive. Volume Spike Multiplier (default 1.2) = factor above average volume to count as a spike. Force Signal on Big Moves (default ON) = forces a WATCH signal if price jumps more than a set % (e.g. 5%) even without consolidation/OBV confirmation.
Exit settings: Enable Fast Exit (EMA 9) toggles the SELL – Break signal. Dump Volume Multiplier defines what counts as “dump” volume (e.g. 2× average).
Support & Resistance: Adjustable Pivot Left/Right bars allow you to control the sensitivity of the support and resistance lines.
⚠️ Disclaimer
Trading involves significant risk of loss. This script is for educational and informational purposes only and is not financial advice or a recommendation to buy or sell any asset. BUY and SELL signals are rule-based and derived from historical behavior and do not guarantee future performance. Always use your own analysis and risk management.
XAUUSD 1m SMC Zones (BOS + Flexible TP Modes + Trailing Runner)//@version=6
strategy("XAUUSD 1m SMC Zones (BOS + Flexible TP Modes + Trailing Runner)",
overlay = true,
initial_capital = 10000,
pyramiding = 10,
process_orders_on_close = true)
//━━━━━━━━━━━━━━━━━━━
// 1. INPUTS
//━━━━━━━━━━━━━━━━━━━
// TP / SL
tp1Pips = input.int(10, "TP1 (pips)", minval = 1)
fixedSLpips = input.int(50, "Fixed SL (pips)", minval = 5)
runnerRR = input.float(3.0, "Runner RR (TP2 = SL * RR)", step = 0.1, minval = 1.0)
// Daily risk
maxDailyLossPct = input.float(5.0, "Max daily loss % (stop trading)", step = 0.5)
maxDailyProfitPct = input.float(20.0, "Max daily profit % (stop trading)", step = 1.0)
// HTF S/R (1H)
htfTF = input.string("60", "HTF timeframe (minutes) for S/R block")
// Profit strategy (Option C)
profitStrategy = input.string("Minimal Risk | Full BE after TP1", "Profit Strategy", options = )
// Runner stop mode (your option 4)
runnerStopMode = input.string( "BE only", "Runner Stop Mode", options = )
// ATR trail settings (only used if ATR mode selected)
atrTrailLen = input.int(14, "ATR Length (trail)", minval = 1)
atrTrailMult = input.float(1.0, "ATR Multiplier (trail)", step = 0.1, minval = 0.1)
// Pip size (for XAUUSD: 1 pip = 0.10 if tick = 0.01)
pipSize = syminfo.mintick * 10.0
tp1Points = tp1Pips * pipSize
slPoints = fixedSLpips * pipSize
baseQty = input.float (1.0, "Base order size" , step = 0.01, minval = 0.01)
//━━━━━━━━━━━━━━━━━━━
// 2. DAILY RISK MANAGEMENT
//━━━━━━━━━━━━━━━━━━━
isNewDay = ta.change(time("D")) != 0
var float dayStartEquity = na
var bool dailyStopped = false
equityNow = strategy.initial_capital + strategy.netprofit
if isNewDay or na(dayStartEquity)
dayStartEquity := equityNow
dailyStopped := false
dailyPnL = equityNow - dayStartEquity
dailyPnLPct = dayStartEquity != 0 ? (dailyPnL / dayStartEquity) * 100.0 : 0.0
if not dailyStopped
if dailyPnLPct <= -maxDailyLossPct
dailyStopped := true
if dailyPnLPct >= maxDailyProfitPct
dailyStopped := true
canTradeToday = not dailyStopped
//━━━━━━━━━━━━━━━━━━━
// 3. 1H S/R ZONES (for direction block)
//━━━━━━━━━━━━━━━━━━━
htOpen = request.security(syminfo.tickerid, htfTF, open)
htHigh = request.security(syminfo.tickerid, htfTF, high)
htLow = request.security(syminfo.tickerid, htfTF, low)
htClose = request.security(syminfo.tickerid, htfTF, close)
// Engulf logic on HTF
htBullPrev = htClose > htOpen
htBearPrev = htClose < htOpen
htBearEngulf = htClose < htOpen and htBullPrev and htOpen >= htClose and htClose <= htOpen
htBullEngulf = htClose > htOpen and htBearPrev and htOpen <= htClose and htClose >= htOpen
// Liquidity sweep on HTF previous candle
htSweepHigh = htHigh > ta.highest(htHigh, 5)
htSweepLow = htLow < ta.lowest(htLow, 5)
// Store last HTF zones
var float htResHigh = na
var float htResLow = na
var float htSupHigh = na
var float htSupLow = na
if htBearEngulf and htSweepHigh
htResHigh := htHigh
htResLow := htLow
if htBullEngulf and htSweepLow
htSupHigh := htHigh
htSupLow := htLow
// Are we inside HTF zones?
inHtfRes = not na(htResHigh) and close <= htResHigh and close >= htResLow
inHtfSup = not na(htSupLow) and close >= htSupLow and close <= htSupHigh
// Block direction against HTF zones
longBlockedByZone = inHtfRes // no buys in HTF resistance
shortBlockedByZone = inHtfSup // no sells in HTF support
//━━━━━━━━━━━━━━━━━━━
// 4. 1m LOCAL ZONES (LIQUIDITY SWEEP + ENGULF + QUALITY SCORE)
//━━━━━━━━━━━━━━━━━━━
// 1m engulf patterns
bullPrev1 = close > open
bearPrev1 = close < open
bearEngulfNow = close < open and bullPrev1 and open >= close and close <= open
bullEngulfNow = close > open and bearPrev1 and open <= close and close >= open
// Liquidity sweep by previous candle on 1m
sweepHighPrev = high > ta.highest(high, 5)
sweepLowPrev = low < ta.lowest(low, 5)
// Local zone storage (one active support + one active resistance)
// Quality score: 1 = engulf only, 2 = engulf + sweep (we only trade ≥2)
var float supLow = na
var float supHigh = na
var int supQ = 0
var bool supUsed = false
var float resLow = na
var float resHigh = na
var int resQ = 0
var bool resUsed = false
// New resistance zone: previous bullish candle -> bear engulf
if bearEngulfNow
resLow := low
resHigh := high
resQ := sweepHighPrev ? 2 : 1
resUsed := false
// New support zone: previous bearish candle -> bull engulf
if bullEngulfNow
supLow := low
supHigh := high
supQ := sweepLowPrev ? 2 : 1
supUsed := false
// Raw "inside zone" detection
inSupRaw = not na(supLow) and close >= supLow and close <= supHigh
inResRaw = not na(resHigh) and close <= resHigh and close >= resLow
// QUALITY FILTER: only trade zones with quality ≥ 2 (engulf + sweep)
highQualitySup = supQ >= 2
highQualityRes = resQ >= 2
inSupZone = inSupRaw and highQualitySup and not supUsed
inResZone = inResRaw and highQualityRes and not resUsed
// Plot zones
plot(supLow, "Sup Low", color = color.new(color.lime, 60), style = plot.style_linebr)
plot(supHigh, "Sup High", color = color.new(color.lime, 60), style = plot.style_linebr)
plot(resLow, "Res Low", color = color.new(color.red, 60), style = plot.style_linebr)
plot(resHigh, "Res High", color = color.new(color.red, 60), style = plot.style_linebr)
//━━━━━━━━━━━━━━━━━━━
// 5. MODERATE BOS (3-BAR FRACTAL STRUCTURE)
//━━━━━━━━━━━━━━━━━━━
// 3-bar swing highs/lows
swHigh = high > high and high > high
swLow = low < low and low < low
var float lastSwingHigh = na
var float lastSwingLow = na
if swHigh
lastSwingHigh := high
if swLow
lastSwingLow := low
// BOS conditions
bosUp = not na(lastSwingHigh) and close > lastSwingHigh
bosDown = not na(lastSwingLow) and close < lastSwingLow
// Zone “arming” and BOS validation
var bool supArmed = false
var bool resArmed = false
var bool supBosOK = false
var bool resBosOK = false
// Arm zones when first touched
if inSupZone
supArmed := true
if inResZone
resArmed := true
// BOS after arming → zone becomes valid for entries
if supArmed and bosUp
supBosOK := true
if resArmed and bosDown
resBosOK := true
// Reset BOS flags when new zones are created
if bullEngulfNow
supArmed := false
supBosOK := false
if bearEngulfNow
resArmed := false
resBosOK := false
//━━━━━━━━━━━━━━━━━━━
// 6. ENTRY CONDITIONS (ZONE + BOS + RISK STATE)
//━━━━━━━━━━━━━━━━━━━
flatOrShort = strategy.position_size <= 0
flatOrLong = strategy.position_size >= 0
longSignal = canTradeToday and not longBlockedByZone and inSupZone and supBosOK and flatOrShort
shortSignal = canTradeToday and not shortBlockedByZone and inResZone and resBosOK and flatOrLong
//━━━━━━━━━━━━━━━━━━━
// 7. ORDER LOGIC – TWO PROFIT STRATEGIES
//━━━━━━━━━━━━━━━━━━━
// Common metrics
atrTrail = ta.atr(atrTrailLen)
// MINIMAL MODE: single trade, BE after TP1, optional trailing
// HYBRID MODE: two trades (Scalp @ TP1, Runner @ TP2)
// Persistent tracking
var float longEntry = na
var float longTP1 = na
var float longTP2 = na
var float longSL = na
var bool longBE = false
var float longRunEntry = na
var float longRunTP1 = na
var float longRunTP2 = na
var float longRunSL = na
var bool longRunBE = false
var float shortEntry = na
var float shortTP1 = na
var float shortTP2 = na
var float shortSL = na
var bool shortBE = false
var float shortRunEntry = na
var float shortRunTP1 = na
var float shortRunTP2 = na
var float shortRunSL = na
var bool shortRunBE = false
isMinimal = profitStrategy == "Minimal Risk | Full BE after TP1"
isHybrid = profitStrategy == "Hybrid | Scalp TP + Runner TP"
//━━━━━━━━━━ LONG ENTRIES ━━━━━━━━━━
if longSignal
if isMinimal
longEntry := close
longSL := longEntry - slPoints
longTP1 := longEntry + tp1Points
longTP2 := longEntry + slPoints * runnerRR
longBE := false
strategy.entry("Long", strategy.long)
supUsed := true
supArmed := false
supBosOK := false
else if isHybrid
longRunEntry := close
longRunSL := longRunEntry - slPoints
longRunTP1 := longRunEntry + tp1Points
longRunTP2 := longRunEntry + slPoints * runnerRR
longRunBE := false
// Two separate entries, each 50% of baseQty (for backtest)
strategy.entry("LongScalp", strategy.long, qty = baseQty * 0.5)
strategy.entry("LongRun", strategy.long, qty = baseQty * 0.5)
supUsed := true
supArmed := false
supBosOK := false
//━━━━━━━━━━ SHORT ENTRIES ━━━━━━━━━━
if shortSignal
if isMinimal
shortEntry := close
shortSL := shortEntry + slPoints
shortTP1 := shortEntry - tp1Points
shortTP2 := shortEntry - slPoints * runnerRR
shortBE := false
strategy.entry("Short", strategy.short)
resUsed := true
resArmed := false
resBosOK := false
else if isHybrid
shortRunEntry := close
shortRunSL := shortRunEntry + slPoints
shortRunTP1 := shortRunEntry - tp1Points
shortRunTP2 := shortRunEntry - slPoints * runnerRR
shortRunBE := false
strategy.entry("ShortScalp", strategy.short, qty = baseQty * 50)
strategy.entry("ShortRun", strategy.short, qty = baseQty * 50)
resUsed := true
resArmed := false
resBosOK := false
//━━━━━━━━━━━━━━━━━━━
// 8. EXIT LOGIC – MINIMAL MODE
//━━━━━━━━━━━━━━━━━━━
// LONG – Minimal Risk: 1 trade, BE after TP1, runner to TP2
if isMinimal and strategy.position_size > 0 and not na(longEntry)
// Move to BE once TP1 is touched
if not longBE and high >= longTP1
longBE := true
// Base SL: BE or initial SL
float dynLongSL = longBE ? longEntry : longSL
// Optional trailing after BE
if longBE
if runnerStopMode == "Structure trail" and not na(lastSwingLow) and lastSwingLow > longEntry
dynLongSL := math.max(dynLongSL, lastSwingLow)
if runnerStopMode == "ATR trail"
trailSL = close - atrTrailMult * atrTrail
dynLongSL := math.max(dynLongSL, trailSL)
strategy.exit("Long Exit", "Long", stop = dynLongSL, limit = longTP2)
// SHORT – Minimal Risk: 1 trade, BE after TP1, runner to TP2
if isMinimal and strategy.position_size < 0 and not na(shortEntry)
if not shortBE and low <= shortTP1
shortBE := true
float dynShortSL = shortBE ? shortEntry : shortSL
if shortBE
if runnerStopMode == "Structure trail" and not na(lastSwingHigh) and lastSwingHigh < shortEntry
dynShortSL := math.min(dynShortSL, lastSwingHigh)
if runnerStopMode == "ATR trail"
trailSLs = close + atrTrailMult * atrTrail
dynShortSL := math.min(dynShortSL, trailSLs)
strategy.exit("Short Exit", "Short", stop = dynShortSL, limit = shortTP2)
//━━━━━━━━━━━━━━━━━━━
// 9. EXIT LOGIC – HYBRID MODE
//━━━━━━━━━━━━━━━━━━━
// LONG – Hybrid: Scalp + Runner
if isHybrid
// Scalp leg: full TP at TP1
if strategy.opentrades > 0
strategy.exit("LScalp TP", "LongScalp", stop = longRunSL, limit = longRunTP1)
// Runner leg
if strategy.position_size > 0 and not na(longRunEntry)
if not longRunBE and high >= longRunTP1
longRunBE := true
float dynLongRunSL = longRunBE ? longRunEntry : longRunSL
if longRunBE
if runnerStopMode == "Structure trail" and not na(lastSwingLow) and lastSwingLow > longRunEntry
dynLongRunSL := math.max(dynLongRunSL, lastSwingLow)
if runnerStopMode == "ATR trail"
trailRunSL = close - atrTrailMult * atrTrail
dynLongRunSL := math.max(dynLongRunSL, trailRunSL)
strategy.exit("LRun TP", "LongRun", stop = dynLongRunSL, limit = longRunTP2)
// SHORT – Hybrid: Scalp + Runner
if isHybrid
if strategy.opentrades > 0
strategy.exit("SScalp TP", "ShortScalp", stop = shortRunSL, limit = shortRunTP1)
if strategy.position_size < 0 and not na(shortRunEntry)
if not shortRunBE and low <= shortRunTP1
shortRunBE := true
float dynShortRunSL = shortRunBE ? shortRunEntry : shortRunSL
if shortRunBE
if runnerStopMode == "Structure trail" and not na(lastSwingHigh) and lastSwingHigh < shortRunEntry
dynShortRunSL := math.min(dynShortRunSL, lastSwingHigh)
if runnerStopMode == "ATR trail"
trailRunSLs = close + atrTrailMult * atrTrail
dynShortRunSL := math.min(dynShortRunSL, trailRunSLs)
strategy.exit("SRun TP", "ShortRun", stop = dynShortRunSL, limit = shortRunTP2)
//━━━━━━━━━━━━━━━━━━━
// 10. RESET STATE WHEN FLAT
//━━━━━━━━━━━━━━━━━━━
if strategy.position_size == 0
longEntry := na
shortEntry := na
longBE := false
shortBE := false
longRunEntry := na
shortRunEntry := na
longRunBE := false
shortRunBE := false
//━━━━━━━━━━━━━━━━━━━
// 11. VISUAL ENTRY MARKERS
//━━━━━━━━━━━━━━━━━━━
plotshape(longSignal, title = "Long Signal", style = shape.triangleup,
location = location.belowbar, color = color.lime, size = size.tiny, text = "L")
plotshape(shortSignal, title = "Short Signal", style = shape.triangledown,
location = location.abovebar, color = color.red, size = size.tiny, text = "S")
Support & Resistance Auto-Detector by Rakesh Sharma📊 SUPPORT & RESISTANCE AUTO-DETECTOR
Automatically identifies and displays key price levels where traders make decisions. No more manual drawing - let the algorithm do the work!
✨ KEY FEATURES:
- Auto-detects Swing High/Low levels with strength rating
- Previous Day High/Low (PDH/PDL) - Most important intraday levels
- Previous Week High/Low (PWH/PWL) - Strong swing levels
- Previous Month High/Low (PMH/PML) - Major turning points
- Round Number levels (Psychological barriers)
- S/R Zones (Better than exact lines)
- Breakout/Breakdown alerts
- Live Dashboard with trade bias
🎯 PERFECT FOR:
Nifty, Bank Nifty, Stocks, Forex, Crypto - All markets, all timeframes
⚡ SMART FEATURES:
- Strength Rating: Very Strong/Strong/Medium/Weak
- Distance Calculator: Shows points to next S/R
- Trade Bias: "Buy Dips" / "Sell Rallies" / "Breakout"
- Break Alerts: Get notified on PDH/PDL breaks
- Clean Chart: Shows only most important levels
💡 TRADING EDGE:
Trade bounces at support, rejections at resistance, or breakouts through key levels. Combines perfectly with price action and other indicators.
Created by: Rakesh Sharma
Credit Spread RegimeThe Credit Market as Economic Barometer
Credit spreads are among the most reliable leading indicators of economic stress. When corporations borrow money by issuing bonds, investors demand a premium above the risk-free Treasury rate to compensate for the possibility of default. This premium, known as the credit spread, fluctuates based on perceptions of economic health, corporate profitability, and systemic risk.
The relationship between credit spreads and economic activity has been studied extensively. Two papers form the foundation of this indicator. Pierre Collin-Dufresne, Robert Goldstein, and Spencer Martin published their influential 2001 paper in the Journal of Finance, documenting that credit spread changes are driven by factors beyond firm-specific credit quality. They found that a substantial portion of spread variation is explained by market-wide factors, suggesting credit spreads contain information about aggregate economic conditions.
Simon Gilchrist and Egon Zakrajsek extended this research in their 2012 American Economic Review paper, introducing the concept of the Excess Bond Premium. They demonstrated that the component of credit spreads not explained by default risk alone is a powerful predictor of future economic activity. Elevated excess spreads precede recessions with remarkable consistency.
What Credit Spreads Reveal
Credit spreads measure the difference in yield between corporate bonds and Treasury securities of similar maturity. High yield bonds, also called junk bonds, carry ratings below investment grade and offer higher yields to compensate for greater default risk. Investment grade bonds have lower yields because the probability of default is smaller.
The spread between high yield and investment grade bonds is particularly informative. When this spread widens, investors are demanding significantly more compensation for taking on credit risk. This typically indicates deteriorating economic expectations, tighter financial conditions, or increasing risk aversion. When the spread narrows, investors are comfortable accepting lower premiums, signaling confidence in corporate health.
The Gilchrist-Zakrajsek research showed that credit spreads contain two distinct components. The first is the expected default component, which reflects the probability-weighted cost of potential defaults based on corporate fundamentals. The second is the excess bond premium, which captures additional compensation demanded beyond expected defaults. This excess premium rises when investor risk appetite declines and financial conditions tighten.
The Implementation Approach
This indicator uses actual option-adjusted spread data from the Federal Reserve Economic Database (FRED), available directly in TradingView. The ICE BofA indices represent the industry standard for measuring corporate bond spreads.
The primary data sources are FRED:BAMLH0A0HYM2, the ICE BofA US High Yield Index Option-Adjusted Spread, and FRED:BAMLC0A0CM, the ICE BofA US Corporate Index Option-Adjusted Spread for investment grade bonds. These indices measure the spread of corporate bonds over Treasury securities of similar duration, expressed in basis points.
Option-adjusted spreads account for embedded options in corporate bonds, providing a cleaner measure of credit risk than simple yield spreads. The methodology developed by ICE BofA is widely used by institutional investors and central banks for monitoring credit conditions.
The indicator offers two modes. The HY-IG excess spread mode calculates the difference between high yield and investment grade spreads, isolating the pure compensation for below-investment-grade credit risk. This measure is less affected by broad interest rate movements. The HY-only mode tracks the absolute high yield spread, capturing both credit risk and the overall level of risk premiums in the market.
Interpreting the Regimes
Credit conditions are classified into four regimes based on Z-scores calculated from the spread proxy.
The Stress regime occurs when spreads reach extreme levels, typically above a Z-score of 2.0. At this point, credit markets are pricing in significant default risk and economic deterioration. Historically, stress regimes have coincided with recessions, financial crises, and major market dislocations. The 2008 financial crisis, the 2011 European debt crisis, the 2016 commodity collapse, and the 2020 pandemic all triggered credit stress regimes.
The Elevated regime, between Z-scores of 1.0 and 2.0, indicates above-normal risk premiums. Credit conditions are tightening. This often occurs in the build-up to stress events or during periods of uncertainty. Risk management should be heightened, and exposure to credit-sensitive assets may be reduced.
The Normal regime covers Z-scores between -1.0 and 1.0. This represents typical credit conditions where spreads fluctuate around historical averages. Standard investment approaches are appropriate.
The Low regime occurs when spreads are compressed below a Z-score of -1.0. Investors are accepting below-average compensation for credit risk. This can indicate complacency, strong economic confidence, or excessive risk-taking. While often associated with favorable conditions, extremely tight spreads sometimes precede sudden reversals.
Credit Cycle Dynamics
Beyond static regime classification, the indicator tracks the direction and acceleration of spread movements. This reveals where credit markets stand in the credit cycle.
The Deteriorating phase occurs when spreads are elevated and continuing to widen. Credit conditions are actively worsening. This phase often precedes or coincides with economic downturns.
The Recovering phase occurs when spreads are elevated but beginning to narrow. The worst may be over. Credit conditions are improving from stressed levels. This phase often accompanies the early stages of economic recovery.
The Tightening phase occurs when spreads are low and continuing to compress. Credit conditions are very favorable and improving further. This typically occurs during strong economic expansions but may signal building complacency.
The Loosening phase occurs when spreads are low but beginning to widen from compressed levels. The extremely favorable conditions may be normalizing. This can be an early warning of changing sentiment.
Relationship to Economic Activity
The predictive power of credit spreads for economic activity is well-documented. Gilchrist and Zakrajsek found that the excess bond premium predicts GDP growth, industrial production, and unemployment rates over horizons of one to four quarters.
When credit spreads spike, the cost of corporate borrowing increases. Companies may delay or cancel investment projects. Reduced investment leads to slower growth and eventually higher unemployment. The transmission mechanism runs from financial conditions to real economic activity.
Conversely, tight credit spreads lower borrowing costs and encourage investment. Easy credit conditions support economic expansion. However, excessively tight spreads may encourage over-leveraging, planting seeds for future stress.
Practical Application
For equity investors, credit spreads provide context for market risk. Equities and credit often move together because both reflect corporate health. Rising credit spreads typically accompany falling stock prices. Extremely wide spreads historically have coincided with equity market bottoms, though timing the reversal remains challenging.
For fixed income investors, spread regimes guide sector allocation decisions. During stress regimes, flight to quality favors Treasuries over corporates. During low regimes, spread compression may offer limited additional return for credit risk, suggesting caution on high yield.
For macro traders, credit spreads complement other indicators of financial conditions. Credit stress often leads equity volatility, providing an early warning signal. Cross-asset strategies may use credit regime as a filter for position sizing.
Limitations and Considerations
FRED data updates with a lag, typically one business day for the ICE BofA indices. For intraday trading decisions, more current proxies may be necessary. The data is most reliable on daily timeframes.
Credit spreads can remain at extreme levels for extended periods. Mean reversion signals indicate elevated probability of normalization but do not guarantee timing. The 2008 crisis saw spreads remain elevated for many months before normalizing.
The indicator is calibrated for US credit markets. Application to other regions would require different data sources such as European or Asian credit indices. The relationship between spreads and subsequent economic activity may vary across market cycles and structural regimes.
References
Collin-Dufresne, P., Goldstein, R.S., and Martin, J.S. (2001). The Determinants of Credit Spread Changes. Journal of Finance, 56(6), 2177-2207.
Gilchrist, S., and Zakrajsek, E. (2012). Credit Spreads and Business Cycle Fluctuations. American Economic Review, 102(4), 1692-1720.
Krishnamurthy, A., and Muir, T. (2017). How Credit Cycles across a Financial Crisis. Working Paper, Stanford University.
IMPORTANT Levels by SBImportant levels by SB based on gann levels.One can plot these levels once on the chart and can work on these levels .When ever market market come at any of these levels .User can wait for the price action and accordingly user can get inside the trade
CRR - GANAEMAs on the chart (visual trend)
EMA 15 (white), 30 (yellow), 200 (red).
2️⃣ DASH Engine 1m–5m–15m (+ 1H and 1D)
For each TF (1m, 5m, 15m) it calculates a bull/bear score using:
EMA structure (15, 30, 50, 100, 200).
MACD.
RSI.
Relationship with EMA 30 and VWAP.
FVG in favor.
ATR change (volatility **increasing**).
From this it derives:
t1 (1m), t2 (5m), t3 (15m),
t4 (1H) and t5 (1D) (only for EMA200).
It detects:
ALL BULL → “BULLISH - BUYS ONLY”.
ALL BEAR → “BEARISH - SELLS ONLY”.
Otherwise → “NEUTRAL / MIXED”.
In addition:
Calculates BULL TF vs BEAR TF (%) between 1m–5m–15m.
Displays a visual bar 🐂🟩 vs 🐻🟥.
3️⃣ GOLD News (manual)
Special bar that says:
Neutral
BUY (positive)
SELL (negative)
Paints the HUD with color according to the news you select.
4️⃣ NO RETRACEMENT Alerts (beast mode 💣)
Very strict conditions using the 5 TFs:
BUY NO RETRACEMENT if:
4 or more TFs in bull mode (bullTF_all >= 4),
1m ultra bull (EMA bull, RSI>60, MACD bull, high volume, price above EMA15 and VWAP, FVG ≥ 0).
SELL NO RETRACEMENT is the same but bearish.
Creates alerts:
CRR BUY NO RETRACEMENT
CRR SELL NO RETRACEMENT
5️⃣ PRO LITE Patterns: Double Top / Double Bottom
Detects double tops and double bottoms with:
Minimum bar distance.
Tolerance in %. Optional filters:
MACD, RSI, ATR (volatility), volume, FVG.
If everything aligns:
Plots SELL at double top.
Plots BUY at double bottom.
6️⃣ TOP Indicators Block (SMI + WaveTrend + Supertrend)
SMI (momentum), WaveTrend, and Supertrend:
Counts which are in bull mode and which are in bear mode.
Displays:
TOP IND: BULLS XX% | BEARS YY%.
7️⃣ Integrated Internal SMC Module
Structure HH, LH, HL, LL.
BMS (break of structure) and ChoCH (change of character).
Filter with ATR + volume + MACD + gaps.
Internal Fibonacci of the last range (38.2, 50, 61.8).
Dotted yellow lines of the current range (swing high/low).
🧠 In short:
It's your command center for XAUUSD:
Global mode (buy only / sell only / mixed),
% of timeframes favoring bulls/bears,
gold news,
no-lag alerts,
filtered double top/bottom,
TOP indicators,
and complete SMC (structure + BMS/ChoCH + Fibonacci + range)...
all integrated into a single CRAZY RAY RAY HUD
VIX/VXV Ratio (TitsNany)This script plots the VXV/VIX ratio, which compares medium-term volatility (90-day fear) to short-term volatility (30-day fear). When the ratio rises above key levels like 1.16 or 1.24, it signals that traders expect future stress, often preceding market pullbacks. When the ratio falls toward or below 1.0, short-term fear is spiking, which typically occurs during active selloffs or volatility events. In short, elevated readings warn of potential market drops ahead, while sharp declines in the ratio reflect panic already hitting the market.
Volume Profiles on Weekly TWAP and Zscore ColoringThis indicator takes (DeadCats) volume profile and starts a new profile when price reaches a new Weekly TWAP line or deviation line.
The candles are also colored by Z score based on the 5 deviations from the Daily TWAP, which is anchored from previous days settlement time, 14:59:30CT. The max number of deviations can be changed in the settings to change the sensitivity of the z score coloring.
Equal Highs & Lows Strategy // ------------------------------------------------------------------------------
// 🧠 THE MARKET PSYCHOLOGY (WHY THIS WORKS):
// ------------------------------------------------------------------------------
// 1. THE MAGNET THEORY:
// "Equal Highs" (EQH) and "Equal Lows" (EQL) are not random. They represent
// Retail Support and Resistance. Retail traders are taught to put Stop Losses
// just above Double Tops or just below Double Bottoms.
// - Therefore, these lines represent massive pools of LIQUIDITY (Money).
// - Price is often engineered to move toward these lines to "unlock" that money.
//
// 2. THE INSTITUTIONAL TRAP (STOP HUNTS):
// Institutions need liquidity to fill large orders without slippage.
// - To Buy massive amounts, they need many Sellers -> They push price BELOW EQL
// to trigger retail Sell Stops.
// - To Sell massive amounts, they need many Buyers -> They push price ABOVE EQH
// to trigger retail Buy Stops.
//
// 3. THE STRATEGY (TURTLE SOUP):
// We do not trade the initial touch. We wait for the "Sweep & Reclaim".
// - Bullish Signal (GRAB ⬆): Price drops below the Green Line (EQL), grabs the
// stops, but buyers step in and force the candle to CLOSE back above the line.
// - Bearish Signal (GRAB ⬇): Price spikes above the Red Line (EQH), grabs the
// stops, but sellers step in and force the candle to CLOSE back below the line.
// ------------------------------------------------------------------------------
ATR ZigZag - Volatility-Filtered Market StructureDescription
This indicator draws ZigZags using an ATR based threshold for direction switching to identify major swing highs and lows. Instead of relying on fractals or fixed bar-count swings, pivots are confirmed only when price moves beyond the prior extreme by:
threshold = ATR(length) × ATR_mult
This filters noise, enforces valid swing structure (high → low → high), and adapts automatically to volatility. The ATR ZigZag is ideal for traders who want a clean, objective view of swing structure without noise. This has many uses, including mapping swing structure, drawing chart patterns, and trading around extremes.
Lag and Repainting
Pivots are confirmed only after price moves sufficiently in the opposite direction. This creates necessary lag. The ZigZag is drawn when this occurs, and will anchor to the high/low in the past. Optional detection dot plots show exactly when confirmation occurred.
What You See
ZigZag: dashed gray line, repainted to anchor at the confirmed highs and lows
Latest Pivot Levels: Dashed horizontal lines at the most recent confirmed high/low.
Optional Live Swing Leg: A real-time line from the last confirmed pivot to the current swing extreme, updating until a new pivot forms.
Optional ATR Boxes: 1×ATR shaded zones around the latest pivot for structural context.
Optional Pivot Confirmation Dots: Markers show the bar where the threshold is crossed and a swing is officially confirmed. This is to understand the lag and see when the ZigZag repainted.
Absorption RatioThe Hidden Connections Between Markets
Financial markets are not isolated islands. When panic spreads, seemingly unrelated assets suddenly begin moving in lockstep. Stocks, bonds, commodities, and currencies that normally provide diversification benefits start falling together. This phenomenon, where correlations spike during crises, has devastated portfolios throughout history. The Absorption Ratio provides a quantitative measure of this hidden fragility.
The concept emerged from research at State Street Associates, where Mark Kritzman, Yuanzhen Li, Sebastien Page, and Roberto Rigobon developed a novel application of principal component analysis to measure systemic risk. Their 2011 paper in the Journal of Portfolio Management demonstrated that when markets become tightly coupled, the variance explained by the first few principal components increases dramatically. This concentration of variance signals elevated systemic risk.
What the Absorption Ratio Measures
Principal component analysis, or PCA, is a statistical technique that identifies the underlying factors driving a set of variables. When applied to asset returns, the first principal component typically captures broad market movements. The second might capture sector rotations or risk-on/risk-off dynamics. Additional components capture increasingly idiosyncratic patterns.
The Absorption Ratio measures the fraction of total variance absorbed or explained by a fixed number of principal components. In the original research, Kritzman and colleagues used the first fifth of the eigenvectors. When this fraction is high, it means a small number of factors are driving most of the market movements. Assets are moving together, and diversification provides less protection than usual.
Consider an analogy: imagine a room full of people having independent conversations. Each person speaks at different times about different topics. The total "variance" of sound in the room comes from many independent sources. Now imagine a fire alarm goes off. Suddenly everyone is talking about the same thing, moving in the same direction. The variance is now dominated by a single factor. The Absorption Ratio captures this transition from diverse, independent behavior to unified, correlated movement.
The Implementation Approach
TradingView does not support matrix algebra required for true principal component analysis. This implementation uses a closely related proxy: the average absolute correlation across a universe of major asset classes. This approach captures the same underlying phenomenon because when assets are highly correlated, the first principal component explains more variance by mathematical necessity.
The asset universe includes eight ETFs representing major investable categories: SPY and QQQ for large cap US equities, IWM for small caps, EFA for developed international markets, EEM for emerging markets, TLT for long-term treasuries, GLD for gold, and USO for oil. This selection provides exposure to equities across geographies and market caps, plus traditional diversifying assets.
From eight assets, there are twenty-eight unique pairwise correlations. The indicator calculates each using a rolling window, takes the absolute value to measure coupling strength regardless of direction, and averages across all pairs. This average correlation is then transformed to match the typical range of published Absorption Ratio values.
The transformation maps zero average correlation to an AR of 0.50 and perfect correlation to an AR of 1.00. This scaling aligns with empirical observations that the AR typically fluctuates between 0.60 and 0.95 in practice.
Interpreting the Regimes
The indicator classifies systemic risk into four regimes based on AR levels.
The Extreme regime occurs when the AR exceeds 0.90. At this level, nearly all asset classes are moving together. Diversification has largely failed. Historically, this regime has coincided with major market dislocations: the 2008 financial crisis, the 2020 COVID crash, and significant correction periods. Portfolios constructed under normal correlation assumptions will experience larger drawdowns than expected.
The High regime, between 0.80 and 0.90, indicates elevated systemic risk. Correlations across asset classes are above normal. This often occurs during the build-up to stress events or during volatile periods where fear is spreading but has not reached panic levels. Risk management should be more conservative.
The Normal regime covers AR values between 0.60 and 0.80. This represents typical market conditions where some correlation exists between assets but diversification still provides meaningful benefits. Standard portfolio construction assumptions are reasonable.
The Low regime, below 0.60, indicates that assets are behaving relatively independently. Diversification is working well. Idiosyncratic factors dominate returns rather than systematic risk. This environment is favorable for active management and security selection strategies.
The Relationship to Portfolio Construction
The implications for portfolio management are significant. Modern portfolio theory assumes correlations are stable and uses historical estimates to construct efficient portfolios. The Absorption Ratio reveals that this assumption is violated precisely when it matters most.
When AR is elevated, the effective number of independent bets in a diversified portfolio shrinks. A portfolio holding stocks, bonds, commodities, and real estate might behave as if it holds only one or two positions during high AR periods. Position sizing based on normal correlation estimates will underestimate portfolio risk.
Conversely, when AR is low, true diversification opportunities expand. The same nominal portfolio provides more independent return streams. Risk can be deployed more aggressively while maintaining the same effective exposure.
Component Analysis
The indicator separately tracks equity correlations and cross-asset correlations. These components tell different stories about market structure.
Equity correlations measure coupling within the stock market. High equity correlation indicates broad risk-on or risk-off behavior where all stocks move together. This is common during both rallies and selloffs driven by macroeconomic factors. Stock pickers face headwinds when equity correlations are elevated because individual company fundamentals matter less than market beta.
Cross-asset correlations measure coupling between different asset classes. When stocks, bonds, and commodities start moving together, traditional hedges fail. The classic 60/40 stock/bond portfolio, for example, assumes negative or low correlation between equities and treasuries. When cross-asset correlation spikes, this assumption breaks down.
During the 2022 market environment, for instance, both stocks and bonds fell significantly as inflation and rate hikes affected all assets simultaneously. High cross-asset correlation warned that the usual defensive allocations would not provide their expected protection.
Mean Reversion Characteristics
Like most risk metrics, the Absorption Ratio tends to mean-revert over time. Extremely high AR readings eventually normalize as panic subsides and assets return to more independent behavior. Extremely low readings tend to rise as some level of systematic risk always reasserts itself.
The indicator tracks AR in statistical terms by calculating its Z-score relative to the trailing distribution. When AR reaches extreme Z-scores, the probability of normalization increases. This creates potential opportunities for strategies that bet on mean reversion in systemic risk.
A buy signal triggers when AR recovers from extremely elevated levels, suggesting the worst of the correlation spike may be over. A sell signal triggers when AR rises from unusually low levels, warning that complacency about diversification benefits may be excessive.
Momentum and Trend
The rate of change in AR carries information beyond the absolute level. Rapidly rising AR suggests correlations are increasing and systemic risk is building. Even if AR has not yet reached the high regime, acceleration in coupling should prompt increased vigilance.
Falling AR momentum indicates normalizing conditions. Correlations are decreasing and assets are returning to more independent behavior. This often occurs in the recovery phase following stress events.
Practical Application
For asset allocators, the AR provides guidance on how much diversification benefit to expect from a given allocation. During high AR periods, reducing overall portfolio risk makes sense because the usual diversifiers provide less protection. During low AR periods, standard or even aggressive allocations are more appropriate.
For risk managers, the AR serves as an early warning indicator. Rising AR often precedes large market moves and volatility spikes. Tightening risk limits before correlations reach extreme levels can protect capital.
For systematic traders, the AR provides a regime filter. Mean reversion strategies may work better during high AR periods when panics create overshooting. Momentum strategies may work better during low AR periods when trends can develop independently across assets.
Limitations and Considerations
The proxy methodology introduces some approximation error relative to true PCA-based AR calculations. The asset universe, while representative, does not include all possible diversifiers. Correlation estimates are inherently backward-looking and can change rapidly.
The transformation from average correlation to AR scale is calibrated to match typical published ranges but is not mathematically equivalent to the eigenvalue ratio. Users should interpret levels directionally rather than as precise measurements.
Correlation regimes can persist longer than expected. Mean reversion signals indicate elevated probability of normalization but do not guarantee timing. High AR can remain elevated throughout extended crisis periods.
References
Kritzman, M., Li, Y., Page, S., and Rigobon, R. (2011). Principal Components as a Measure of Systemic Risk. Journal of Portfolio Management, 37(4), 112-126.
Kritzman, M., and Li, Y. (2010). Skulls, Financial Turbulence, and Risk Management. Financial Analysts Journal, 66(5), 30-41.
Billio, M., Getmansky, M., Lo, A., and Pelizzon, L. (2012). Econometric Measures of Connectedness and Systemic Risk in the Finance and Insurance Sectors. Journal of Financial Economics, 104(3), 535-559.
Setup Keltner Banda 3 e 5 - MMS + RSI + Distância Tabela
📊 Indicator Overview: Keltner Bands + RSI + Distance Table
This custom TradingView indicator combines three powerful tools into a single, visually intuitive setup:
Keltner Channels (Bands 3x and 5x ATR)
Relative Strength Index (RSI)
Dynamic Table Displaying RSI and Price Distance from Moving Average (MMS)
🔧 Components and Functions
1. Keltner Channels (3x and 5x ATR)
Based on a Simple Moving Average (MMS) and Average True Range (ATR).
Two sets of bands are plotted:
3x ATR Bands: Used for moderate volatility signals.
5x ATR Bands: Used for high volatility extremes.
Visual fills between bands help identify overextended price zones.
2. RSI (Relative Strength Index)
Measures momentum and potential reversal zones.
Customizable overbought (default 70) and oversold (default 30) levels.
RSI values are color-coded in the table:
Green for RSI ≤ 30 (oversold)
Blue for 30 < RSI ≤ 70 (neutral)
Red for RSI > 70 (overbought)
3. Distance Table (Price vs. MMS)
Displays the real-time distance between the current price and the MMS:
In points (absolute difference)
In percentage (relative to MMS)
Helps traders assess how far price has deviated from its mean.
📈 How to Use
Trend Reversal Signals
Look for price crossing back inside the 3x or 5x Keltner Bands.
Confirm with RSI:
RSI > 70 + price re-entering from above = potential short
RSI < 30 + price re-entering from below = potential long
Volatility Zones
Price outside the 5x band indicates extreme movement.
Use this to anticipate mean reversion or breakout continuation.
Table Insights
Monitor RSI and price distance in real time.
Use color cues to quickly assess momentum and stretch.
⚙️ Customization
Adjustable parameters for:
MMS period
ATR multipliers
RSI period and thresholds
Table position on chart
Fill colors between bands
This indicator is ideal for traders who want a clean, data-rich visual tool to track volatility, momentum, and price deviation in one place.
Box TheoryBox Theory – Description
This indicator is based on the popular “Box Theory” concept, where the previous session’s High–Low range acts as the most important structure for the next session.
Traders use this because the market often reacts to the same areas where liquidity, orders, and imbalances were created in the prior session.
At every new session open, the indicator automatically records:
Previous High
Previous Low
Middle (50% level)
These three levels form a box, which becomes your roadmap for the new session.
This method is widely used because it highlights where most reversals, sweeps, and reactions occur—without needing any extra indicators.
How the Zones Are Calculated
Previous High
The highest price of the last session.
This forms the top edge, which acts as resistance and the basis for the Sell Zone.
Previous Low
The lowest price of the last session.
This forms the bottom edge, acting as support and the basis for the Buy Zone.
Middle Line (50% Level)
The exact midpoint between High and Low.
This is the fair-value zone, where price often consolidates and becomes directionless.
No signals are triggered near the middle, because trades taken here historically have low accuracy.
Buy Zone (Green Area)
The lower part of the box.
Price often reacts here because this area held buyers in the previous session.
When price enters this green zone inside the box, the indicator can show a Buy Zone label.
Sell Zone (Red Area)
The upper part of the box.
Price commonly rejects here because this area acted as resistance previously.
When price enters this red zone inside the box, the indicator can show a Sell Zone label.
How Zone Size Is Set (Sensitivity %)
You can adjust how big the Buy/Sell zones are using the Sensitivity (%) input.
Lower % → Smaller zones → More precise signals
Higher % → Larger zones → Signals appear earlier and from farther away
Formula:
Zone Size = (Previous High − Previous Low) × (Sensitivity % ÷ 100)
This lets you customize how tight or how early your signals appear.
Inside-Box Only Logic
The indicator only works inside the previous session’s range.
If price breaks above the previous High → No sell signal
If price breaks below the previous Low → No buy signal
This avoids false signals during breakouts or trending markets.
Alerts
The indicator includes two alerts:
Buy Zone Alert → Triggers when price enters the Buy Zone
Sell Zone Alert → Triggers when price enters the Sell Zone
Just enable them in TradingView’s alert panel.
BLACK SWAN SWEEP (DANIELPEREZ)Crt de velas especificas después del sweep buscar la confirmación del order block para tomar una operacio .
Check specific candlesticks after the sweep to find order block confirmation before taking a trade.
ICT Quant-Core: Liquidity Intelligence [Dual-Engine]🔥 THE ULTIMATE LIQUIDITY FILTERING ENGINE
Most SMC traders lose money because they "catch falling knives" on every local wick. This algorithm solves this problem by using DUAL-CORE logic and a signal quality scoring system.
This is no ordinary pivot indicator.
⚙️ HOW DOES IT WORK? (DUAL-CORE LOGIC)
The algorithm analyzes the market on two levels simultaneously:
1️⃣ MACRO CORE (Lookback 50 - "WHALE 🐋")
Tracks key levels from recent weeks/months.
This is where institutions build their positions.
Signals from this core have the highest priority (Score 10/10).
2️⃣ LOCAL CORE (Lookback 20 - "ROACH 🐟")
Tracks internal market structure and noise.
Signals are filtered by the Main Trend. If the trend is down, Local Longs are marked as "TRAP."
🧠 SMART FILTERS (QUANT LAYERS)
Instead of entering on every line touch, the script requires confirmation:
✅ RECLAIM LOGIC: Price must close back above/below the liquidity level (Swing Failure Pattern).
✅ RVOL FILTER: Requires relative volume > 1.2x the average (institutional track).
✅ SCORING SYSTEM (0-10): Each signal receives a score.
- 10/10: Macro Grab in line with the trend + high volume.
- 3/10: Local Grab against the trend (risky).
📊 ANALYTICAL DASHBOARD
In the lower right corner, you'll find the "Command Center":
- Trend Status (Distribution/Accumulation)
- Whale's Last Move (Price and Direction)
- Current Tactics (e.g., "Ignore Longs, Search for Shorts")
- Filter Status (RSI, Volume, Reclaim)
🚀 HOW TO USE IT?
1. Set the H4 timeframe.
2. Wait for a signal with a rating > 7/10.
3. Ignore "Fish/Local" signals (small icons) if they contradict the Dashboard color.
4. Entry occurs only after the candle closes (Reclaim).
Scary Flush Indicator R0Work in progress.
Calculates the gradient based on candle lows (previous low to current low). Works on all time frames.
Looks for a selling gradient of >0.75pts per minute then highlights. Anything less than this indicates a lazy grind down and indicates a potential invalidation for the FBD.






















