Indicator · Pine Script v5 · On the chart

Alert VOL Strong Candle CME

by codingfordummies911· code credited to godfather

This overlay indicator classifies candle volume against a Wilder moving average and highlights unusually strong volume on the price chart.

View on GitHub

Repaints

GitHub stars13on the repository
Pine versionv5runs as is
Lines of code199
Settings16inputs
LicenceNone statedfile: MPL-2.0
Last update10 months ago27 Dec 2025

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

199 lines of Pine Script v5 from Alert VOL Strong Candle CME.txt, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.

Alert VOL Strong Candle CME.txt
//@version=5
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © godfather
// update vwap

indicator('Alert VOL Strong Candle CME', shorttitle='Alert VOL Strong Candle CME', overlay=true,  format=format.price, precision=2, max_boxes_count=500, max_bars_back=500, max_lines_count=500, max_labels_count = 500)


MaxLabel=input.int(title="Số Nến Hiện Tín Hiệu", defval=100, minval=5, maxval=10000, step=1) 


groupVolume = '📈 Cấu Hình Thông Số Đầu Vào Cho Volume CME 📉'
showBarcolorVol = input.bool(defval=true, title="Hiện Màu Nến Vol Bất Thường" , group = groupVolume)
adaptive        = input.string(title="Market Type ", options=["AUTO", "OTHERS"], defval="AUTO", group = groupVolume)
symbol_manual   = input.symbol(defval="COMEX_DL:GC1!", group = groupVolume)

sCode1 =
         syminfo.root == "XAUUSD" ? "COMEX_DL:GC1!" :
         syminfo.root == "AUDUSD" ? "CME_DL:6A1!" :
         syminfo.root == "USDCAD" ? "CME_DL:6C1!" :
         syminfo.root == "GBPUSD" ? "CME_DL:6B1!" :
         syminfo.root == "EURUSD" ? "CME_DL:6E1!" :
         syminfo.root == "USDJPY" ? "CME_DL:6J1!" :
         syminfo.root == "USDCHF" ? "CME_DL:6S1!" : 
         syminfo.root == "NZDUSD" ? "CME_DL:6N1!" : 
         syminfo.root == "BTCUSDT" ? "CME_DL:BTC1!" :
         syminfo.root == "ETHUSDT" ? "CME_DL:ETH1!" :  
         syminfo.root == "XAGUSD" ? "COMEX_DL:SI1!" :
         syminfo.root == "US30" ? "CBOT_MINI_DL:YM1!" :  
         ""

float _volume = na
string code_futures = na

if (adaptive=="AUTO" and sCode1 != "")
    code_futures := sCode1
else
    code_futures := ""

volFuture = request.security(code_futures, timeframe.period, volume, lookahead=barmerge.lookahead_on)  

if (adaptive=="AUTO" and code_futures != "" )
    _volume:=  volFuture
if (adaptive=="OTHERS" or code_futures == "")
    _volume:=  volume

//showMA = input(defval=false, title='Show Volume Moving Average')
lengthVolumeMA = input(defval=20, title='Length of MA applied on Volume', group = groupVolume)
ratioUltraVolume = input(defval=2.2, title='Ultra High Volume Ratio', group = groupVolume)
ratioVeryHighVolume = input(defval=1.8, title='Very High Volume Ratio', group = groupVolume)
ratioHighVolume = input(defval=1.2, title='High Volume Ratio', group = groupVolume)
ratioNormalVolume = input(defval=0.8, title='Normal Volume Ratio', group = groupVolume)
ratioLowVolume = input(defval=0.4, title='Low Volume Ratio', group = groupVolume)
ratioVeryLowVolume = input(defval=0.4, title='Very Low Volume Ratio', group = groupVolume)


// WILDERS MA
float volumeMA = 0
volumeMA := nz(volumeMA[1]) + (_volume - nz(volumeMA[1])) / lengthVolumeMA
float volumeMA_default = 0
volumeMA_default := nz(volumeMA_default[1]) + (volume - nz(volumeMA_default[1])) / lengthVolumeMA

ultraHighVolumeMin = volumeMA * ratioUltraVolume
veryHighVolumeMin = volumeMA * ratioVeryHighVolume

ultraHighVolumeMin_default = volumeMA_default * ratioUltraVolume
veryHighVolumeMin_default = volumeMA_default * ratioVeryHighVolume

highVolumeMin = volumeMA * ratioHighVolume
normalVolumeMin = volumeMA * ratioNormalVolume
lowVolumeMin = volumeMA * ratioLowVolume
veryLowVolumeMin = volumeMA * ratioVeryLowVolume


