Indicator · Pine Script v6 · On the chart

VP Source Bundle Exporter

by 345-strategies· code credited to TheStratSuite contributors

This overlay indicator is a headless export aid for a frozen Volume Profile source bundle.

View on GitHub

GitHub stars5on the repository
Pine versionv6current
Lines of code99
Settings3inputs
LicenceMPL-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

99 lines of Pine Script v6 from pine/research/VP_Source_Bundle_Exporter_v0.1.0.pine, published under MPL-2.0. Keep the author's credit and licence lines when you reuse it.

VP_Source_Bundle_Exporter_v0.1.0.pine
// This source code is subject to the terms of the Mozilla Public License 2.0
// at https://mozilla.org/MPL/2.0/
// © 2026 TheStratSuite contributors
//@version=6

// Headless OHLCV export aid for the frozen Volume Profile source bundle.
// This script performs no profile calculation and draws no chart objects.
indicator(
     "VP Source Bundle Exporter v0.1.0",
     shorttitle = "VP Source Export",
     overlay = true)

const string SCRIPT_VERSION = "0.1.0"
const float EXPECTED_MINTICK = 0.25
const int ERR_ENVIRONMENT = 1
const int ERR_OHLC_TICK_ALIGNMENT = 2
const int ERR_OHLC_SHAPE = 4
const int ERR_VOLUME = 8
const int ERR_IDENTITY = 16

string identityGroup = "Frozen source-bundle identity"
string bundleIdInput = input.string(
     "VP0-30-ES-v1-source",
     "Bundle ID",
     group = identityGroup)
int bundleTokenInput = input.int(
     1,
     "Bundle token",
     minval = 1,
     maxval = 2147483647,
     group = identityGroup)
string expectedTickerInput = input.string(
     "ESM2026",
     "Exact actual-month ticker",
     group = identityGroup)

safeIdentity(string value) =>
    str.length(value) > 0 and
     not str.contains(value, "|")

tickAligned(float value) =>
    not na(value) and
     math.abs(value / syminfo.mintick -
         math.round(value / syminfo.mintick)) <= 0.000001

bool actualContract = syminfo.type == "futures" and
     (syminfo.root == "ES" or syminfo.root == "MES") and
     not str.contains(syminfo.ticker, "!") and
     syminfo.ticker == expectedTickerInput
bool environmentValid = chart.is_standard and
     actualContract and
     math.abs(syminfo.mintick - EXPECTED_MINTICK) <= 0.000000001
bool identityValid = safeIdentity(bundleIdInput) and
     safeIdentity(expectedTickerInput) and
     bundleTokenInput > 0
bool ohlcTickAligned = tickAligned(open) and tickAligned(high) and
     tickAligned(low) and tickAligned(close)
bool ohlcShapeValid = not na(open) and not na(high) and
     not na(low) and not na(close) and
     high >= math.max(open, close) and
     low <= math.min(open, close) and
     high >= low
bool volumeValid = not na(volume) and volume >= 0.0

int errorMask =
     (environmentValid ? 0 : ERR_ENVIRONMENT) +
     (ohlcTickAligned ? 0 : ERR_OHLC_TICK_ALIGNMENT) +
     (ohlcShapeValid ? 0 : ERR_OHLC_SHAPE) +
     (volumeValid ? 0 : ERR_VOLUME) +
     (identityValid ? 0 : ERR_IDENTITY)
bool exportValid = errorMask == 0

if barstate.islastconfirmedhistory
    string kind = exportValid ? "RUN_END" : "RUN_ABORT"
    string severity = exportValid ? "INFO" : "ERROR"
    string terminalRecord =
         "VPB|schema=1" +
         "|kind=" + kind +
         "|severity=" + severity +
         "|bundle_id=" + bundleIdInput +
         "|bundle_token=" + str.tostring(bundleTokenInput) +
         "|script=" + SCRIPT_VERSION +
         "|symbol=" + syminfo.tickerid +
         "|ticker=" + syminfo.ticker +
         "|chart_timeframe=" + timeframe.period +
         "|chart_standard=" + (chart.is_standard ? "1" : "0") +
         "|chart_session=" + syminfo.session +
         "|mintick=" + str.tostring(syminfo.mintick) +
         "|error_mask=" + str.tostring(errorMask)
    if exportValid
        log.info(terminalRecord)
    else
        log.error(terminalRecord)

// Every output is Data Window-only. The chart itself remains uncluttered.
plot(float(bundleTokenInput), "VPB.BundleToken", display = display.data_window)
plot(exportValid ? volume : na, "VPB.Volume", display = display.data_window)
plot(exportValid ? 1.0 : 0.0, "VPB.Valid", display = display.data_window)
plot(float(errorMask), "VPB.ErrorMask", display = display.data_window)

Overview

VP Source Bundle Exporter performs no profile calculation and draws no chart objects. It checks that the chart is a standard ES or MES futures contract matching a typed ticker and a 0.25 mintick, then validates bundle identity, OHLC tick alignment and candle shape, and non-negative volume. On the last confirmed historical bar it logs a success or abort record. Valid volume and the bundle token appear only in the Data Window.

Details

Published by

345-strategies on GitHub

Code credit

TheStratSuite contributors, as written in the script's header

Type

Indicator, Pine Script v6

Draws

On the price chart

Markets

Indices

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.

Topics

indicatorpine-scriptthestrattradingtradingviewprice-actionstratpine-script-librarythestrat-suite

Settings

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

SettingTypeDefaultVariable
Bundle IDstringVP0-30-ES-v1-sourcebundleIdInput
Bundle tokenint1bundleTokenInput
Exact actual-month tickerstringESM2026expectedTickerInput
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

948 stars

The Adaptive Laguerre Filter calculates a smoothed, dynamically adjusted trendline plotted directly on the main price chart. It dynamically adjusts its damping factor (alpha) based on recent price range variations and median percentile calculations over a spec

Indicator v4 TrendMoving averages
Updated 10 days ago · GPL-3.0 GitHub repository of Adaptive Laguerre Filter
575 stars

The indicator plots ICT displacement candles on the price chart and can switch to retracement scanning. Displacement requires a move larger than a set share of the 14-bar average high-low range, lasting at least a chosen number of bars, with optional close, pr

Indicator v6 SMC / ICT / price actionCandlestick patterns
Updated 1 year ago · MPL-2.0 GitHub repository of ICT Displacement Candles Indicator
330 stars

This script plots three moving averages on the price chart: a fast EMA or SMA with 10 periods, a slow EMA or SMA with 20 periods, and a trend EMA or SMA with 100 periods. It signals trend changes by drawing a white cross when the fast moving average crosses ab

Indicator v4 TrendMoving averages
Updated 2 months ago · None stated GitHub repository of 3 EMA/SMA + Cross [Alorse]
318 stars

This indicator calculates an ATR trailing stop line derived from the highest high minus an average true range multiple over a specified lookback period. It plots the trailing stop line directly on the price chart and colors price bars based on whether the clos

Indicator v5 TrendVolatility & bands
Updated 2 months ago · MIT GitHub repository of ATR Trailing Stoploss

1833 Tracker

by Allen1212
303 stars

1833 Tracker is an overlay indicator that visualizes historical buy and sell transactions executed by ARK Invest ETFs for the stock on the main price chart. It displays trade dates using green buy and red sell labels positioned relative to price bars, indicati

Indicator v4
Updated 2 years ago · None stated GitHub repository of 1833 Tracker

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