PROTECTED SOURCE SCRIPT
SK Volume Pane [CLEVER]

This Pine Script indicator, named "SK Volume Pane," is a comprehensive volume analysis tool designed for the TradingView platform. It appears in its own separate pane below the main price chart (overlay=false) and combines several features to help traders identify volume-based trends and potential reversals.
Here is a breakdown of its key components and functionality:
XAUUSD
1. Core Volume Plotting
Volume Bars: The primary function is to display volume as vertical columns.
Color Coding: The volume bars are colored based on the candle that produced them:
Lime: Volume from an "up" bar (closing price higher than the opening price).
Red: Volume from a "down" bar (closing price lower than the opening price).
Gray: Volume from a "neutral" bar (opening and closing prices are the same).
2. Volume Moving Average (MA)
An input toggle (Show Volume MA) allows the user to display a Simple Moving Average (SMA) of the volume.
The default length for this MA is 20 periods, and it is plotted in yellow. This helps smooth the volume data and identify whether current volume is above or below its recent average.
3. Volume Divergence Detection
This is a major feature of the indicator. It automatically identifies four types of divergence between price action (highs/lows) and volume action (highs/lows) using pivot points:
Regular Bullish Divergence (Lime lines/triangles): Price makes a lower low, but volume makes a higher low. This often signals a potential upward reversal.
Hidden Bullish Divergence (Aqua lines/triangles): Price makes a higher low, but volume makes a lower low. This often signals a continuation of an existing uptrend.
Regular Bearish Divergence (Red lines/triangles): Price makes a higher high, but volume makes a lower high. This often signals a potential downward reversal.
Hidden Bearish Divergence (Orange lines/triangles): Price makes a lower high, but volume makes a higher high. This often signals a continuation of an existing downtrend.
When a divergence is detected, the indicator draws colored lines connecting the relevant pivots and places small triangles or "Buy"/"Sell" labels at the bottom of the pane (using location.absolute) to highlight the signal bar.
4. Daily/Weekly Statistics Table
An optional table can be displayed in the top-right corner of the chart that provides a summary of the divergence signals over current daily and weekly periods:
Buys/Sells: The count of "Buy" (bullish divergence) and "Sell" (bearish divergence) signals triggered in the current day/week.
BuyQty/SellQty: The total volume accumulated during those signals.
Trend: A calculated "Day" or "Week" trend status (Bullish, Bearish, or Neutral) based on which signal count is higher, with corresponding color coding.
Summary of User Inputs
Traders can customize the indicator's behavior through several input options:
Input Name Description Default Setting
Show Volume MA Toggles the volume moving average line. True
Volume MA Length Periods for the volume SMA. 20
Up/Down/Neutral Color Color selection for volume bars. Lime/Red/Gray
Show Volume Divergence Toggles the divergence detection feature. True
Divergence Pivot Length Sensitivity for pivot detection (how wide the price/volume swings must be). 5
Show Buy/Sell Labels Toggles the "Buy"/"Sell" text labels. True
Show Stats Table Toggles the daily/weekly summary table. True
Here is a breakdown of its key components and functionality:
1. Core Volume Plotting
Volume Bars: The primary function is to display volume as vertical columns.
Color Coding: The volume bars are colored based on the candle that produced them:
Lime: Volume from an "up" bar (closing price higher than the opening price).
Red: Volume from a "down" bar (closing price lower than the opening price).
Gray: Volume from a "neutral" bar (opening and closing prices are the same).
2. Volume Moving Average (MA)
An input toggle (Show Volume MA) allows the user to display a Simple Moving Average (SMA) of the volume.
The default length for this MA is 20 periods, and it is plotted in yellow. This helps smooth the volume data and identify whether current volume is above or below its recent average.
3. Volume Divergence Detection
This is a major feature of the indicator. It automatically identifies four types of divergence between price action (highs/lows) and volume action (highs/lows) using pivot points:
Regular Bullish Divergence (Lime lines/triangles): Price makes a lower low, but volume makes a higher low. This often signals a potential upward reversal.
Hidden Bullish Divergence (Aqua lines/triangles): Price makes a higher low, but volume makes a lower low. This often signals a continuation of an existing uptrend.
Regular Bearish Divergence (Red lines/triangles): Price makes a higher high, but volume makes a lower high. This often signals a potential downward reversal.
Hidden Bearish Divergence (Orange lines/triangles): Price makes a lower high, but volume makes a higher high. This often signals a continuation of an existing downtrend.
When a divergence is detected, the indicator draws colored lines connecting the relevant pivots and places small triangles or "Buy"/"Sell" labels at the bottom of the pane (using location.absolute) to highlight the signal bar.
4. Daily/Weekly Statistics Table
An optional table can be displayed in the top-right corner of the chart that provides a summary of the divergence signals over current daily and weekly periods:
Buys/Sells: The count of "Buy" (bullish divergence) and "Sell" (bearish divergence) signals triggered in the current day/week.
BuyQty/SellQty: The total volume accumulated during those signals.
Trend: A calculated "Day" or "Week" trend status (Bullish, Bearish, or Neutral) based on which signal count is higher, with corresponding color coding.
Summary of User Inputs
Traders can customize the indicator's behavior through several input options:
Input Name Description Default Setting
Show Volume MA Toggles the volume moving average line. True
Volume MA Length Periods for the volume SMA. 20
Up/Down/Neutral Color Color selection for volume bars. Lime/Red/Gray
Show Volume Divergence Toggles the divergence detection feature. True
Divergence Pivot Length Sensitivity for pivot detection (how wide the price/volume swings must be). 5
Show Buy/Sell Labels Toggles the "Buy"/"Sell" text labels. True
Show Stats Table Toggles the daily/weekly summary table. True
Script protegido
Este script se publica como código cerrado. No obstante, puede utilizarlo libremente y sin ninguna limitación. Obtenga más información aquí.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como asesoramiento o recomendaciones financieras, de inversión, de trading o de otro tipo proporcionadas o respaldadas por TradingView. Más información en Condiciones de uso.
Script protegido
Este script se publica como código cerrado. No obstante, puede utilizarlo libremente y sin ninguna limitación. Obtenga más información aquí.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como asesoramiento o recomendaciones financieras, de inversión, de trading o de otro tipo proporcionadas o respaldadas por TradingView. Más información en Condiciones de uso.