volUltraHigh = _volume >= ultraHighVolumeMin ? true : false
volVeryHigh = _volume >= veryHighVolumeMin and _volume < ultraHighVolumeMin ? true : false

volUltraHigh_default = volume >= ultraHighVolumeMin_default ? true : false
volVeryHigh_default = volume >=  veryHighVolumeMin_default and volume < ultraHighVolumeMin_default ? true : false

volHigh = _volume >= highVolumeMin and _volume < veryHighVolumeMin ? true : false
volNormal = _volume >= normalVolumeMin and _volume < highVolumeMin ? true : false
volLow = _volume >= lowVolumeMin and _volume < normalVolumeMin ? true : false
volVeryLow = _volume < lowVolumeMin ? true : false

// ... (existing code from the linked script)

// Determine bullish and bearish candles
isBullish = close > open
isBearish = close < open

// Set candle color based on conditions
//barcolor(volUltraHigh and isBullish ? color.rgb(6, 114, 96) : volUltraHigh and isBearish ? color.red : na)
//barcolor(volVeryHigh and isBullish ? color.rgb(125, 199, 127) : volVeryHigh and isBearish ? color.rgb(221, 161, 161) : na)
barcolor(showBarcolorVol  and volUltraHigh and isBullish ? color.rgb(23, 109, 41)  : showBarcolorVol  and volUltraHigh and isBearish? color.rgb(173, 20, 20)  : na)
barcolor(showBarcolorVol  and volVeryHigh and isBullish  ? color.rgb(173, 218, 183) : showBarcolorVol  and volVeryHigh and isBearish  ? color.rgb(236, 128, 128) :  na)



//========================================Begin Flase Break - TRAP============================================
groupTrap = '📈 Cấu Hình Signal Trap 📉'
bool showTrap = input(false, 'Hiện Signal TRAP', group = groupTrap)
lookbackTRAP=input.int(title="Kiểm Tra Bao Nhiêu Cây Nến", defval=3, minval=1, maxval=10, step=1, group = groupTrap)
bool showSignalUltra = input(true, 'Get Break Vol Ultra', group = groupTrap)
bool showSignalVery = input(false, 'Get Break Vol Very', group = groupTrap)
bool alertTrap = input(true, 'Thông Báo Tín Hiệu', group = groupTrap)

//=======================
bool firstTrapSell = false
var highTrapSell = high
//=================================
bool firstTrapBuy = false
var lowTrapBuy = low

////////////////////////////////////////////////////////////////Code Sell

for ii = 1 to lookbackTRAP by 1
    //Tìm thấy tín hiệu trước đó bỏ qua
    // if(firstTrapBuy[ii])
    //     lowTrapBuy := low
    //     break

    //Kill vol ultra high
    if(showSignalUltra and volUltraHigh[ii])
        lowTrapBuy :=low[ii]
        break
    else
        lowTrapBuy := low

    //Kill vol very ultra
    if(showSignalVery  and volVeryHigh[ii])
        lowTrapBuy :=low[ii]
        break
    else
        lowTrapBuy := low
       


trapBuy = ta.crossunder(close, lowTrapBuy)

if(volUltraHigh or volVeryHigh)
    trapBuy := false    


if last_bar_index - bar_index < MaxLabel
    if(showTrap and trapBuy)
        label.new(bar_index, high, text="", yloc = yloc.abovebar, style=label.style_label_down, textcolor=color.white, size=size.tiny, color=color.rgb(204, 169, 13))
firstTrapBuy := trapBuy
//plotshape(trapBuy , title="Sell False Break signal", style=shape.labeldown, size=size.small, color=color.rgb(218, 169, 8), location= location.abovebar, text="T", textcolor=color.white) 

////////////////////////////////////////////////////////////////Code Buy

for ii = 1 to lookbackTRAP by 1
    //Tìm thấy tín hiệu trước đó bỏ qua
    // if(firstTrapSell[ii])
    //     highTrapSell := high
    //     break

    //Vol ultra high bị kill
    if(showSignalUltra   and volUltraHigh[ii])
        highTrapSell :=high[ii]
        break
    else
        highTrapSell := high
    
    //Vol very high bị kill
    if(showSignalVery   and volVeryHigh[ii])
        highTrapSell :=high[ii]
        break
    else
        highTrapSell := high
    

trapSell = ta.crossover(close, highTrapSell)

if(volUltraHigh or volVeryHigh)
    trapSell := false  


if last_bar_index - bar_index < MaxLabel
    if(showTrap and trapSell)
        label.new(bar_index, low, text="", yloc = yloc.belowbar, style=label.style_label_up, textcolor=color.white, size=size.tiny, color=color.rgb(28, 169, 204))
