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.
Madrid Ribbon with ST/TEMA Filter + Hourly Trend
Madrid Moving Average Ribbon with SuperTrend/TEMA Filter + Hourly Trend Open Line
This advanced technical indicator combines three powerful trading tools into one comprehensive system for identifying trend direction, momentum, and key support/resistance levels.
📊 What's Included:
1. Madrid Moving Average Ribbon (18 EMAs/SMAs)
Displays 18 configurable moving averages (5-100 periods) creating a visual "ribbon" effect
Color-coded system: LIME (strong bullish), GREEN (bullish), MAROON (weak bearish), RED (strong bearish), GRAY (neutral/filtered)
Choose between Exponential (EMA) or Simple (SMA) moving averages
The ribbon helps identify trend strength, direction, and potential reversals
2. SuperTrend/TEMA Filter System
Zero-lag Triple Exponential Moving Average (TEMA) for fast trend detection
SuperTrend indicator using ATR-based volatility bands
Combined filter logic: Only displays ribbon colors when BOTH SuperTrend AND TEMA confirm the trend direction
Reduces false signals and whipsaw during choppy market conditions
Fully customizable parameters (Fast/Slow TEMA periods, ATR multiplier, MA length)
Can be toggled ON/OFF to see unfiltered Madrid Ribbon
3. Hourly Trend Open Line
Plots the opening price of your selected higher timeframe (default: 1-hour)
Acts as dynamic support/resistance and trend bias indicator
Background coloring: Green when price is above the line (bullish bias), Red when below (bearish bias)
Customizable timeframe from 1-minute to Daily
Great for multi-timeframe analysis and confirming trade direction
🎯 How to Use:
Trend Following: Enter long when ribbon turns LIME/GREEN, enter short when MAROON/RED
Trend Confirmation: Use the Hourly Trend Open Line to confirm direction - trade longs above the line, shorts below
Filter Noise: Enable SuperTrend/TEMA filter to remove low-probability setups in ranging markets
Exit Signals: Watch for ribbon color changes or price crossing the Hourly Trend Open Line
⚡ Alert System:
Filtered Buy Signal: When trend changes to bullish (confirmed by both SuperTrend and TEMA)
Filtered Sell Signal: When trend changes to bearish (confirmed by both SuperTrend and TEMA)
Filtered Trend Change: Any trend direction change
⚙️ Customization Options:
Toggle SuperTrend/TEMA filter on/off
Adjust TEMA periods (Fast: 22, Slow: 144 default)
Modify SuperTrend settings (ATR multiplier, MA length)
Change Hourly Trend timeframe
Customize all colors and line widths
Choose EMA or SMA for ribbon calculation
💡 Best Practices:
Works on all timeframes and instruments
Use higher timeframe Trend Open Line for swing trading
Combine with volume analysis for confirmation
Best suited for trending markets; consider disabling in tight ranges
Test settings on your specific instrument for optimal performance
📝 Note: This indicator requires the 'loxx/loxxexpandedsourcetypes/4' library for TEMA calculations.
This indicator is ideal for traders who want a comprehensive, all-in-one solution for trend identification, momentum analysis, and multi-timeframe confluence.
Buy vs Sell Volume EMA + Smart Momentum Shift (Crypto)This is a volume-based momentum indicator for crypto that:
Splits total volume into buy vs. sell volume based on candle direction.
Applies EMAs to buy/sell volume and tracks slope and acceleration of those EMAs.
Looks for moments where buyer volume momentum is improving and seller momentum is fading.
Optionally requires RSI and/or MACD confirmation, a “near recent low” location filter, and a score threshold based on several micro-conditions.
Outputs:
Colored background depending on whether buy or sell volume dominates.
EMA crossover arrows (“Buy” and “Sell”) for simpler regime shifts.
Green dots (“Strong Buy Momentum Shift”) when all filters are satisfied.
Alert conditions for the above signals.
It runs in a separate pane (overlay=false) and is explicitly designed for crypto, but works on any symbol/interval.
5-Bar BreakoutThis indicator shows if the price is breaking out above the high or the low of the previous 5 bars
**MACD + RSI + MFI by IspatialResources – Multi-Tool Indicator**
This indicator is a **multi-functional technical analysis tool** that combines the following professional oscillators into a single panel:
* ✅ **Customizable MACD**
* ✅ **Advanced RSI with Moving Average and Bollinger Bands**
* ✅ **Money Flow Index (MFI)**
* ✅ **Module-based enable/disable system**
* ✅ **Fully configurable alerts**
It is designed to help identify **overbought and oversold conditions, trend strength, and momentum shifts**, improving market reading across multiple assets.
---
### 🔹 INCLUDED MODULES
**1️⃣ MACD**
* Fast and slow moving average settings
* Selectable MA type (SMA / EMA)
* Dynamic histogram
* Momentum change alerts
**2️⃣ Advanced RSI**
* Classic RSI with dynamic levels
* Moving average applied to RSI
* Optional **Bollinger Bands on RSI**
* Visual overbought and oversold signals
* Extreme condition alerts
**3️⃣ MFI (Money Flow Index)**
* Buying and selling pressure detection
* Overbought and oversold zones
* Ideal for volume and strength analysis
---
### 🔹 SUPPORTED MARKETS
This indicator can be used on:
* 📈 Cryptocurrencies
* 📊 Stock Indices
* 💱 Forex
* 📉 Stocks
It works on **all timeframes**: intraday, swing trading, and long-term analysis.
---
### 🔹 HOW TO USE IT
* Enable or disable each module from the settings panel.
* Use the **RSI with bands** to detect extreme zones.
* Confirm potential entries with the **MACD**.
* Filter false signals with the **MFI**.
* Combine it with market structure, support, and resistance.
---
### ⚠️ RISK DISCLAIMER
This indicator is **for educational and technical analysis purposes only**.
**It does not constitute financial advice and does not guarantee results.**
Trading involves risk, and each user is responsible for their own decisions.
---
### 👤 AUTHOR
Created by **Ismael** as a personal tool for market analysis and study.
---
🚀 If you find this indicator useful, feel free to support it with a “like” for future updates.
Opening Range ICT 3-Bar FVG + Engulfing Signals (Overlay)Beta testing
open range break out and retest of FVG.
Still working on making it accurate so bear with me
Liquidations (TV Source / Manual / Proxy) Cruz Pro Stack + Liquidations (TV Source / Manual / Proxy) is a high-confluence crypto trading indicator built to merge reversal detection, volatility timing, structure confirmation, and liquidation pressure into one clean decision engine.
This script combines five pro-grade components:
1) RSI Divergence (Regular + Hidden)
Detects early momentum shifts at tops and bottoms to anticipate reversals before price fully reacts.
2) BBWP (Bollinger Band Width Percentile)
Identifies volatility compression and expansion cycles to time breakout conditions and avoid low-quality chop.
3) Market Structure (BOS / CHOCH proxy)
Confirms trend continuation or change-of-character using swing breaks for more reliable directional bias.
4) Liquidations Layer (3 Modes)
Adds liquidation-driven context for where price is likely to squeeze or flush next:
TV Source: Use TradingView’s built-in Liquidations plot when available.
Manual Totals: Paste 12h/24h/48h long/short totals for higher-level regime bias.
Proxy (Volume Shock): A fallback approximation for spot charts using volume + candle direction.
The script automatically converts your chart timeframe into rolling 12/24/48-hour windows, then computes a weighted liquidation bias and a spike detector to flag potential exhaustion moves.
5) Confluence Score + Signals
A simple scoring engine highlights high-probability setups when multiple factors align.
Signals are printed only when divergence + structure + volatility context agree with liquidation pressure.
How to use
Best on BTC/ETH perps across 15m–4H.
For maximum accuracy:
Add TradingView’s Liquidations indicator (if your exchange/symbol supports it).
Set Liquidations Mode = TV Source.
Select the Liquidations plot as the source.
If that plot can’t be selected, switch to Proxy or Manual Totals.
What this indicator is designed to improve
Earlier reversal recognition
Cleaner breakout timing
Structure-confirmed entries
Better risk management around liquidation-driven moves
Fewer low-quality trades during dead volatility
Renko Scalp ScannerThis scanner is optimized for short term bursts for Renko.
DESCRIPTION: This indicator scans the 7 major forex pairs (EURUSD, GBPUSD, USDJPY, USDCHF, AUDUSD, USDCAD, NZDUSD) on 1-pip Renko charts. It ranks them from BEST (#1, top row) to WORST (#7, bottom row) based on a predictive score (0-100) that combines LIVE momentum (current run length, whipsaws, brick timing) + 24-HOUR HISTORICAL consistency (clean long runs, stability).
Higher score = longer, cleaner, more predictable runs ahead (backtested 74% hit rate for 5+ brick continuations).
HOW TO USE THE TABLE:
1. Add to a 1-second Renko chart (Traditional, Box Size: 0.0001 for non-JPY; 0.01 for JPY pairs).
2. RANK: Position 1–7 (green highlight on #1 = switch to this pair NOW).
3. PAIR: Symbol + direction arrow (↑=buy bias, ↓=sell bias).
4. SCORE: 0–100 total (≥85=monster run; ≥75=strong; ≥60=decent; <60=avoid).
5. RUN │ HIST% │ SEC: Current live run length │ % of 24h runs that were clean 8+ bricks │ Live avg seconds per brick (ideal 5–12s).
6. Trade the #1 pair in the arrow direction until whipsaw or score drops <75. Set alerts for score ≥83.
Backtested on 1-year data: Catches 84% of 10+ brick runners. Refreshes every second.
EMA750 & VWAP Cross IndicatorA trend-following indicator that identifies high-probability entry signals based on EMA750 and VWAP crossovers.
How it works:
Monitors price position relative to EMA750 (trend filter)
Generates LONG signals when price crosses above VWAP while above EMA750
Generates SHORT signals when price crosses below VWAP while below EMA750
Highlights the FIRST signal after each EMA cross (yellow markers)
Automatically calculates targets based on recent swing highs/lows
Stop loss set at EMA750 level
Features:
✓ Visual target and stop loss levels
✓ Customizable alerts for first and all signals
✓ Real-time status dashboard
✓ Swing point detection for target calculation
✓ Signal tracking until opposite VWAP cross
Best for: Swing trading and trend-following strategies on higher timeframes.
5-Min Range Breakout (09:30 NY on MNQ)This is a 5 - min orb strat that a youtuber mentioned and i had a manual look for a while and thought it was actually pretty good but my results are bad. Feel free to look yourself with this code.
Basically this strat is using the 5min orb then go down to 1min timeframe and wait for a breakout with FVG confirmation. So candle after breaking candle is our entry only if FVG is formed.
However i do notice if you dump this code onto 5min timefraem and above you start consistently making money but it is a very small amount for me so you all can have it. Good starter strat on 5min or 10min timeframe
Trade Setup A+ [v.8 Fixed Lines]🚀 Trade Setup A+ : Liquidity Hunter System (XAUUSD)
This indicator is an "All-in-One" trading system designed specifically for XAUUSD (Gold) Scalping and Swing trading. It combines Smart Money Concepts (SMC) with Price Action to identify high-probability setups by tracking liquidity pools and institutional order blocks.
💎 Key Features (v.8 Updated):
Auto Order Blocks (Clean View):
Automatically detects and draws Bullish (Green) and Bearish (Red) Order Blocks based on swing points.
Clean Look: Limits display to the last 5 active zones to keep the chart clutter-free.
Liquidity Levels (Fixed Lines):
D-High / D-Low: Thin lines representing Previous Day’s High & Low.
W-High / W-Low: Thick lines representing Previous Week’s High & Low (Strong Support/Resistance).
Dual Entry Signals:
Method 1 (Sniper): Shows a Diamond Icon (💎) when price touches an Order Block zone (Reversal setup).
Method 2 (Follow): Shows a Triangle Arrow (🔼/🔽) when price crosses EMA 14 with trend confirmation from EMA 49.
Macro Time Zones:
Highlights high-volume trading sessions (Asia, London, NY) on the background to identify "Killzones".
📈 How to Trade:
BUY Signal: Look for a Green Diamond (Touch OB) or Green Triangle (Price > EMA 14 & 49).
SELL Signal: Look for a Red Diamond (Touch OB) or Orange Triangle (Price < EMA 14).
Best Time: Trade when signals align with highlighted Macro Time zones.
⚠️ Disclaimer: This tool is for educational purposes only. Always use proper risk management.
🚀 Trade Setup A+ : ระบบเทรดล่าสภาพคล่อง (สำหรับทองคำ)
อินดิเคเตอร์ชุดนี้ออกแบบมาเพื่อเทรด XAUUSD (ทองคำ) โดยเฉพาะ ผสมผสานเทคนิค SMC (Smart Money Concepts) และ Price Action เพื่อหาจุดเข้าที่มีความแม่นยำสูง (High Probability) โดยเน้นการดักจับสภาพคล่องของรายใหญ่ค่ะ
💎 ฟีเจอร์หลัก (อัปเดตล่าสุด v.8):
Auto Order Blocks (แบบคลีน):
สร้างกล่องโซนซื้อขาย (Supply/Demand) ให้อัตโนมัติ (สีเขียว = โซน Buy, สีแดง = โซน Sell)
Clean Look: ระบบจะโชว์เฉพาะ 5 กล่องล่าสุดเท่านั้น เพื่อไม่ให้กราฟรกสายตา
Liquidity Levels (เส้นแนวรับต้าน):
D-High / D-Low: เส้นบาง แสดงราคาสูงสุด/ต่ำสุดของ "เมื่อวาน" (Day)
W-High / W-Low: เส้นหนา แสดงราคาสูงสุด/ต่ำสุดของ "สัปดาห์ที่แล้ว" (Week) ซึ่งเป็นแนวรับต้านที่แข็งแกร่ง
สัญญาณเข้าเทรด 2 แบบ (Dual Signals):
วิธีที่ 1 (Sniper): แสดงรูป เพชร (💎) เมื่อราคาวิ่งชนขอบกล่อง Order Block (ดักจุดกลับตัวปลายไส้)
วิธีที่ 2 (Follow Trend): แสดงรูป ลูกศรสามเหลี่ยม (🔼/🔽) เมื่อราคาตัดเส้น EMA ตามเงื่อนไข (Buy ต้องยืนเหนือ EMA 14 และ 49)
Macro Time (ช่วงเวลาทำเงิน):
ระบายสีพื้นหลังบอกช่วงเวลาที่ตลาดวิ่งแรง (Asia, London, NY) เพื่อให้โฟกัสถูกจุด
📈 วิธีใช้งาน:
ขา BUY: รอสัญญาณ เพชรสีเขียว (ชนกล่องรับ) หรือ ลูกศรเขียว (ตามเทรนด์)
ขา SELL: รอสัญญาณ เพชรสีแดง (ชนกล่องต้าน) หรือ ลูกศรส้ม (ตามเทรนด์)
คำแนะนำ: ประสิทธิภาพสูงสุดเมื่อสัญญาณเกิดในช่วงเวลา Macro Time (แถบสีพื้นหลัง)
Regime Filter [BigBeluga] Modified by Claude to move tableThis is a copy of Regime Filter that has been modified by Anthropic's Claude to move the overlay table to different positions.
MTF OB & FVG detector w/ Alerts v2# MTF Order Blocks & Fair Value Gaps Detector with Alerts v2
## Overview
This indicator combines **Multi-Timeframe Order Blocks (OB)** and **Fair Value Gaps (FVG)** detection with integrated bounce alerts. It displays Order Blocks and Fair Value Gaps across multiple timeframes simultaneously and generates real-time alerts when price bounces from these critical zones.
## Key Features
### 🎯 Multi-Timeframe Order Blocks Detection
- **Volumetric Analysis**: Each Order Block displays total volume and dominant side percentage
- **Multiple Timeframes**: Supports 1min, 3min, 5min, 15min, and 60min timeframes
- **Smart Combining**: Automatically merges overlapping Order Blocks from different timeframes into powerful confluence zones
- **Dynamic Extension**: Order Blocks extend until broken, providing clear visual guidance
- **Volume Distribution**: Shows bullish vs bearish volume breakdown with percentage
### 📊 Fair Value Gaps (FVG) Detection
- **Lightweight Processing**: Works on current chart timeframe only for optimal performance
- **Volume Metrics**: Displays FVG volume and dominant side percentage
- **Mitigation Tracking**: Automatically tracks when FVGs are filled or broken
- **Customizable Mitigation Source**: Choose between close price or high/low wicks
### 🔔 Comprehensive Alert System
- **Bounce Alerts**: Get notified when price bounces from OB or FVG zones
- **New Formation Alerts**: Alerts when new Order Blocks or Fair Value Gaps form
- **Combined Zone Alerts**: Special alerts when multiple Order Blocks merge into strong confluence zones
- **Customizable Thresholds**: Set minimum number of combined OBs required for strong zone alerts
### 🎨 Visual Customization
- **Inverted Color Schemes**: Optional inverted colors for both OB and FVG
- OB: Choose between traditional (Bullish=Blue, Bearish=Red) or inverted (Bullish=Red, Bearish=Blue)
- FVG: Choose between Bullish=Orange/Bearish=Aqua or inverted
- **Clean Labels**: Shows timeframe, zone type, volume, and dominant percentage
- **Combined Tags**: Optional labels for merged zones
- **Adjustable Extension**: Control how far zones extend into the future
## How It Works
### Order Blocks
Order Blocks identify institutional trading zones where large players have placed significant orders. The indicator:
1. Detects swing highs/lows using configurable swing length
2. Identifies the last opposing candle before a strong move
3. Analyzes volume distribution (bullish vs bearish)
4. Tracks zone validity until price breaks through
5. Combines overlapping zones from multiple timeframes
### Fair Value Gaps
Fair Value Gaps represent price imbalances that often get filled. The indicator:
1. Identifies 3-candle patterns with gaps between candles
2. Filters gaps by size percentile to show only significant ones
3. Calculates volume distribution within the gap
4. Tracks mitigation when price returns to fill the gap
5. Extends gaps dynamically until filled
### Bounce Detection
The indicator detects bounces using a two-step process:
1. **Touch Phase**: Tracks when price enters a zone (touchedInside flag)
2. **Bounce Phase**: Confirms bounce when price exits the zone in the expected direction
- Bullish zones: Price closes above top after touching inside
- Bearish zones: Price closes below bottom after touching inside
## Settings Guide
### General Configuration
- **Show Historic Zones**: Display invalidated/broken zones
- **Zone Invalidation**: Choose between wick or close for break detection
- **Combine Overlapping Order Blocks**: Merge OBs from different timeframes
- **Swing Length**: Controls sensitivity (smaller = more OBs, larger = fewer OBs)
- **Zone Count**: Choose from High/Medium/Low/One per timeframe
- **Invert Colors OB**: Swap bullish/bearish color scheme
### Alert Settings
- **Enable Alerts**: Master switch for all alerts
- **Alert on Bullish/Bearish Bounce**: Choose which bounce directions to monitor
- **Alert on New OB Formation**: Get notified when new Order Blocks form
- **Alert on Combined OBs**: Alerts for strong confluence zones
- **Min OBs for Strong Zone Alert**: Threshold for combined zone alerts (default: 2)
### Fair Value Gaps
- **Show Fair Value Gaps**: Toggle FVG display
- **FVG Mitigation Source**: Choose close or high/low for mitigation detection
- **Bullish/Bearish FVG**: Enable/disable each type
- **Invert FVG Colors**: Swap FVG color scheme
### Multi-Timeframe
- **Show Lower Timeframes**: Display OBs from timeframes lower than chart
- **Individual Timeframe Toggles**: Enable/disable 1min, 3min, 5min, 15min, 60min
### Style
- **Text Color**: Customize label text color
- **Extend Zones**: Set extension length in bars (default: 40)
- **Show Tag**: Display combined indicator in merged zone labels
## Usage Tips
### For Day Trading
- Enable 1min, 3min, and 5min timeframes
- Use "High" zone count for more trading opportunities
- Watch for bounces from combined zones (highest probability)
### For Swing Trading
- Enable 15min, 60min, and higher timeframes
- Use "Medium" or "Low" zone count for major zones only
- Focus on combined zones with 3+ timeframes
### For Scalping
- Use current timeframe only (disable MTF)
- Enable both OB and FVG
- Set up alerts for quick bounce notifications
### Alert Setup
1. Click "Create Alert" in TradingView
2. Choose from available alert conditions:
- **Bullish Bounce (OB/FVG)**: Long entry opportunities
- **Bearish Bounce (OB/FVG)**: Short entry opportunities
- **New OB Formation**: Early zone identification
- **Strong Combined Zone**: High-probability confluence areas
3. Set alert frequency to "Once Per Bar Close" to avoid false signals
## Technical Details
### Performance Optimizations
- Maximum 100 boxes/labels for efficient rendering
- Lightweight FVG processing on current timeframe only
- Dynamic memory management with array size limits
- Selective rendering of active zones only
### Calculations
- **ATR Multiplier**: Zones exceeding 3.5x ATR are filtered out
- **Volume Percentage**: `max(bullVol, bearVol) / totalVolume × 100`
- **FVG Size Filter**: Uses 100th percentile of last 1000 gaps
- **Overlap Detection**: Uses intersection/union ratio for combining zones
## Credits & License
This indicator combines and enhances concepts from:
- "Volumized Order Blocks" methodology
- "Volumatic Fair Value Gaps" approach
**License**: Mozilla Public License 2.0 (MPL-2.0)
## Disclaimer
This indicator is provided for **educational and informational purposes only**. Trading involves substantial risk of loss and is not suitable for every investor. Past performance is not indicative of future results. Always do your own research and consult with a licensed financial advisor before making trading decisions.
## Version History
**v2 (Current)**
- Combined OB and FVG into single indicator
- Added comprehensive alert system
- Improved performance with lightweight FVG processing
- Enhanced bounce detection with touch-inside logic
- Added volume metrics to zone labels
- Implemented dynamic zone extension until broken
- Added combined zone detection with configurable thresholds
---
### Chart Examples
The indicator displays:
- **Red Zones** (Inverted): Bullish Order Blocks / Bearish FVGs
- **Blue Zones** (Inverted): Bearish Order Blocks / Bullish FVGs
- **Orange Zones** (Inverted): Bullish Fair Value Gaps
- **Aqua Zones** (Inverted): Bearish Fair Value Gaps
Each zone shows:
- Timeframe label (e.g., "5m", "15m", "1H")
- Zone type (OB or FVG)
- Total volume in millions (e.g., "12.5M")
- Dominant side percentage (e.g., "85%")
**Example Label**: ` 5m & 15m OB 45.2M (78%)`
- Combined zone from 5min and 15min timeframes
- Order Block type
- 45.2 million total volume
- 78% volume on dominant side
---
## Support & Updates
For issues, suggestions, or questions, please leave a comment on the indicator page.
**Author**: © rasukaru666
**Compatible with**: TradingView Pine Script v6
六脉齐发多空策略六脉齐发多空策略
# Six Meridians Unified Long/Short Strategy
## Overview
The "Six Meridians Unified Long/Short Strategy" is a comprehensive quantitative trading strategy built on TradingView Pine Script v6, designed for cross-asset long/short trading (stocks, cryptocurrencies, futures, forex, etc.). It leverages the resonance of **6 classic technical indicators** to filter high-confidence trading signals, reducing false signals caused by single-indicator bias and improving the reliability of entry/exit decisions.
## Core Indicators (6 "Meridians")
The strategy evaluates bullish/bearish trends by calculating 6 key technical indicators, with a "bullish count" system to quantify trend strength:
| Indicator | Calculation Parameters | Bullish Condition | Bearish Condition |
|-------------------------|------------------------------|--------------------------------------------|--------------------------------------------|
| MACD | Fast=12, Slow=26, Signal=9 | MACD line crosses above Signal line | MACD line crosses below Signal line |
| KDJ (Stochastic Oscillator) | Length=14, SmoothK=3, SmoothD=3 | K line > D line | K line < D line |
| RSI (Relative Strength Index) | Short=6, Long=12 | Short-period RSI (6) > Long-period RSI (12) | Short-period RSI (6) < Long-period RSI (12) |
| LWR (Modified Williams %R) | Length=14, Smooth=6 | LWR1 (WMA-smooth) > LWR2 (6-period WMA) | LWR1 < LWR2 |
| BBI (Bollinger Band Index) | EMA(3)+EMA(6)+EMA(12)+EMA(24) /4 | Close price > BBI line | Close price < BBI line |
| MTM (Momentum) | Period=12, MMS=6, MMM=14 | Short momentum line (MMS) > Long momentum line (MMM) | Short momentum line (MMS) < Long momentum line (MMM) |
## Trading Logic
The strategy uses a "count-based" trigger mechanism to execute position management (no pyramiding allowed):
### Long Position Rules
1. **Entry**: Open long position only when all 6 indicators show bullish signals (`bullCount = 6`).
2. **Partial Exit**: Reduce 50% of long position when 4 indicators remain bullish (`bullCount = 4`).
3. **Full Exit**: Close all long positions when ≤3 indicators are bullish (`bullCount ≤ 3`).
### Short Position Rules
1. **Entry**: Open short position only when all 6 indicators show bearish signals (`bearCount = 6`).
2. **Partial Exit**: Cover 50% of short position when 4 indicators remain bearish (`bearCount = 4`).
3. **Full Exit**: Close all short positions when ≤3 indicators are bearish (`bearCount ≤ 3`).
## Strategy Parameters (Risk & Capital Management)
| Parameter | Value | Description |
|--------------------------|----------------|----------------------------------------------|
| Initial Capital | $100,000 | Starting equity for backtesting |
| Default Order Size | $10,000 (cash) | Fixed cash amount per trade (instead of lots) |
| Commission | 0.1% per trade | Realistic transaction cost (percent-based) |
| Margin Requirement | 100% | No leverage (1:1 trading) |
| Pyramiding | 0 | No additional positions on existing trades |
## Key Features
1. **Multi-Indicator Resonance**: Eliminates noise from single-indicator false signals by requiring consensus across 6 diverse technical metrics.
2. **Gradual Position Management**: Partial exit (50%) before full closure to lock in profits and reduce downside risk.
3. **Full Automation**: Automatically executes entry/exit/position adjustment without manual intervention.
4. **Visualization Tools**: Plots BBI line, long/short signal labels, and bullish indicator count for easy strategy monitoring.
5. **Versatility**: Adaptable to multiple timeframes (15min, 1H, 4H, daily) and asset classes.
## Notes
- The strategy is optimized for trend-following markets and may underperform in choppy/range-bound conditions.
- Backtest results should be validated across different market cycles (bull, bear, sideways) before live trading.
- Parameters (e.g., indicator periods, order size) can be adjusted based on specific asset volatility and trading style.
Time-based levelsScript to plot time-based levels such as yearly/quarterly/monthly/Monday open, Monday range, previous month/week/day range.
This script does NOT handle sessions, therefore it's better suited for crypto which is 24/7.
There are various display options.
- Monday open is displayed immediately, but Monday High / Low / Mid 50% are displayed from Tuesday (i.e. when Monday closes and H/L are set for good)
This behaviour can be overridden using the appropriate option within the indicator's inputs parameters
- Levels are time-frame dependant (for instance, a daily level such as "Monday open" only shows on D1 TF and lower TF)
- To avoid redundancies:
* Yearly open is not displayed on January (redundant with monthly open)
* Quarterly open is not displayed on January, April, July and October (redundant with monthly open), neither on Feb. and March (redundant with yearly open)
* Previous day High / Low / Mid 50% are not displayed on Tuesday (redundant with Monday open / High / Low / Mid 50%)
* Daily open is not displayed on Monday (redundant with Monday open)
- Alerts can be created when prices crosses levels such as yearly/quarterly/monthly/Monday open, Monday range, previous month/week/day range
Known issue (TradingView ticket opened as issue is on their side):
On the W1 TF, if the current week spans over 2 months, the monthly open will be incorrect and still use the previous month open instead.
Once the week closes, the monthly open will be displayed correctly. This issue is not present on other TF.
Example: on Feb. 2nd 2023, when W1 TF is selected, monthly open shows January open instead of February open.
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.


















