Indicator · Pine Script v6 · On the chart

Intrabar Profile [Kioseff Trading]

by yingliupabot· code credited to KioseffTrading

This indicator constructs bar-by-bar volume profiles and volume delta distributions directly on the price chart.

View on GitHub

GitHub stars2on the repository
Pine versionv6current
Lines of code228
Settings13inputs
LicenceNone statedfile: MPL-2.0
Last update2 days ago26 Oct 2026

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

228 lines of Pine Script v6 from trading-ideas/tradingview-pine-scripts/intrabar-profile/intrabar-profile.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.

intrabar-profile.pine
// This Pine Script® code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © KioseffTrading

//@version=6
indicator("Intrabar Profile [Kioseff Trading]", overlay = true, max_boxes_count = 500, max_labels_count = 500, max_lines_count = 500, max_polylines_count = 100, calc_bars_count = 500)


enum granularity

    m5 = "5-Minute"
    m1 = "1-Minute"
    s1 = "1-Second"
    t1 = "1-Tick"

profType            = input.string(defval = "VP", title = "Profile Type", options = ["VP", "Delta"])
gran                = input.enum(defval = granularity.m1, title = "Granularity", options = [granularity.m5, granularity.m1, granularity.s1, granularity.t1])
upColAdv2           = input.color(defval = #96d3c8, title = "Buy-Side Color", inline = "ADV UP", group = "Focus Mode"), upColAdv = input.color(defval = #00ffff, title = "", inline = "ADV UP", group = "Focus Mode")
dnColAdv2           = input.color(defval = #d39696, title = "Sell-Side Color", inline = "ADV DN", group = "Focus Mode"), dnColAdv = input.color(defval = #8f1b1b, title = "", inline = "ADV DN", group = "Focus Mode")
advCol              = input.color(defval = color.white, title = "Text Color", group = "Focus Mode")
rows                = input.int(defval = 11, minval = 5, maxval = 200, title = "Profile Rows")

showVolAtLevel     = input.bool(defval = false, title = "Show Volume At Level", group = "Mini Profile Main Settings")
miniProfTransp     = input.int(0, minval = 0, maxval = 100, title = "Mini Profile Transparency", group = "All Profile Settings")
showVA          = input.bool(defval = true, title = "Show VA", group = "VA")
customPOCcol    = input.bool(defval = true, title = "", inline = "POC")
pocCol          = input.color(defval = #e5ff55, title = "POC Color", inline = "POC")

var tf = switch gran

    granularity.m1  => "1"
    granularity.s1  => "1S"
    granularity.t1  => "1T"


direction() =>

    if gran == granularity.t1

        switch

            close == bid => -1
            close == ask =>  1
            => math.sign(close - close[1])

    else

        math.sign(close - close[1])

everyBarVP() =>

    [h, l, vol] = request.security_lower_tf("", tf, [high, low, volume * direction()])

    if vol.size() > 0

        Range = (high - low) / (rows - 1)

        levelsArr  = array.new<float>(rows, 0)
        vpArr      = array.new<float>(rows, 0)
        deltaArr   = array.new<float>(rows, 0)

        for i = 0 to rows - 1

            levelsArr.set(i, low + (Range * i))

        for [i, data] in vol

            bot = levelsArr.binary_search_leftmost(l.get(i))
            top = levelsArr.binary_search_leftmost(h.get(i))

            div    = data / (math.abs(top - bot) + 1)
            absDiv = math.abs(div)

            for x = bot to top

                vpArr   .set(x, vpArr.get(x) + absDiv)
                deltaArr.set(x, deltaArr.get(x) + div)

        poc   = vpArr.indexof(vpArr.max()),
        indUp = poc, indDn = poc, sum = 0., size = vpArr.size()
        total = vpArr.sum() * .7

        for i = 0 to size - 1

            if indUp == indDn

                sum += vpArr.get(indUp)

                if sum >= total
                    break

                indUp += 1
                indDn -= 1
                continue

            if indUp < size

                sum += vpArr.get(indUp)

                if sum >= total
                    break

                indUp += 1

            if indDn > -1

                sum += vpArr.get(indDn)

                if sum >= total
                    break

                indDn -= 1


        if vpArr.sum() != 0

            minVol = vpArr.min(), rangeVol = vpArr.range()

            absDeltaArr = deltaArr   .abs()
            minDelta    = absDeltaArr.min()
            rangeDelta  = absDeltaArr.range()

            for [i, data] in vpArr

                norm = int(na), getDelta = deltaArr.get(i), absDelta = absDeltaArr.get(i)

                if profType == "VP"

                    norm := math.round(1 + ((data - minVol) * 10) / rangeVol)

                else

                    norm := math.round(1 + ((absDelta - minDelta) * 10) / rangeDelta)

                    if math.sign(getDelta) == -1

                        norm *= -1

                level = levelsArr.get(i)
                getText = "█"

                signNorm = math.sign(norm)

                if signNorm == 1 or profType == "VP"

                    if norm > 1
                        for x = 0 to math.min(norm - 1, 9)
                            getText += "█"

                    if str.length(getText) < 10

                        for x = str.length(getText) to 10
                            getText += " "

                    else if str.length(getText) == 10

                        getText += " "

                else

                    getText := ""

                    width  = 11
                    blocks = math.min(math.abs(norm), width)
                    spaces = width - blocks

                    if spaces > 0
                        for x = 0 to spaces - 1
                            getText += " "

                    if blocks > 0
                        for x = 0 to blocks - 1
                            getText += "█"


                volAtLevel = str.tostring(getDelta, format.volume)

                if showVolAtLevel

                    getText := volAtLevel + getText

                col = switch math.sign(close - open)

                    1  => color.new(color.from_gradient(norm, 0, 10, upColAdv, upColAdv2), miniProfTransp)
                    -1 => color.new(color.from_gradient(norm, 0, 10, dnColAdv, dnColAdv2), miniProfTransp)

                if showVolAtLevel

                    if profType == "VP" or signNorm == 1

                        getText += switch

                            profType == "VP" => str.tostring(data, format.volume)
                            => str.tostring(getDelta, format.volume)

                if showVA

                    if i <= indDn or i >= indUp

                        col := color.new(color.gray, miniProfTransp)

                if customPOCcol
                    if i == poc
                        col := pocCol

                if profType == "VP" or signNorm == 1

                    box.new(bar_index, level, bar_index + 1, level + Range, text = getText,
                                                            text_halign   = text.align_left,
                                                            text_valign   = text.align_center,
                                                            border_color  = color(na),
                                                            bgcolor       = #00000000,
                                                            text_color    = col,
                                                            force_overlay = true
                                                            )

                else

                    box.new(bar_index - 1, level, bar_index, level + Range, text = getText,
                                                            text_halign   = text.align_right,
                                                            text_valign   = text.align_center,
                                                            border_color  = color(na),
                                                            bgcolor       = #00000000,
                                                            text_color    = col,
                                                            force_overlay = true
                                                            )


everyBarVP()

Overview

Utilizing lower-timeframe data through intrabar requests, it calculates volume distribution across a configurable number of price rows per bar, pinpointing the Point of Control (POC) and a 70% Value Area (VA). Users can switch between standard volume profile and delta modes, adjust intrabar granularity from minutes down to ticks, customize row resolution, and style profile aesthetics.

Details

Published by

yingliupabot on GitHub

Code credit

KioseffTrading, as written in the script's header

Type

Indicator, Pine Script v6

Draws

On the price chart

Category

Volume, Support & resistance

Markets

Any symbol

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
Profile TypestringVPprofType
Granularityenumgranularity.m1gran
Buy-Side Colorcolor#96d3c8upColAdv2
upColAdvcolor#00ffffupColAdv
Sell-Side Colorcolor#d39696dnColAdv2
dnColAdvcolor#8f1b1bdnColAdv
Text Colorcolorcolor.whiteadvCol
Profile Rowsint11rows
Show Volume At LevelboolfalseshowVolAtLevel
Mini Profile Transparencyint0miniProfTransp
Show VAbooltrueshowVA
customPOCcolbooltruecustomPOCcol
Show all 13 settings
SettingTypeDefaultVariable
POC Colorcolor#e5ff55pocCol
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 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

MGIC-tracker

by Allen1212
303 stars

The MGIC-tracker is a TradingView indicator that overlays ARK Invest trade records onto stock price charts. It plots buy and sell labels at the exact timestamp of each transaction, showing share volume and ETF weight. Users select a specific ETF type via setti

Indicator v4 Support & resistanceVolume
Updated 2 years ago · None stated GitHub repository of MGIC-tracker
218 stars

Comprehensive Volume Profile is an overlay indicator that calculates and plots volume distribution across specified time ranges such as daily sessions, weekly, monthly, or custom bar lengths. It identifies key structural price levels including the Point of Con

Indicator v6 VolumeSupport & resistance
Updated 3 months ago · None stated GitHub repository of Comprehensive Volume Profile

Moon Dev GEX Arrows

by moondevonyt
92 stars

This overlay indicator plots option strike walls and an optional session VWAP on the price chart for SPY or ES. It spaces major strikes by the selected instrument, draws a set number of strikes on each side, and marks wall-trap and sweep events after a cooldow

Indicator v5 Support & resistanceSessions & time
Updated 8 weeks ago · Custom licence GitHub repository of Moon Dev GEX Arrows

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