OPEN-SOURCE SCRIPT
Volume Spike Alert & Overlay

"Volume Spike Alert & Overlay" highlights unusually high trading volume on a chart. It calculates whether the current volume exceeds a user-defined percentage above the historical average and triggers an alert if it does. The information is also displayed in a customizable on-screen table.
What It Does
Displays a table on the chart with:
How It Works
User Inputs:
Volume Calculations:
Table Display:
Alerts:
Usage Examples
Example 1: Spotting High Activity
Apply the script to a stock like AAPL on a 5-minute chart.
Set lookbackPeriods to 20 and thresholdPercent to 30.
Use EMA for more reactive volume tracking.
When volume spikes more than 30% above the 20-period EMA, an alert triggers.
Example 2: Day Trading Filter
For scalpers, apply it to a 1-minute crypto chart (e.g., BTC/USDT).
Set thresholdPercent to 50 to catch only strong surges.
Position the table at the top left and reduce visible info for a clean layout.
Example 3: Long-Term Context
On a daily chart, use SMA and set lookbackPeriods to 50.
Helps identify breakout moves supported by strong volume.
How this is different from Trading View's Volume indicator:
The standard volume plot from trading view allows users to set a alert when the average line is crossed, but it does not allow you to set a custom percentage at which to trigger an alert. This indicator will allow you to set any percentage you wish to monitor and above that percentage threshold will trigger your alert.
===== ORIGINAL DESCRIPTION =====
Volume Spike Alert & Overlay
This indicator will display the following as an overlay on your chart:
Current volume
Average Volume
Threshold for Alert
Description:
This indicator will display the current bar volume based on the chart time frame,
display the average volume based on selected conditions,
allow user selectable threshold over the average volume to trigger an alert.
Options:
Average lookback period
Smoothing type
Alert Threshold %
Enable / Disable Each Value
Change Text Color
Change Background Color
Change Table location
Add/Remove extra row for placement in top corner
Usage Example:
I use this indicator to alert when the current volume exceeds the average volume by a specified percentage to alert to volume spikes.
Set the threshold to 25% in the settings
Create an alert by clicking on the 3 dots on the right of the indicator title on the chart
When the threshold is exceeded the alert will trigger
What It Does
- Monitors volume for each bar and compares it to an average over a user-defined lookback period.
- Supports multiple smoothing methods (SMA, EMA, WMA, RMA) for calculating the average volume.
- Triggers an alert when current volume exceeds the threshold percentage above the average.
Displays a table on the chart with:
- Current Volume
- Average Volume
- Threshold Percentage
- Optional empty row for spacing/formatting
How It Works
User Inputs:
- lookbackPeriods: Number of bars used to calculate the average volume.
- thresholdPercent: % above the average that triggers a volume spike alert.
- smoothingType: Type of moving average used for volume calculation.
- textColor, bgColor: Formatting for the display table.
- tablePositionInput: Where the table appears on the chart (e.g., Bottom Right).
- Toggles for showing/hiding parts of the table.
Volume Calculations:
- Calculates current bar's volume.
- Calculates average volume using the selected smoothing method.
- Computes the threshold: avgVol * (1 + thresholdPercent / 100).
- Compares current volume to threshold.
Table Display:
- Dynamically creates a table with volume stats.
- Adds rows based on user preferences.
Alerts:
- alertcondition fires when currentVol crosses above the calculated threshold.
- Message: "Volume Threshold Exceeded"
Usage Examples
Example 1: Spotting High Activity
Apply the script to a stock like AAPL on a 5-minute chart.
Set lookbackPeriods to 20 and thresholdPercent to 30.
Use EMA for more reactive volume tracking.
When volume spikes more than 30% above the 20-period EMA, an alert triggers.
Example 2: Day Trading Filter
For scalpers, apply it to a 1-minute crypto chart (e.g., BTC/USDT).
Set thresholdPercent to 50 to catch only strong surges.
Position the table at the top left and reduce visible info for a clean layout.
Example 3: Long-Term Context
On a daily chart, use SMA and set lookbackPeriods to 50.
Helps identify breakout moves supported by strong volume.
How this is different from Trading View's Volume indicator:
The standard volume plot from trading view allows users to set a alert when the average line is crossed, but it does not allow you to set a custom percentage at which to trigger an alert. This indicator will allow you to set any percentage you wish to monitor and above that percentage threshold will trigger your alert.
===== ORIGINAL DESCRIPTION =====
Volume Spike Alert & Overlay
This indicator will display the following as an overlay on your chart:
Current volume
Average Volume
Threshold for Alert
Description:
This indicator will display the current bar volume based on the chart time frame,
display the average volume based on selected conditions,
allow user selectable threshold over the average volume to trigger an alert.
Options:
Average lookback period
Smoothing type
Alert Threshold %
Enable / Disable Each Value
Change Text Color
Change Background Color
Change Table location
Add/Remove extra row for placement in top corner
Usage Example:
I use this indicator to alert when the current volume exceeds the average volume by a specified percentage to alert to volume spikes.
Set the threshold to 25% in the settings
Create an alert by clicking on the 3 dots on the right of the indicator title on the chart
When the threshold is exceeded the alert will trigger
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。