Indicator · Pine Script v5 · Own pane

BuySell vol

by mrgunkin

The BuySell Volume Indicator plots volume as histogram columns on the price chart and optionally a moving average of volume in a separate pane.

View on GitHub

GitHub stars1on the repository
Pine versionv5runs as is
Lines of code43
Settings4inputs
LicenceMIT
Last update1 year ago6 Mar 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

43 lines of Pine Script v5 from buy sell vol/buy sell vol v5.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.

buy sell vol v5.pine
//
// @author Mrgunkin [GitHub Profile](https://github.com/mrgunkin)
//
//@version=5
indicator('BuySell vol', shorttitle='BuySell vol')

// аргументы
lookback = input(13)
showMA = input(false)
lengthMA = input(55)
tickername = syminfo.tickerid
p2 = close
v2 = volume
p1 = p2[lookback]
v1 = v2[lookback]
bc=input(true, 'Bar Coloring')

// расчеты
// цвета
iff_1 = p2 < p1 and v2 > v1 ? #4CAF50 : #B2B5BE
iff_2 = p2 < p1 and v2 < v1 ? #B2B5BE : iff_1
iff_3 = p2 > p1 and v2 < v1 ? #B2B5BE : iff_2
z = p2 > p1 and v2 > v1 ? #FF5252 : iff_3
bc_color = z

//фильтр объемы и биржа
b1 = if tickername == 'INDEX:BTCUSD'
    timeframe.period == '1' ? 400 : timeframe.period == '5' ? 600 : timeframe.period == '15' ? 725 : timeframe.period == '30' ? 1300 : timeframe.period == '60' ? 3000 : timeframe.period == '120' ? 5000 : timeframe.period == '240' ? 8000 : timeframe.period == 'D' ? 20000 : na
else if tickername == 'BINANCE:BTCUSDT.P'
    timeframe.period == '1' ? 1000 : timeframe.period == '5' ? 5000 : timeframe.period == '15' ? 10000 : timeframe.period == '30' ? 20000 : timeframe.period == '60' ? 40000 : timeframe.period == '120' ? 80000 : timeframe.period == '240' ? 120000 : timeframe.period == 'D' ? 600000 : na
else if tickername == 'BINANCE:BTCUSDT'
    timeframe.period == '1' ? 150 : timeframe.period == '5' ? 1000 : timeframe.period == '15' ? 1500 : timeframe.period == '30' ? 3000 : timeframe.period == '60' ? 6000 : timeframe.period == '120' ? 11000 : timeframe.period == '240' ? 15000 : timeframe.period == 'D' ? 50000 : na
else if tickername == 'MEXC:BTCUSDT.P'
    timeframe.period == '1' ? 4000000 : timeframe.period == '5' ? 15000000 : timeframe.period == '15' ? 30000000 : timeframe.period == '30' ? 50000000 : timeframe.period == '60' ? 90000000 : timeframe.period == '120' ? 190000000 : timeframe.period == '240' ? 300000000 : timeframe.period == 'D' ? 1500000000 : na
else
    na


// вывод на экран
plot(v2, style=plot.style_columns, color=z)
plot(showMA ? ta.sma(volume,lengthMA) : na, style=plot.style_area, color=color.new(color.orange,60), title="Volume MA")
plot(b1, color=color.new(color.orange, 40), linewidth=3)
barcolor(bc ? bc_color : na)

Overview

BuySell vol compares current price and volume with values from lookback bars to color bars green for bullish volume and red for bearish. It also plots a threshold line based on exchange-specific volume filters. Settings allow adjusting the lookback period, enabling the volume MA, and setting its length. The indicator draws on the chart with bar coloring.

Details

Published by

mrgunkin on GitHub

Type

Indicator, Pine Script v5

Draws

Separate pane below the chart

Category

Volume

Markets

Crypto

Timeframes

Any timeframe

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
lookbackint13lookback
showMAboolfalseshowMA
lengthMAint55lengthMA
Bar Coloringbooltruebc
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

Money Flow Index

by everget
948 stars

Calculates the standard Money Flow Index (MFI) oscillator alongside an exponential moving average signal line in a separate pane. The script visually highlights trend conditions through dynamic ribbon filling, optional difference histogram bars, and overbought

Indicator v4 Oscillators & momentumVolume
Updated 10 days ago · GPL-3.0 GitHub repository of Money Flow Index

This indicator plots a Supertrend-based trend-following setup in a separate pane and skips conditions it treats as a sideways market. A volatility range is built from an ATR value, with RMA, SMA, EMA, or WMA smoothing, or from a fixed point distance. Optional

Indicator v5 TrendVolatility & bands
Updated 1 year ago · MPL-2.0 GitHub repository of Trend Following Setup - Sideways Market Skipper
549 stars

Range Volume Change compares volume inside a chosen session window with the same window on the previous day and plots that change as a percentage. It accumulates volume during the window and, when enabled, volume outside it, drawing growing columns in a separa

Indicator v5 VolumeSessions & time Repaints
Updated 10 months ago · None stated GitHub repository of Range Volume Change
257 stars

This indicator builds a footprint of estimated buy and sell volume across price rows and plots it in a separate pane. It fills rows from bar low to high, stores volume per row, and draws buy and sell volume boxes, volume-profile boxes, row labels, and cumulati

Indicator v5 Volume Repaints
Updated 6 weeks ago · None stated GitHub repository of Footprint Delta Lite

Commitment Gauge

by harryguiacorn
219 stars

This indicator measures directional momentum by evaluating candlestick body proportions and volume over a user-defined lookback window. It computes the ratio of candle body to total range, weights the cumulative value by volume and absolute body size, and dete

Indicator v4 VolumeCandlestick patterns
Updated 1 year ago · None stated GitHub repository of Commitment Gauge

Aggregate Signal

by capissimo
114 stars

This indicator builds an aggregate oscillator in a separate pane. It scales open, high, low, close, and volume into a 0 to 1 range, then averages scaled readings from MACD, a MACD histogram, RSI, stochastic, CCI, momentum, OBV, a directional index, volume-weig

Indicator v4 Oscillators & momentumVolume Repaints
Updated 1 year ago · None stated GitHub repository of Aggregate Signal

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