firstTrapSell := trapSell
//plotshape(_showTrapEntrytime and showTrap  and trapSell , title="Buy False Break signal", style=shape.labelup, size=size.small, color=color.rgb(28, 169, 204), location= location.belowbar, text="T", textcolor=color.white) 

checkForAlert(trapBuy, trapSell)=>
    alertMsg = ""
    if (trapBuy)
        alertMsg += str.format("Canh Sell {0} M{1} !\n", syminfo.tickerid,timeframe.period)
    if (trapSell)
        alertMsg += str.format("Canh Buy {0} M{1} !\n", syminfo.tickerid,timeframe.period)
    alertMsg

if(alertTrap and showSignalUltra or alertTrap and showSignalVery)
    // if(EntryTimePhienA or EntryTimePhienAu or EntryTimePhienMy)
    msg = checkForAlert(trapBuy, trapSell)
    if str.length(msg) > 0
        alert(msg, alert.freq_once_per_bar_close)
//=============================================================================End Begin Flase Break IB - TRAP====================================================================

Overview

In automatic mode it requests matching CME or COMEX futures volume for mapped forex, gold, silver, crypto, and index symbols; otherwise it uses the chart volume. Ratio inputs set ultra, very high, high, normal, low, and very low bands, while toggles control bar colors, trap checks, ultra or very-high break labels, alerts, and how many candles keep labels. Volume is requested with lookahead enabled, so readings can use unfinished data.

Details

Published by

codingfordummies911 on GitHub

Code credit

godfather, as written in the script's header

Type

Indicator, Pine Script v5

Draws

On the price chart

Category

Volume

Markets

Forex, Gold, Crypto, Indices, Oil & commodities

Timeframes

Any timeframe

Risk Notes

  • Signals can change on the live bar or after it closes (repainting)
  • Reads higher-timeframe data with lookahead on, so the history can show signals that were not there in real time

Topics

indicatorsmt5

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Số Nến Hiện Tín Hiệuint100MaxLabel
Hiện Màu Nến Vol Bất ThườngbooltrueshowBarcolorVol
Market Type stringAUTOadaptive
symbol_manualsymbolCOMEX_DL:GC1!symbol_manual
Length of MA applied on Volumeint20lengthVolumeMA
Ultra High Volume Ratiofloat2.2ratioUltraVolume
Very High Volume Ratiofloat1.8ratioVeryHighVolume
High Volume Ratiofloat1.2ratioHighVolume
Normal Volume Ratiofloat0.8ratioNormalVolume
Low Volume Ratiofloat0.4ratioLowVolume
Very Low Volume Ratiofloat0.4ratioVeryLowVolume
Hiện Signal TRAPboolfalseshowTrap
Show all 16 settings
SettingTypeDefaultVariable
Kiểm Tra Bao Nhiêu Cây Nếnint3lookbackTRAP
Get Break Vol UltrabooltrueshowSignalUltra
Get Break Vol VeryboolfalseshowSignalVery
Thông Báo Tín HiệubooltruealertTrap
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

Calculates an Elastic Volume Weighted Moving Average (EVWMA), incorporating trading volume to dynamically adjust moving average responsiveness over a specified lookback length. It plots directly on the price chart as a single moving average line. Optional colo

Indicator v4 Moving averagesVolume
Updated 10 days ago · GPL-3.0 GitHub repository of Elastic Volume Weighted Moving Average

This overlay indicator screens a pasted list of up to forty symbols and draws a table on the price chart. It classifies bullish or bearish setups from the percent change between the current candle and the candle 250 bars back, then shows RSI with a simple movi

Indicator v5 Oscillators & momentumVolume
Updated 1 year ago · MPL-2.0 GitHub repository of Momentum Setup - Ankush Bajaj Momentum Investing Setup

This overlay indicator draws a fixed-range volume profile on the price chart, splitting traded activity into up and down volume at each price level. It also plots a sentiment profile, a developing point of control, and value-area high and low around a configur

Indicator v5 VolumeSupport & resistance
Updated 2 months ago · MIT GitHub repository of Volume Profile and Indicator by DGT

META-tracker

by Allen1212
303 stars

This indicator overlays historical ARK Invest buy and sell events for META on the price chart. It places green labels below bars for purchases and red labels above bars for sales, with a same-day count of how many selected ARK ETFs traded the stock. The ETF in

Indicator v4 Volume
Updated 2 years ago · None stated GitHub repository of META-tracker
219 stars

An educational Pine Script v4 indicator demonstrating how to plot volume histograms on the main price chart using unscaled axes. The code includes examples and commented templates for creating vertical line markers at specific dates or time zones, such as mark

Indicator v4 Sessions & timeVolume
Updated 5 years ago · None stated GitHub repository of 教學-畫垂直線1

More indicators

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers