OPEN-SOURCE SCRIPT
Cosmic Volume Analyzer [JOAT]

Cosmic Volume Analyzer - Astrophysics Edition
Overview
Cosmic Volume Analyzer is an open-source oscillator indicator that applies astrophysics-inspired concepts to volume analysis. It classifies volume into buy/sell categories, calculates volume flow, detects accumulation/distribution phases, identifies climax volume events, and uses gravitational and stellar mass analogies to visualize volume dynamics.
What This Indicator Does
The indicator calculates and displays:
- Volume Classification - Categorizes each bar as CLIMAX_BUY, CLIMAX_SELL, HIGH_BUY, HIGH_SELL, NORMAL_BUY, or NORMAL_SELL
- Volume Flow - Percentage showing buy vs sell pressure over a lookback period
- Buy/Sell Volume - Separated volume based on candle direction
- Accumulation/Distribution - Phase detection using Money Flow Multiplier
- Volume Oscillator - Fast vs slow volume EMA comparison
- Gravitational Pull - Volume-weighted price attraction metric
- Stellar Mass Index - Volume ratio combined with price momentum
- Black Hole Detection - Identifies extremely low volume periods (liquidity voids)
- Supernova Events - Detects extreme volume with extreme price movement
- Orbital Cycles - Sine-wave based cyclical visualization
How It Works
Volume classification uses volume ratio and candle direction:
classifyVolume(series float vol, series float close, series float open) =>
float avgVol = ta.sma(vol, 20)
float volRatio = avgVol > 0 ? vol / avgVol : 1.0
if volRatio > 1.5
if close > open
classification := "CLIMAX_BUY"
else
classification := "CLIMAX_SELL"
else if volRatio > 1.2
// HIGH_BUY or HIGH_SELL
else
// NORMAL_BUY or NORMAL_SELL
Volume flow separates buy and sell volume over a period:
calculateVolumeFlow(series float vol, series float close, simple int period) =>
float currentBuyVol = close > open ? vol : 0.0
float currentSellVol = close < open ? vol : 0.0
// Accumulate in buffers
float flow = (buyVolume - sellVolume) / totalVol * 100
Accumulation/Distribution uses the Money Flow Multiplier:
float mfm = ((close - low) - (high - close)) / (high - low)
float mfv = mfm * vol
float adLine = ta.cum(mfv)
if adLine > adEMA and ta.rising(adLine, 3)
phase := "ACCUMULATION"
else if adLine < adEMA and ta.falling(adLine, 3)
phase := "DISTRIBUTION"
Gravitational pull uses volume-weighted price distance:
gravitationalPull(series float vol, series float price, simple int period) =>
float massCenter = ta.vwma(price, period)
float distance = math.abs(price - massCenter)
float mass = vol / ta.sma(vol, period)
float gravity = distance > 0 ? mass / (distance * distance) : 0.0
Signal Generation
Signals are generated based on volume conditions:
- Buy Climax: Volume exceeds 2 standard deviations above average on bullish candle
- Sell Climax: Volume exceeds 2 standard deviations above average on bearish candle
- Strong Buy Flow: Volume flow exceeds positive threshold (default 45%)
- Strong Sell Flow: Volume flow exceeds negative threshold (default -45%)
- Supernova: Volume 3x average AND price change 3x average
- Black Hole: Volume 2 standard deviations below average
Dashboard Panel (Top-Right)
- Volume Class - Current volume classification
- Volume Flow - Buy/sell flow percentage
- Buy Volume - Accumulated buy volume
- Sell Volume - Accumulated sell volume
- A/D Phase - ACCUMULATION/DISTRIBUTION/NEUTRAL
- Volume Strength - Normalized volume strength
- Gravity Pull - Current gravitational metric
- Stellar Mass - Current stellar mass index
- Cosmic Field - Combined cosmic field strength
- Black Hole - Detection status and void strength
- Signal - Current actionable status
Visual Elements
- Volume Ratio Columns - Colored bars showing normalized volume
- Volume Flow Line - Main oscillator showing flow direction
- Flow EMA - Smoothed flow for trend reference
- Volume Oscillator - Area plot showing fast/slow comparison
- Gravity Field - Area plot showing gravitational pull
- Orbital Cycle - Circle plots showing cyclical pattern
- Stellar Mass Line - Line showing mass index
- Climax Markers - Fire emoji for buy climax, snowflake for sell climax
- Supernova Markers - Diamond shapes for extreme events
- Black Hole Markers - X-cross for liquidity voids
- A/D Phase Background - Subtle background color based on phase
Input Parameters
- Volume Period (default: 20) - Period for volume calculations
- Distribution Levels (default: 5) - Granularity of distribution analysis
- Flow Threshold (default: 1.5) - Multiplier for flow significance
- Accumulation Period (default: 14) - Period for A/D calculation
- Gravitational Analysis (default: true) - Enable gravity metrics
- Black Hole Detection (default: true) - Enable void detection
- Stellar Mass Calculation (default: true) - Enable mass index
- Orbital Cycles (default: true) - Enable cyclical visualization
- Supernova Detection (default: true) - Enable extreme event detection
Suggested Use Cases
- Identify accumulation phases for potential long entries
- Watch for distribution phases as potential exit signals
- Use climax volume as potential exhaustion indicators
- Monitor volume flow for directional bias
- Avoid trading during black hole (low liquidity) periods
- Watch for supernova events as potential trend acceleration
Timeframe Recommendations
Best on 15m to Daily charts. Volume analysis requires sufficient trading activity for meaningful readings.
Limitations
- Volume data quality varies by exchange and instrument
- Buy/sell separation is based on candle direction, not actual order flow
- Astrophysics concepts are analogies, not literal physics
- A/D phase detection may lag during rapid transitions
Open-Source and Disclaimer
This script is published as open-source under the Mozilla Public License 2.0 for educational purposes. It does not constitute financial advice. Past performance does not guarantee future results. Always use proper risk management.
- Made with passion by officialjackofalltrades
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
#1 Full Stack AI Trading Community — jackofalltrades.vip | 2026: The Era of AI Trading Mastery📈 AI Automation • AI Trading Bots • Indicators • Strategies • Limitless Potential • Institutional Grade Products • t.me/jackofalltradesvip
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
#1 Full Stack AI Trading Community — jackofalltrades.vip | 2026: The Era of AI Trading Mastery📈 AI Automation • AI Trading Bots • Indicators • Strategies • Limitless Potential • Institutional Grade Products • t.me/jackofalltradesvip
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.