Indicator · Pine Script v5 · On the chart

Daily Volume

by benso87

Daily Volume is an overlay indicator that displays current daily volume statistics inside an on-chart table in the top-right corner.

View on GitHub

GitHub stars24on the repository
Pine versionv5runs as is
Lines of code54
Settings6inputs
LicenceMPL-2.0
Last update4 years ago5 Oct 2022

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

54 lines of Pine Script v5 from Daily Volume.pine, published under MPL-2.0. Keep the author's credit and licence lines when you reuse it.

Daily Volume.pine
//@version=5
indicator('Daily Volume', shorttitle='Daily Volume', precision=2, overlay=true, max_bars_back=500)


////////////////////////////////////////////////////////////
// Inputs

onlyIntraday = input.bool(true, title='Only show intraday', tooltip='Checking this will make the table disappear on timeframes >= 1D')
showYesterday = input.bool(false, title='Show yesterday\'s volume')
showAvg = input.bool(false, title='Show average')
avgPeriod = input.int(30, title='Average period', minval=0, tooltip='Number of days to consider for average volume')

textColor = input.color(color.white, title='Text Color')
backColor = input.color(color.black, title='Table Color')


////////////////////////////////////////////////////////////
// Functions

nocolor=color.new(color.white, transp=100)

f_rows(I) =>
    O = true ? 1 : 0


////////////////////////////////////////////////////////////
// Calculations

rowNum = 1 + f_rows(showYesterday) + f_rows(showAvg)

var table dvDisplay = table.new(position=position.top_right, columns=1, rows=rowNum)

dVol = request.security(syminfo.tickerid, timeframe='D', expression=str.tostring(volume, format.volume))
ydVol = request.security(syminfo.tickerid, timeframe='D', expression=str.tostring(volume[1], format.volume))
avgVol = request.security(syminfo.tickerid, timeframe='D', expression=str.tostring(ta.sma(volume, avgPeriod)[1], format.volume))

volText = 'Daily Volume: ' + dVol
yestText = 'Yesterday: ' + ydVol
avgText = 'Average: ' + avgVol


////////////////////////////////////////////////////////////
// Plots

if barstate.islast and (not onlyIntraday or timeframe.isintraday)
    table.cell(dvDisplay, column=0, row=0, text=volText, text_color=textColor, bgcolor=backColor)
    if showYesterday
        table.cell(dvDisplay, column=0, row=1, text=yestText, text_color=textColor, bgcolor=backColor)
    if showAvg
        table.cell(dvDisplay, column=0, row=2, text=avgText, text_color=textColor, bgcolor=backColor)


////////////////////////////////////////////////////////////
// Alerts

Overview

Daily Volume fetches higher-timeframe daily data to report real-time current daily volume, yesterday's total volume, and a simple moving average of daily volume over a user-defined period. Settings allow customization of table colors, toggling optional daily metrics, adjusting the average period, and hiding the display on daily or higher timeframes.

Details

Published by

benso87 on GitHub

Type

Indicator, Pine Script v5

Draws

On the price chart

Category

Volume, Screeners & dashboards

Markets

Any symbol

Timeframes

M15-H1

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Settings

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

SettingTypeDefaultVariable
Only show intradaybooltrueonlyIntraday
Show yesterday's volumeboolfalseshowYesterday
Show averageboolfalseshowAvg
Average periodint30avgPeriod
Text Colorcolorcolor.whitetextColor
Table Colorcolorcolor.blackbackColor
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

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

Equity Intraday Analyst

by chris-c-thomas
14 stars

Equity Intraday Analyst is a comprehensive intraday overlay indicator for US equities and ETFs. It evaluates multi-EMA ribbons, session-anchored VWAP bands, OBV trends, momentum oscillators, TTM Squeeze, and optional market breadth indicators like NYSE TICK an

Indicator v6 TrendVolume
Updated 6 months ago · MIT GitHub repository of Equity Intraday Analyst

This daily-timeframe indicator provides futures market context by evaluating open interest and term structure without altering chart price scales. It requests front-month and next-month futures contracts to measure spread relationships like contango or backwar

Indicator v6 VolumeScreeners & dashboards
Updated yesterday · MIT GitHub repository of Futures Context Module [WavesUnchained]

Nexural QWAP

by JasonTeixeira
9 stars

Nexural QWAP calculates a volume-weighted average price combined with a cumulative volume delta order flow engine directly on the main price chart. It analyzes market structure by detecting volume absorption, liquidity sweeps, price-CVD divergence, stacked imb

Indicator v6 SMC / ICT / price actionVolume
Updated 12 days ago · Custom licence GitHub repository of Nexural QWAP
9 stars

Peak Trading Activity Graphs displays historical market activity across cyclical timeframes directly on the main chart using an on-screen dashboard table. It evaluates volume or volatility across selected periods, including hours of the day, days of the week,

Indicator v6 VolumeVolatility & bands
Updated 4 months ago · MIT GitHub repository of Peak Trading Activity Graphs [LuxAlgo]

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