Global Liquidity Sentiment (US / Europe / Asia) # Global Liquidity Sentiment Dashboard (US / Europe / Asia) with Alerts
## Summary
Aggregates broad liquidity (M2 or proxies) from the **U.S., Europe, and Asia** into a normalized global index, compares it to Bitcoin price, and derives a heuristic **market sentiment** (Optimistic / Neutral / Pessimistic). Highlights imbalances via divergence detection and surfaces regime shifts with visual cues and alerts.
## Key Features
- Weighted composite **Global Liquidity Index** (US M2 + Europe + Asia).
- **BTC / Liquidity ratio** showing how stretched Bitcoin is relative to available liquidity.
- **Sentiment signal** combining liquidity trend and price-to-liquidity momentum.
- **Divergence detection** when BTC moves disproportionately vs liquidity.
- Colored summary table with metrics, regional weight breakdown, and trend emphasis.
- Alert conditions for sentiment flips and strong divergence events.
## Visual Output
- **Top-right table** displaying:
- Global Liquidity Index (normalized)
- BTC / Liquidity ratio
- Ratio momentum
- Divergence (%) from recent baseline
- Sentiment (Optimistic / Neutral / Pessimistic) with translucent color background
- Regional weights (US / EU / Asia)
- **Line plots**:
- Blue: Global Liquidity Index
- Orange: BTC / Liquidity
- Gray: Smoothed ratio baseline for divergence context
## Inputs
- **US M2 Money Stock:** Real US broad money (via `FRED:WM2NS`).
- **Europe / Asia:** Optionally use live symbol proxies (if available) or manual values.
- **FX rates:** Convert non-USD regional series into USD for aggregation.
- **Weights:** Adjust the relative contribution of US, Europe, and Asia to the composite index.
- **Liquidity SMA length:** Short-term smoothing for trend detection on liquidity.
- **Price/Liquidity momentum length:** Lookback for momentum of BTC-to-liquidity relationship.
- **Divergence SMA & threshold:** Baseline and sensitivity for flagging strong deviations.
## Interpretation
- **Optimistic:** Liquidity expanding and BTC gaining relative strength—risk-friendly environment.
- **Pessimistic:** Liquidity contracting while BTC weakens vs liquidity—potential fragility or correction risk.
- **Neutral:** Mixed or inconclusive signals.
- **High BTC / Liquidity ratio:** Bitcoin may be overextended relative to global liquidity support.
- **Strong Divergence:** Significant dislocation between BTC price and liquidity trend—possible precursor to mean reversion or continuation depending on context.
## Alerts
Built-in alert conditions:
- **Sentiment to Optimistic / Pessimistic / Neutral** — triggers when regime shifts.
- **Strong Divergence** — triggers when BTC/liquidity ratio deviates beyond the configured threshold from its recent smoothed average.
Suggested alert messages (preconfigured):
- “Sentiment changed to Optimistic”
- “Sentiment changed to Pessimistic”
- “Sentiment changed to Neutral”
- “Strong divergence between BTC and global liquidity detected”
## Usage Tips
- Use the sentiment as a macro liquidity backdrop to contextualize BTC moves.
- Monitor divergence to catch overextensions or early signs of trend exhaustion.
- Tweak regional weights to reflect evolving global liquidity influence (e.g., give more weight to Asia as its footprint grows).
- If regional proxies aren’t available, regularly update manual values from official sources (ECB, BOJ, PBOC) to keep the index relevant.
## Limitations
- Europe/Asia liquidity may rely on manual inputs or imperfect proxies (TradingView may not expose official M2 for all regions).
- Heuristic sentiment and divergence are not standalone trade signals—validate with price structure / other confirmations.
- Does not replace high-fidelity on-chain, order book, or institutional flow data.
## Example Scenario
Bitcoin rallies sharply while the Global Liquidity Index flattens. The BTC / Liquidity ratio spikes, divergence crosses threshold, and sentiment shifts toward **Pessimistic**—indicating the move may be running ahead of underlying liquidity support, signaling caution or a possible retracement.
Educational
HF Crypto Scalping BotHigh-Frequency Crypto Scalping Bot for ETHUSDT
This bot is designed for scalping ETHUSDT on a 1-minute chart using a blend of technical indicators and market structure logic.
🔍 Strategy Highlights:
Range Mode: Uses RSI and MFI to identify overbought/oversold zones near support/resistance.
Trend Mode: Detects MACD momentum combined with confirmed S/R breakouts.
Smart Risk Management: Dynamic stop loss and take profit based on risk:reward ratio.
Adaptive Market Logic: Automatically switches between trend and range conditions.
Real-Time Table: Displays RSI, MFI, MACD trend, market mode, entry/exit prices, and stop/target levels.
Visual Cues: Buy/Sell/Exit signals plotted directly on the chart with color-coded levels.
Alerts: Integrated long/short entry and exit alerts with live price and indicator values.
Customize the input parameters to fit your risk profile and asset volatility. Ideal for fast-paced scalping with dynamic conditions.
ATR % Line from LoD/HoDATR % Line Trading Indicator - Entry Filter Tool
This Pine Script creates a sophisticated ATR (Average True Range) percentage-based entry filter indicator for TradingView that helps traders avoid buying overextended stocks and identify optimal entry zones based on volatility.
Core Functionality - Entry Discipline
The script calculates a maximum entry threshold by taking a percentage of the Average True Range (ATR) and projecting it from the current day's low. This creates a dynamic "no-buy zone" that adapts to market volatility, helping traders avoid purchasing stocks that have already moved too far from their daily base.
Key Calculation:
Measures the ATR over a specified period (default: 14 bars)
Takes a user-defined percentage of that ATR (default: 25%)
Projects this distance from the day's low to establish a maximum entry threshold
Entry Rule: Avoid buying when price exceeds this ATR% level from the daily low or high.
Visual Features
Entry Threshold Line:
Draws a horizontal line at the calculated maximum entry level
Line extends forward for clear visualization of the "no-buy zone"
Red zones above this line indicate overextended conditions
Fully customizable appearance with color, width, and style options
Smart Entry Alerts:
Optional labels show the ATR percentage threshold and exact price level
Visual confirmation when stocks are trading in acceptable entry zones vs. extended areas
Real-Time Monitoring Table:
Displays current distance from daily low as ATR percentage
Shows whether current price is in "safe entry zone" or "extended territory"
Customizable display options for clean chart analysis
Practical Applications for Entry Management
Avoiding Extended Entries:
Primary Use: Don't initiate long positions when price is more than X% ATR from the daily low
Prevents buying stocks that have already made their daily move
Reduces risk of buying at temporary tops within the trading session
Entry Zone Identification:
Price trading below the ATR% line = potential entry opportunity
Price trading above the ATR% line = wait for pullback or skip the trade
Combines volatility analysis with momentum discipline
Risk Management Benefits:
Improved Entry Timing: Enter closer to daily support levels
Better Risk/Reward: Shorter distance to stop loss (daily low)
Reduced Chasing: Systematic approach prevents FOMO-driven entries
Volatility Awareness: Higher volatility stocks get wider acceptable entry ranges
Configuration for Entry Filtering
Key Settings for Entry Management:
ATR Percentage: Set your maximum acceptable extension (15-30% common for day trading)
Reference Point: Use "Low" to measure extension from daily base
Line Style: Make highly visible to clearly see entry threshold
Alert Integration: Visual confirmation of entry-friendly zones
Typical Usage Scenarios:
Conservative Entries: 15-20% ATR from daily low
Moderate Extensions: 25-35% ATR for stronger momentum plays
Aggressive Setups: 40%+ ATR for breakout situations (use with caution)
Entry Strategy Integration
Pre-Market Planning:
Set ATR% threshold based on stock's typical volatility
Identify key levels where entries become unfavorable
Plan alternative entry strategies for extended stocks
Intraday Execution:
Monitor real-time ATR% extension from daily low
Avoid new long positions when threshold is exceeded
Wait for pullbacks to re-enter acceptable entry zones
This tool transforms volatility analysis into practical entry discipline, helping traders maintain consistent entry standards and avoid the costly mistake of chasing overextended stocks. By respecting ATR-based extension limits, traders can improve their entry timing and overall trade profitability.
Ratio-Adjusted McClellan Summation Index RASI NASIRatio-Adjusted McClellan Summation Index (RASI NASI)
In Book "The Complete Guide to Market Breadth Indicators" Author Gregory L. Morris states
"It is the author’s opinion that the McClellan indicators, and in particular, the McClellan Summation Index, is the single best breadth indicator available. If you had to pick just one, this would be it."
What It Does: The Ratio-Adjusted McClellan Summation Index (RASI) is a market breadth indicator that tracks the cumulative strength of advancing versus declining issues for a user-selected exchange (NASDAQ, NYSE, or AMEX). Derived from the McClellan Oscillator, it calculates ratio-adjusted net advances, applies 19-day and 39-day EMAs, and sums the oscillator values to produce the RASI. This indicator helps traders assess market health, identify bullish or bearish trends, and detect potential reversals through divergences.
Key features:
Exchange Selection : Choose NASDAQ (USI:ADVN.NQ, USI:DECL.NQ), NYSE (USI:ADVN.NY, USI:DECL.NY), or AMEX (USI:ADVN.AM, USI:DECL.AM) data.
Trend-Based Coloring : RASI line displays user-defined colors (default: black for uptrend, red for downtrend) based on its direction.
Customizable Moving Average: Add a moving average (SMA, EMA, WMA, VWMA, or RMA) with user-defined length and color (default: EMA, 21, green).
Neutral Line at Zero: Marks the neutral level for trend interpretation.
Alerts: Six custom alert conditions for trend changes, MA crosses, and zero-line crosses.
How to Use
Add to Chart: Apply the indicator to any TradingView chart. Ensure access to advancing and declining issues data for the selected exchange.
Select Exchange: Choose NASDAQ, NYSE, or AMEX in the input settings.
Customize Settings: Adjust EMA lengths, RASI colors, MA type, length, and color to match your trading style.
Interpret the Indicator :
RASI Line: Black (default) indicates an uptrend (RASI rising); red indicates a downtrend (RASI falling).
Above Zero: Suggests bullish market breadth (more advancing issues).
Below Zero : Indicates bearish breadth (more declining issues).
MA Crosses: RASI crossing above its MA signals bullish momentum; crossing below signals bearish momentum.
Divergences: Compare RASI with the market index (e.g., NASDAQ Composite) to identify potential reversals.
Large Moves : A +3,600-point move from a low (e.g., -1,550 to +1,950) may signal a significant bull run.
Set Alerts:
Add the indicator to your chart, open the TradingView alert panel, and select from six conditions (see Alerts section).
Configure notifications (e.g., email, webhook, or popup) for each condition.
Settings
Market Selection:
Exchange: Select NASDAQ, NYSE, or AMEX for advancing/declining issues data.
EMA Settings:
19-day EMA Length: Period for the shorter EMA (default: 19).
39-day EMA Length: Period for the longer EMA (default: 39).
RASI Settings:
RASI Uptrend Color: Color for rising RASI (default: black).
RASI Downtrend Color: Color for falling RASI (default: red).
RASI MA Settings:
MA Type: Choose SMA, EMA, WMA, VWMA, or RMA (default: EMA).
MA Length: Set the MA period (default: 21).
MA Color: Color for the MA line (default: green).
Alerts
The indicator uses alertcondition() to create custom alerts. Available conditions:
RASI Trend Up: RASI starts rising (based on RASI > previous RASI, shown as black line).
RASI Trend Down: RASI starts falling (based on RASI ≤ previous RASI, shown as red line).
RASI Above MA: RASI crosses above its moving average.
RASI Below MA: RASI crosses below its moving average.
RASI Bullish: RASI crosses above zero (bullish market breadth).
RASI Bearish: RASI crosses below zero (bearish market breadth).
To set alerts, add the indicator to your chart, open the TradingView alert panel, and select the desired condition.
Notes
Data Requirements: Requires access to advancing/declining issues data (e.g., USI:ADVN.NQ, USI:DECL.NQ for NASDAQ). Some symbols may require a TradingView premium subscription.
Limitations: RASI is a medium- to long-term indicator and may lag in volatile or range-bound markets. Use alongside other technical tools for confirmation.
Data Reliability : Verify the selected exchange’s data accuracy, as inconsistencies can affect results.
Debugging: If no data appears, check symbol validity (e.g., try $ADVN/Q, $DECN/Q for NASDAQ) or contact TradingView support.
Credits
Based on the Ratio-Adjusted McClellan Summation Index methodology by McClellan Financial Publications. No external code was used; the implementation is original, inspired by standard market breadth concepts.
Disclaimer
This indicator is for informational purposes only and does not constitute financial advice. Past performance is not indicative of future results. Conduct your own research and combine with other tools for informed trading decisions.
Simple Trading ChecklistCustomisable Simple Trading Checklist
This script overlays a fully customizable trading checklist directly onto your chart, providing an at-a-glance reminder of key trading steps and conditions before entering a position.
It is especially useful for discretionary or rule-based traders who want a consistent on-screen process to follow.
Nifty Trend Dashboard with RSIthis is for learning purpose only. it will show current trend and overall trend
CnagdaCnagda Indicator ek comprehensive trading tool hai jo multiple technical analysis concepts ko combine karta hai:
special thanks to - tradingview.sweetlogin.com because its modify version of Breaks and Retests with Volatility Stop
Support & Resistance Detection - Dynamic pivot-based levels
Breakout & Retest System - Precise entry/exit signals
Anchored VWAP - Volume-weighted average price from swing points
Volatility Stop - Trend-following mechanism
Moving Average Crossovers - EMA/WMA signals
Smart Alerts - Real-time notifications
🔧 Key Features
Support & Resistance System
Lookback Range: 20 bars (customizable) se pivot points detect karta hai
Dynamic Boxes: Support/resistance levels ko visual boxes ke saath display
Auto-Extension: Levels ko future bars tak extend kar sakta hai
Color Coding: Support (Red) aur Resistance (Green) ke liye alag colors
Anchored VWAP System
Swing High/Low Anchoring: Major swing points se VWAP calculate karta hai
Volume Integration: Price aur volume dono consider karta hai
Dynamic Updates: Har naye swing point par reset hota hai
Visual Markers: Anchor points ko clearly mark karta hai
Breakout Detection
Real-time Alerts: Support/resistance break hone par instant notification
Confirmation Options: Candle close confirmation ya high/low based
Repainting Control: 3 modes - On/Off with different confirmation methods
📈 Entry/Exit Strategy Guide
BUY SIGNALS (Long Entry)
Primary Entry Conditions:
Support Retest Confirmed + Price Above Anchored VWAP
Entry: Support level ka successful retest
Stop Loss: Support level ke neeche 5-10 pips
Target: Next resistance level ya 1:2 Risk-Reward
Bullish MA Crossover + Above Volatility Stop (Green)
Entry: EMA(20) crosses above WMA(50)
Stop Loss: Volatility stop level
Target: Next resistance ya swing high
Resistance Breakout + Volume Confirmation
Entry: Clean breakout above resistance box
Stop Loss: Resistance level (ab support ban gaya)
Target: Measured move ya next major level
Confirmation Filters:
✅ Anchored VWAP upward trending
✅ Volatility Stop showing green (uptrend)
✅ Price above both moving averages
✅ Volume increase during breakout
SELL SIGNALS (Short Entry)
Primary Entry Conditions:
Resistance Retest Confirmed + Price Below Anchored VWAP
Entry: Resistance level ka successful retest
Stop Loss: Resistance level ke upar 5-10 pips
Target: Next support level ya 1:2 Risk-Reward
Bearish MA Crossover + Below Volatility Stop (Red)
Entry: EMA(20) crosses below WMA(50)
Stop Loss: Volatility stop level
Target: Next support ya swing low
Support Breakout + Volume Confirmation
Entry: Clean breakdown below support box
Stop Loss: Support level (ab resistance ban gaya)
Target: Measured move ya next major level
Confirmation Filters:
✅ Anchored VWAP downward trending
✅ Volatility Stop showing red (downtrend)
✅ Price below both moving averages
✅ Volume increase during breakdown
⚠️ Risk Management Rules
Position Sizing
Maximum Risk: 1-2% per trade
Stop Loss: Always mandatory
Position Size: Calculate based on stop distance
Exit Strategy
Profit Targets:
Target 1: 1:1 Risk-Reward (book 50%)
Target 2: 1:2 Risk-Reward (book remaining)
Trailing Stops:
Use Volatility Stop as trailing mechanism
Move stop to breakeven after 1:1 achieved
Time-based Exit:
Exit if no momentum within 5-10 bars
Avoid holding overnight without clear trend
🚨 Alert System
Available Alerts:
New Support/Resistance Levels
Breakout Confirmations
Retest Signals (Potential + Confirmed)
MA Crossovers (Bullish/Bearish)
Anchored VWAP Crosses
Volatility Stop Changes
Alert Messages (Hindi):
"EMA/WMA Bullish crossover hua hai, BUY!"
"EMA/WMA Bearish crossover hua hai, SELL!"
"Price Anchored VWAP ke upar break kar gaya!"
"Naya Anchored VWAP anchor point set hua hai!"
⚙️ Customization Options
Visual Settings:
Label Types: Full descriptions ya Simple (Br, Re, P.Re)
Label Sizes: Tiny to Huge
Colors: Fully customizable for all elements
Line Styles: Dotted, Dashed, Solid
Extensions: None, Right, Left, Both
Technical Parameters:
Lookback Range: 1-100 bars
Retest Detection: 1-20 bars
MA Lengths: Customizable EMA/WMA periods
Volatility Stop: Length aur multiplier adjustable
VWAP Anchoring: Swing detection sensitivity
📋 Best Timeframes
Recommended Usage:
Scalping: 1M, 5M (quick signals)
Day Trading: 15M, 30M, 1H (balanced approach)
Swing Trading: 4H, 1D (major levels)
Market Conditions:
Trending Markets: Excellent for breakout trades
Range-bound: Perfect for retest strategies
High Volatility: Volatility stop works best
Low Volume: Wait for volume confirmation
🎯 Performance Tips
Multi-timeframe Analysis: Higher timeframe trend + lower timeframe entry
Volume Confirmation: Always check volume during breakouts
Market Context: Consider overall market sentiment
News Events: Avoid trading during major announcements
Backtesting: Test on historical data before live trading
Fibonacci Kanalları Zaman DilimliI understand that you want to fetch moving Fibonacci levels from a different timeframe (fibTimeframe) in Pine Script and plot them on the chart.
Here is a simple example code that:
Takes the timeframe input from settings (fibTimeframe),
Uses request.security() to get data from the selected timeframe,
Calculates Fibonacci levels,
Uses plot() to display the levels on the chart.
Global M2 Money Supply // Days Offset =This is the original version.. there is no update... just needed to re-install the script.
Momentum Oscillator ModifiedThis indicator is a custom momentum oscillator enhanced with True Range-adjusted price logic and dynamic Bollinger Bands, offering a refined way to track price strength, momentum shifts, and overbought/oversold extremes with reduced noise.
Key Features:
Dynamic Price Oscillator:
Measures momentum using both price change and a volatility-adjusted price for greater accuracy.
Smoothing factor lets you fine-tune the balance between responsiveness and noise filtering.
True Range-Based Volatility Adjustment:
Integrates true range calculations to adapt to current volatility, making signals more robust during different market conditions.
Adaptive Bollinger Bands:
Two sets of custom Bollinger Bands (standard and expanded) are drawn around the oscillator, adapting over time.
These bands help identify when momentum is exceptionally strong or weak relative to recent history.
Special fills dynamically highlight when the oscillator breaks above/below the bands, signaling potential trend extremes.
Customization:
Easily adjust lookback length and smoothing factor to fit your personal trading style (e.g., scalping or swing trading).
How to Use:
Watch for the oscillator crossing above the green Bollinger Bands or below the red bands for potential overbought/oversold or breakout scenarios.
Expanded bands provide a "super extreme" zone which may hint at exhaustion or trend climax.
The dynamic mean (black line) gives a visual reference for the normalized momentum level.
SulLaLuna M2 Hull DetectorAbsolutely — here's a polished **TradingView script description/article** you can publish with your indicator. It blends clarity, inspiration, respect, and community wisdom — SulLaLuna style.
---
## 🌕 SulLaLuna M2 Hull Detector 💵
### 🧠 Track Global Liquidity. Time Your Trades with Confidence.
This indicator lets you visualize shifts in global liquidity by analyzing the **aggregate Global M2 Money Supply** (adjusted by FX rates) and applying the legendary **Hull Moving Average** to detect clean trend pivots.
When **money flows in**, markets often rise.
When **liquidity contracts**, caution is wise.
> **This tool helps you detect those pivots—visually, simply, and powerfully.**
---
### 📈 How It Works
* ✅ Pulls M2 money supply from over 20 economies (adjusted to USD using FX)
* ✅ Normalizes to your current chart so you can visually track macro liquidity
* ✅ Applies **Hull MA** to smooth the trend and reduce lag
* ✅ Flags **bullish and bearish flips** with M2 markers on chart
* ✅ Optional color-coded background for macro awareness
* ✅ Fully customizable: control colors, opacity, and visibility
---
### ⚡ How to Use It
1. **Watch for a flip.**
A green "M2" label indicates rising liquidity → bullish conditions.
A red "M2" label indicates declining liquidity → caution.
2. **Look for confluence.**
Use this alongside your preferred system.
For example, we love combining it with the **Sushi Trend Indicator**.
> If **Sushi flips bullish**, and **M2 flips bullish** — strong case for a long.
> If **Sushi is bearish**, and **M2 flips bearish** — potential short setup.
> Both directions can earn, if you time it right.
3. **Apply sound risk management.**
Use stop-loss (SL), take-profit (TP), and position sizing that fits your system.
> 🔑 **"Scared money don't make no money."**
> — *Krown Chakra*
---
### 🙏 Acknowledgements
Massive thanks to:
* The **TradingView team** for the platform that empowers this kind of sharing
* The creators of public M2 and FX feeds
* The developers of the **Hull MA**, whose innovation this tool builds on
* Our fellow SulLaLuna traders — F.I.R.E. Decibels — who live and trade with purpose
---
### ⚠️ Disclaimer
This indicator is **not financial advice** and **no indicator is perfect**.
Always trade with logic, discipline, and confluence across systems.
---
If you find this helpful, please:
* ⭐ Add it to your favorites
* 💬 Drop a comment
* 🔁 Share it with a trader who needs a compass in macro chaos
Stay sharp. Stay sovereign.
— **Team SulLaLuna** 🌕
Mara JPY Bias ProMara JPY Bias Pro™ is a precision tool built for serious traders who focus on JPY and USD pairs.
This synthetic index combines USDJPY + EURJPY + GBPJPY, generating a smooth and dynamic representation of JPY strength or weakness. When the line turns green, JPY is weakening — time to look for LONG setups on XXX/JPY pairs. When red, JPY is strengthening — ideal moment for SHORT trades.
Built-in bias logic with adjustable MA-based trend detection or slope/momentum view lets you customize signals based on your strategy.
Plus, we’ve included a normalized DXY overlay, so you can track USD strength in parallel — perfect for traders working with EUR/USD, GBP/USD, USD/JPY and JPY crosses.
💡 Designed for day traders, scalpers, and smart money traders looking for clean confluence.
✅ Features:
Visual color-coded JPY bias (Green = Long / Red = Short)
Optional USD (DXY) strength overlay
Customizable MA length and bias logic
Built-in alerts for bias shifts & momentum flips
🔔 Alert-ready – never miss a reversal.
Trade smarter. Cut the noise. Stay on the right side of the move.
High Probability Buy/Sell with SL & TP High-accuracy Buy/Sell signals with dynamic SL & Target—perfect for scalpers and swing traders,Smart trading signals with built-in risk management. Never miss a move.Auto Buy/Sell entries with real-time SL & TP levels—trade with confidence.Turn signals into strategy. Precision entries, clear exits.Your all-in-one trading assistant: entry, stop loss, and take profit—automated.Built for serious traders: Clean signals, sharp exits, and solid risk-reward.
Oops Reversal-Updatedoops reversal - manas arora updated to cover only if it closes above previous day high
Multi CEX BTC Spot vs Perpetual PremiumThis Indicator shows the BTC Spot vs Perpetual premium across different CEX.
Color Change EMA 200 (3 Min)- EMA 200 locked on 3 minute time frame
- Color changes red when bearish, and green when bullish.
Drawdown Distribution Analysis (DDA) ACADEMIC FOUNDATION AND RESEARCH BACKGROUND
The Drawdown Distribution Analysis indicator implements quantitative risk management principles, drawing upon decades of academic research in portfolio theory, behavioral finance, and statistical risk modeling. This tool provides risk assessment capabilities for traders and portfolio managers seeking to understand their current position within historical drawdown patterns.
The theoretical foundation of this indicator rests on modern portfolio theory as established by Markowitz (1952), who introduced the fundamental concepts of risk-return optimization that continue to underpin contemporary portfolio management. Sharpe (1966) later expanded this framework by developing risk-adjusted performance measures, most notably the Sharpe ratio, which remains a cornerstone of performance evaluation in financial markets.
The specific focus on drawdown analysis builds upon the work of Chekhlov, Uryasev and Zabarankin (2005), who provided the mathematical framework for incorporating drawdown measures into portfolio optimization. Their research demonstrated that traditional mean-variance optimization often fails to capture the full risk profile of investment strategies, particularly regarding sequential losses. More recent work by Goldberg and Mahmoud (2017) has brought these theoretical concepts into practical application within institutional risk management frameworks.
Value at Risk methodology, as comprehensively outlined by Jorion (2007), provides the statistical foundation for the risk measurement components of this indicator. The coherent risk measures framework developed by Artzner et al. (1999) ensures that the risk metrics employed satisfy the mathematical properties required for sound risk management decisions. Additionally, the focus on downside risk follows the framework established by Sortino and Price (1994), while the drawdown-adjusted performance measures implement concepts introduced by Young (1991).
MATHEMATICAL METHODOLOGY
The core calculation methodology centers on a peak-tracking algorithm that continuously monitors the maximum price level achieved and calculates the percentage decline from this peak. The drawdown at any time t is defined as DD(t) = (P(t) - Peak(t)) / Peak(t) × 100, where P(t) represents the asset price at time t and Peak(t) represents the running maximum price observed up to time t.
Statistical distribution analysis forms the analytical backbone of the indicator. The system calculates key percentiles using the ta.percentile_nearest_rank() function to establish the 5th, 10th, 25th, 50th, 75th, 90th, and 95th percentiles of the historical drawdown distribution. This approach provides a complete picture of how the current drawdown compares to historical patterns.
Statistical significance assessment employs standard deviation bands at one, two, and three standard deviations from the mean, following the conventional approach where the upper band equals μ + nσ and the lower band equals μ - nσ. The Z-score calculation, defined as Z = (DD - μ) / σ, enables the identification of statistically extreme events, with thresholds set at |Z| > 2.5 for extreme drawdowns and |Z| > 3.0 for severe drawdowns, corresponding to confidence levels exceeding 99.4% and 99.7% respectively.
ADVANCED RISK METRICS
The indicator incorporates several risk-adjusted performance measures that extend beyond basic drawdown analysis. The Sharpe ratio calculation follows the standard formula Sharpe = (R - Rf) / σ, where R represents the annualized return, Rf represents the risk-free rate, and σ represents the annualized volatility. The system supports dynamic sourcing of the risk-free rate from the US 10-year Treasury yield or allows for manual specification.
The Sortino ratio addresses the limitation of the Sharpe ratio by focusing exclusively on downside risk, calculated as Sortino = (R - Rf) / σd, where σd represents the downside deviation computed using only negative returns. This measure provides a more accurate assessment of risk-adjusted performance for strategies that exhibit asymmetric return distributions.
The Calmar ratio, defined as Annual Return divided by the absolute value of Maximum Drawdown, offers a direct measure of return per unit of drawdown risk. This metric proves particularly valuable for comparing strategies or assets with different risk profiles, as it directly relates performance to the maximum historical loss experienced.
Value at Risk calculations provide quantitative estimates of potential losses at specified confidence levels. The 95% VaR corresponds to the 5th percentile of the drawdown distribution, while the 99% VaR corresponds to the 1st percentile. Conditional VaR, also known as Expected Shortfall, estimates the average loss in the worst 5% of scenarios, providing insight into tail risk that standard VaR measures may not capture.
To enable fair comparison across assets with different volatility characteristics, the indicator calculates volatility-adjusted drawdowns using the formula Adjusted DD = Raw DD / (Volatility / 20%). This normalization allows for meaningful comparison between high-volatility assets like cryptocurrencies and lower-volatility instruments like government bonds.
The Risk Efficiency Score represents a composite measure ranging from 0 to 100 that combines the Sharpe ratio and current percentile rank to provide a single metric for quick asset assessment. Higher scores indicate superior risk-adjusted performance relative to historical patterns.
COLOR SCHEMES AND VISUALIZATION
The indicator implements eight distinct color themes designed to accommodate different analytical preferences and market contexts. The EdgeTools theme employs a corporate blue palette that matches the design system used throughout the edgetools.org platform, ensuring visual consistency across analytical tools.
The Gold theme specifically targets precious metals analysis with warm tones that complement gold chart analysis, while the Quant theme provides a grayscale scheme suitable for analytical environments that prioritize clarity over aesthetic appeal. The Behavioral theme incorporates psychology-based color coding, using green to represent greed-driven market conditions and red to indicate fear-driven environments.
Additional themes include Ocean, Fire, Matrix, and Arctic schemes, each designed for specific market conditions or user preferences. All themes function effectively with both dark and light mode trading platforms, ensuring accessibility across different user interface configurations.
PRACTICAL APPLICATIONS
Asset allocation and portfolio construction represent primary use cases for this analytical framework. When comparing multiple assets such as Bitcoin, gold, and the S&P 500, traders can examine Risk Efficiency Scores to identify instruments offering superior risk-adjusted performance. The 95% VaR provides worst-case scenario comparisons, while volatility-adjusted drawdowns enable fair comparison despite varying volatility profiles.
The practical decision framework suggests that assets with Risk Efficiency Scores above 70 may be suitable for aggressive portfolio allocations, scores between 40 and 70 indicate moderate allocation potential, and scores below 40 suggest defensive positioning or avoidance. These thresholds should be adjusted based on individual risk tolerance and market conditions.
Risk management and position sizing applications utilize the current percentile rank to guide allocation decisions. When the current drawdown ranks above the 75th percentile of historical data, indicating that current conditions are better than 75% of historical periods, position increases may be warranted. Conversely, when percentile rankings fall below the 25th percentile, indicating elevated risk conditions, position reductions become advisable.
Institutional portfolio monitoring applications include hedge fund risk dashboard implementations where multiple strategies can be monitored simultaneously. Sharpe ratio tracking identifies deteriorating risk-adjusted performance across strategies, VaR monitoring ensures portfolios remain within established risk limits, and drawdown duration tracking provides valuable information for investor reporting requirements.
Market timing applications combine the statistical analysis with trend identification techniques. Strong buy signals may emerge when risk levels register as "Low" in conjunction with established uptrends, while extreme risk levels combined with downtrends may indicate exit or hedging opportunities. Z-scores exceeding 3.0 often signal statistically oversold conditions that may precede trend reversals.
STATISTICAL SIGNIFICANCE AND VALIDATION
The indicator provides 95% confidence intervals around current drawdown levels using the standard formula CI = μ ± 1.96σ. This statistical framework enables users to assess whether current conditions fall within normal market variation or represent statistically significant departures from historical patterns.
Risk level classification employs a dynamic assessment system based on percentile ranking within the historical distribution. Low risk designation applies when current drawdowns perform better than 50% of historical data, moderate risk encompasses the 25th to 50th percentile range, high risk covers the 10th to 25th percentile range, and extreme risk applies to the worst 10% of historical drawdowns.
Sample size considerations play a crucial role in statistical reliability. For daily data, the system requires a minimum of 252 trading days (approximately one year) but performs better with 500 or more observations. Weekly data analysis benefits from at least 104 weeks (two years) of history, while monthly data requires a minimum of 60 months (five years) for reliable statistical inference.
IMPLEMENTATION BEST PRACTICES
Parameter optimization should consider the specific characteristics of different asset classes. Equity analysis typically benefits from 500-day lookback periods with 21-day smoothing, while cryptocurrency analysis may employ 365-day lookback periods with 14-day smoothing to account for higher volatility patterns. Fixed income analysis often requires longer lookback periods of 756 days with 34-day smoothing to capture the lower volatility environment.
Multi-timeframe analysis provides hierarchical risk assessment capabilities. Daily timeframe analysis supports tactical risk management decisions, weekly analysis informs strategic positioning choices, and monthly analysis guides long-term allocation decisions. This hierarchical approach ensures that risk assessment occurs at appropriate temporal scales for different investment objectives.
Integration with complementary indicators enhances the analytical framework. Trend indicators such as RSI and moving averages provide directional bias context, volume analysis helps confirm the severity of drawdown conditions, and volatility measures like VIX or ATR assist in market regime identification.
ALERT SYSTEM AND AUTOMATION
The automated alert system monitors five distinct categories of risk events. Risk level changes trigger notifications when drawdowns move between risk categories, enabling proactive risk management responses. Statistical significance alerts activate when Z-scores exceed established threshold levels of 2.5 or 3.0 standard deviations.
New maximum drawdown alerts notify users when historical maximum levels are exceeded, indicating entry into uncharted risk territory. Poor risk efficiency alerts trigger when the composite risk efficiency score falls below 30, suggesting deteriorating risk-adjusted performance. Sharpe ratio decline alerts activate when risk-adjusted performance turns negative, indicating that returns no longer compensate for the risk undertaken.
TRADING STRATEGIES
Conservative risk parity strategies can be implemented by monitoring Risk Efficiency Scores across a diversified asset portfolio. Monthly rebalancing maintains equal risk contribution from each asset, with allocation reductions triggered when risk levels reach "High" status and complete exits executed when "Extreme" risk levels emerge. This approach typically results in lower overall portfolio volatility, improved risk-adjusted returns, and reduced maximum drawdown periods.
Tactical asset rotation strategies compare Risk Efficiency Scores across different asset classes to guide allocation decisions. Assets with scores exceeding 60 receive overweight allocations, while assets scoring below 40 receive underweight positions. Percentile rankings provide timing guidance for allocation adjustments, creating a systematic approach to asset allocation that responds to changing risk-return profiles.
Market timing strategies with statistical edges can be constructed by entering positions when Z-scores fall below -2.5, indicating statistically oversold conditions, and scaling out when Z-scores exceed 2.5, suggesting overbought conditions. The 95% VaR serves as a stop-loss reference point, while trend confirmation indicators provide additional validation for position entry and exit decisions.
LIMITATIONS AND CONSIDERATIONS
Several statistical limitations affect the interpretation and application of these risk measures. Historical bias represents a fundamental challenge, as past drawdown patterns may not accurately predict future risk characteristics, particularly during structural market changes or regime shifts. Sample dependence means that results can be sensitive to the selected lookback period, with shorter periods providing more responsive but potentially less stable estimates.
Market regime changes can significantly alter the statistical parameters underlying the analysis. During periods of structural market evolution, historical distributions may provide poor guidance for future expectations. Additionally, many financial assets exhibit return distributions with fat tails that deviate from normal distribution assumptions, potentially leading to underestimation of extreme event probabilities.
Practical limitations include execution risk, where theoretical signals may not translate directly into actual trading results due to factors such as slippage, timing delays, and market impact. Liquidity constraints mean that risk metrics assume perfect liquidity, which may not hold during stressed market conditions when risk management becomes most critical.
Transaction costs are not incorporated into risk-adjusted return calculations, potentially overstating the attractiveness of strategies that require frequent trading. Behavioral factors represent another limitation, as human psychology may override statistical signals, particularly during periods of extreme market stress when disciplined risk management becomes most challenging.
TECHNICAL IMPLEMENTATION
Performance optimization ensures reliable operation across different market conditions and timeframes. All technical analysis functions are extracted from conditional statements to maintain Pine Script compliance and ensure consistent execution. Memory efficiency is achieved through optimized variable scoping and array usage, while computational speed benefits from vectorized calculations where possible.
Data quality requirements include clean price data without gaps or errors that could distort distribution analysis. Sufficient historical data is essential, with a minimum of 100 bars required and 500 or more preferred for reliable statistical inference. Time alignment across related assets ensures meaningful comparison when conducting multi-asset analysis.
The configuration parameters are organized into logical groups to enhance usability. Core settings include the Distribution Analysis Period (100-2000 bars), Drawdown Smoothing Period (1-50 bars), and Price Source selection. Advanced metrics settings control risk-free rate sourcing, either from live market data or fixed rate specification, along with toggles for various risk-adjusted metric calculations.
Display options provide flexibility in visual presentation, including color theme selection from eight available schemes, automatic dark mode optimization, and control over table display, position lines, percentile bands, and standard deviation overlays. These options ensure that the indicator can be adapted to different analytical workflows and visual preferences.
CONCLUSION
The Drawdown Distribution Analysis indicator provides risk management tools for traders seeking to understand their current position within historical risk patterns. By combining established statistical methodology with practical usability features, the tool enables evidence-based risk assessment and portfolio optimization decisions.
The implementation draws upon established academic research while providing practical features that address real-world trading requirements. Dynamic risk-free rate integration ensures accurate risk-adjusted performance calculations, while multiple color schemes accommodate different analytical preferences and use cases.
Academic compliance is maintained through transparent methodology and acknowledgment of limitations. The tool implements peer-reviewed statistical techniques while clearly communicating the constraints and assumptions underlying the analysis. This approach ensures that users can make informed decisions about the appropriate application of the risk assessment framework within their broader trading and investment processes.
BIBLIOGRAPHY
Artzner, P., Delbaen, F., Eber, J.M. and Heath, D. (1999) 'Coherent Measures of Risk', Mathematical Finance, 9(3), pp. 203-228.
Chekhlov, A., Uryasev, S. and Zabarankin, M. (2005) 'Drawdown Measure in Portfolio Optimization', International Journal of Theoretical and Applied Finance, 8(1), pp. 13-58.
Goldberg, L.R. and Mahmoud, O. (2017) 'Drawdown: From Practice to Theory and Back Again', Journal of Risk Management in Financial Institutions, 10(2), pp. 140-152.
Jorion, P. (2007) Value at Risk: The New Benchmark for Managing Financial Risk. 3rd edn. New York: McGraw-Hill.
Markowitz, H. (1952) 'Portfolio Selection', Journal of Finance, 7(1), pp. 77-91.
Sharpe, W.F. (1966) 'Mutual Fund Performance', Journal of Business, 39(1), pp. 119-138.
Sortino, F.A. and Price, L.N. (1994) 'Performance Measurement in a Downside Risk Framework', Journal of Investing, 3(3), pp. 59-64.
Young, T.W. (1991) 'Calmar Ratio: A Smoother Tool', Futures, 20(1), pp. 40-42.
TraderOracle MethodCatboy buy and sell. This indicator will show buy and sell signals on market direction
Insane OscillatorCatboy buy and sell. This indicator will show buy and sell signals on market direction
TraderOracle MethodCatboy buy and sell. This indicator will show buy and sell signals on market direction
PayBack by CatboyCatboy buy and sell. This indicator will show buy and sell signals on market direction