OPEN-SOURCE SCRIPT
VolumeAnlaysis

### Volume Analysis (VA) Indicator
**Overview**
The Volume Analysis (VA) indicator is a dynamic overlay tool designed for traders seeking to identify high-volume breakouts, retests, and multi-timeframe volume-driven price cycles. By combining volume spikes with price action and support/resistance boxes, it highlights potential trend continuations, reversals, and cycle shifts. Ideal for intraday and swing trading on stocks, forex, or crypto, it uses a Fibonacci-inspired 1.618 multiplier to detect significant volume surges, then maps them to visual boxes and key levels for actionable insights.
This indicator draws from volume profile concepts but focuses on **breakout confirmation** and **cycle momentum**, helping you spot when "smart money" volume aligns with price extremes. It's particularly useful in volatile markets where volume precedes price moves.
**How It Works**
1. **Volume Break Detection**:
- Identifies a "Volume Break" when the current bar's volume exceeds 1.618x the highest volume from the prior 5 bars. This signals unusual activity, often preceding breakouts.
- A "Volume Retest" triggers exactly 3 bars after a break if volume has been falling steadily over those 3 bars—indicating a pullback for re-accumulation/distribution.
2. **Visual Annotations**:
- **Labels**: Green/red/yellow labels mark Volume Breaks and Retests, positioned above/below the bar based on candle direction for clarity.
- **Demand/Supply Boxes**:
- Blue semi-transparent boxes form around Retest bars, extending rightward to act as dynamic support/resistance.
- Green (bullish) or red (bearish) boxes draw from Volume Breaks, based on the original candle's open/close, highlighting potential zones for continuation.
- Limited to 5 boxes max to avoid chart clutter; older boxes fade as new ones form.
3. **Box Interaction Signals**:
- When price enters a box:
- **Reversal Hints**: Maroon (bearish rejection) or lime (bullish rejection) labels on closes against the trend with opening price momentum.
- **Breakout Arrows**: Up/down arrows on crossovers/crossunders of box tops/bottoms from Retest boxes.
- Scans all active boxes for interactions, prioritizing recent volume events.
4. **Multi-Timeframe Volume Cycles**:
- Aggregates the "Volume Break Max" level (a proxy for key price extremes tied to volume spikes) across timeframes: 1min, 5min, 10min, 30min, and 65min (using `request.security`).
- Computes **MaxVolBreak** (highest extreme) and **MinVolBreak** (lowest extreme) for trend-following levels.
- Tracks **Percent Volume Greater/Less Than Close**: Sums volumes from TFs where price is below/above these levels, creating a momentum ratio.
- **CrossClose**: Plots the prior close where this ratio crosses (gray line), signaling cycle shifts—bullish below MinVolBreak, bearish above MaxVolBreak.
- **Fills**: Red fill above CrossClose/MaxVolBreak (bearish cycle); green below CrossClose/MinVolBreak (bullish cycle).
5. **Plots**:
- Black lines for MaxVolBreak (⏫) and MinVolBreak (⏬).
- Gray 🔄 for CrossClose.
- Colors dynamically adjust (green/red) based on close relative to levels.
**Key Features**
- **Trend vs. Reversal Modes**: Toggle alerts for trend-following breaks (crosses of Max/MinVolBreak) or reversal signals (crosses of CrossClose).
- **Multi-TF Fusion**: Optionally include the chart's native timeframe in Max/Min calculations for finer tuning.
- **Box Management**: Auto-prunes to 5 boxes; focuses on retest/break alignments for "inside bar" logic.
- **Momentum Filters**: Uses rising/falling opens and crossovers for label precision, reducing noise.
- **Customizable**: Simple inputs for alert visibility and timeframe inclusion.
**Settings**
| Input | Default | Description |
|-------|---------|-------------|
| Show Volume Reversal Breaks | False | Enables alerts/labels for CrossClose crosses (cycle reversals). |
| Show Trend Following Breaks | True | Enables alerts for Max/MinVolBreak crosses (trend signals). |
| Use Current Time | False | Includes chart's native TF in multi-TF Max/Min calculations. |
**Alerts**
- **Reversal Alerts** (if enabled): "Volume Reverse Bullish/Bearish Break of [level]" on close crosses of CrossClose.
- **Trend Alerts** (if enabled): "Trend Volume Bullish/Bearish Signal" on close crosses of Max/MinVolBreak; plus notes if prior low/high aligns with levels.
- All alerts include ticker and level value for easy scanning. Use `alert.freq_once_per_bar` to avoid spam.
**Trading Ideas**
- **Bullish Entry**: Green box formation + price holding MinVolBreak + upward arrow on retest box. Target next resistance.
- **Bearish Entry**: Red box + close above MaxVolBreak + red fill activation. Stop below recent low.
- **Cycle Trading**: Watch CrossClose crosses for regime shifts—fade extremes in overextended cycles.
- **Best Timeframes**: 5-30min for intraday; combine with daily for swings. Works best on liquid assets with reliable volume data.
**Limitations & Notes**
- Relies on accurate volume data (e.g., stocks/forex); less effective on low-volume or synthetic instruments.
- Boxes extend rightward but don't auto-delete—monitor for clutter on long histories (max_bars_back=500).
- Some logic (e.g., exact 3-bar retest) is rigid; backtest for your market.
- Open-source under MPL 2.0—fork and tweak as needed!
For questions or enhancements, drop a comment below. Happy trading! 🚀
**Overview**
The Volume Analysis (VA) indicator is a dynamic overlay tool designed for traders seeking to identify high-volume breakouts, retests, and multi-timeframe volume-driven price cycles. By combining volume spikes with price action and support/resistance boxes, it highlights potential trend continuations, reversals, and cycle shifts. Ideal for intraday and swing trading on stocks, forex, or crypto, it uses a Fibonacci-inspired 1.618 multiplier to detect significant volume surges, then maps them to visual boxes and key levels for actionable insights.
This indicator draws from volume profile concepts but focuses on **breakout confirmation** and **cycle momentum**, helping you spot when "smart money" volume aligns with price extremes. It's particularly useful in volatile markets where volume precedes price moves.
**How It Works**
1. **Volume Break Detection**:
- Identifies a "Volume Break" when the current bar's volume exceeds 1.618x the highest volume from the prior 5 bars. This signals unusual activity, often preceding breakouts.
- A "Volume Retest" triggers exactly 3 bars after a break if volume has been falling steadily over those 3 bars—indicating a pullback for re-accumulation/distribution.
2. **Visual Annotations**:
- **Labels**: Green/red/yellow labels mark Volume Breaks and Retests, positioned above/below the bar based on candle direction for clarity.
- **Demand/Supply Boxes**:
- Blue semi-transparent boxes form around Retest bars, extending rightward to act as dynamic support/resistance.
- Green (bullish) or red (bearish) boxes draw from Volume Breaks, based on the original candle's open/close, highlighting potential zones for continuation.
- Limited to 5 boxes max to avoid chart clutter; older boxes fade as new ones form.
3. **Box Interaction Signals**:
- When price enters a box:
- **Reversal Hints**: Maroon (bearish rejection) or lime (bullish rejection) labels on closes against the trend with opening price momentum.
- **Breakout Arrows**: Up/down arrows on crossovers/crossunders of box tops/bottoms from Retest boxes.
- Scans all active boxes for interactions, prioritizing recent volume events.
4. **Multi-Timeframe Volume Cycles**:
- Aggregates the "Volume Break Max" level (a proxy for key price extremes tied to volume spikes) across timeframes: 1min, 5min, 10min, 30min, and 65min (using `request.security`).
- Computes **MaxVolBreak** (highest extreme) and **MinVolBreak** (lowest extreme) for trend-following levels.
- Tracks **Percent Volume Greater/Less Than Close**: Sums volumes from TFs where price is below/above these levels, creating a momentum ratio.
- **CrossClose**: Plots the prior close where this ratio crosses (gray line), signaling cycle shifts—bullish below MinVolBreak, bearish above MaxVolBreak.
- **Fills**: Red fill above CrossClose/MaxVolBreak (bearish cycle); green below CrossClose/MinVolBreak (bullish cycle).
5. **Plots**:
- Black lines for MaxVolBreak (⏫) and MinVolBreak (⏬).
- Gray 🔄 for CrossClose.
- Colors dynamically adjust (green/red) based on close relative to levels.
**Key Features**
- **Trend vs. Reversal Modes**: Toggle alerts for trend-following breaks (crosses of Max/MinVolBreak) or reversal signals (crosses of CrossClose).
- **Multi-TF Fusion**: Optionally include the chart's native timeframe in Max/Min calculations for finer tuning.
- **Box Management**: Auto-prunes to 5 boxes; focuses on retest/break alignments for "inside bar" logic.
- **Momentum Filters**: Uses rising/falling opens and crossovers for label precision, reducing noise.
- **Customizable**: Simple inputs for alert visibility and timeframe inclusion.
**Settings**
| Input | Default | Description |
|-------|---------|-------------|
| Show Volume Reversal Breaks | False | Enables alerts/labels for CrossClose crosses (cycle reversals). |
| Show Trend Following Breaks | True | Enables alerts for Max/MinVolBreak crosses (trend signals). |
| Use Current Time | False | Includes chart's native TF in multi-TF Max/Min calculations. |
**Alerts**
- **Reversal Alerts** (if enabled): "Volume Reverse Bullish/Bearish Break of [level]" on close crosses of CrossClose.
- **Trend Alerts** (if enabled): "Trend Volume Bullish/Bearish Signal" on close crosses of Max/MinVolBreak; plus notes if prior low/high aligns with levels.
- All alerts include ticker and level value for easy scanning. Use `alert.freq_once_per_bar` to avoid spam.
**Trading Ideas**
- **Bullish Entry**: Green box formation + price holding MinVolBreak + upward arrow on retest box. Target next resistance.
- **Bearish Entry**: Red box + close above MaxVolBreak + red fill activation. Stop below recent low.
- **Cycle Trading**: Watch CrossClose crosses for regime shifts—fade extremes in overextended cycles.
- **Best Timeframes**: 5-30min for intraday; combine with daily for swings. Works best on liquid assets with reliable volume data.
**Limitations & Notes**
- Relies on accurate volume data (e.g., stocks/forex); less effective on low-volume or synthetic instruments.
- Boxes extend rightward but don't auto-delete—monitor for clutter on long histories (max_bars_back=500).
- Some logic (e.g., exact 3-bar retest) is rigid; backtest for your market.
- Open-source under MPL 2.0—fork and tweak as needed!
For questions or enhancements, drop a comment below. Happy trading! 🚀
オープンソーススクリプト
TradingViewの精神に則り、この作者はスクリプトのソースコードを公開しているので、その内容を理解し検証することができます。作者に感謝です!無料でお使いいただけますが、このコードを投稿に再利用する際にはハウスルールに従うものとします。
免責事項
これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。
オープンソーススクリプト
TradingViewの精神に則り、この作者はスクリプトのソースコードを公開しているので、その内容を理解し検証することができます。作者に感謝です!無料でお使いいただけますが、このコードを投稿に再利用する際にはハウスルールに従うものとします。
免責事項
これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。