OPEN-SOURCE SCRIPT
Cập nhật Volume Profile Fixed/Range [1CG]

Fixed Range Volume Profile (Open Source)
This open-source indicator serves a dual purpose: it is a highly customizable, high-performance volume profile tool for traders, and it acts as the official implementation guide for developers looking to integrate the Volume Profile Library into their own indicators and strategies.
Leveraging intrabar arrays for volume accuracy, this tool provides precise Point of Control (POC) and Value Area calculations alongside box and polyline visuals.
Why This Indicator Is Necessary
The volume profile in Pine Script is not accessible programmatically. By reviewing the source code of this indicator, developers can see exactly how to integrate the library engine into their own projets:
Traditional vs. Polyline Rendering

This indicator breaks away from the limitations of standard histograms by offering multiple rendering modes:
Use As An External Input Source

You do not need to fork this code to use its data! This indicator plots the most recent POC, Value Area High, and Value Area Low invisibly to the chart.
Because these plots are exposed to the Data Window, you can use this script as a direct "Source" input for other indicators and strategies in your workflow. This allows you to trigger alerts or build strategies based on exact Volume Profile levels without writing a single line of code.
Additional Features
How to Use
This open-source indicator serves a dual purpose: it is a highly customizable, high-performance volume profile tool for traders, and it acts as the official implementation guide for developers looking to integrate the Volume Profile Library into their own indicators and strategies.
Leveraging intrabar arrays for volume accuracy, this tool provides precise Point of Control (POC) and Value Area calculations alongside box and polyline visuals.
Why This Indicator Is Necessary
The volume profile in Pine Script is not accessible programmatically. By reviewing the source code of this indicator, developers can see exactly how to integrate the library engine into their own projets:
- Setup the `VolumeProfileLibrary` engine state using `var`.
- Fetch 1-minute intrabar data efficiently using `request.security_lower_tf()`.
- Safely pass data into the engine for accurate volume distribution.
- Extract the calculated POC and Value Area levels for external logic.
Traditional vs. Polyline Rendering
This indicator breaks away from the limitations of standard histograms by offering multiple rendering modes:
- Traditional (Boxes): The classic stacked volume row display, with options to split each row into estimated buy/sell volumes and dim areas outside the Value Area.
- Modern (Polylines): Render the profile as Polylines or Curved Polylines. This modern aesthetic connects row endpoints with sleek lines and fills the internal regions with stunning spatial color gradients.
Use As An External Input Source
You do not need to fork this code to use its data! This indicator plots the most recent POC, Value Area High, and Value Area Low invisibly to the chart.
Because these plots are exposed to the Data Window, you can use this script as a direct "Source" input for other indicators and strategies in your workflow. This allows you to trigger alerts or build strategies based on exact Volume Profile levels without writing a single line of code.
Additional Features
- Flexible Range Anchoring: Select between absolute ranges ('From Time', 'Between Times') or recurring windows ('Daily Anchor', 'Daily Session') that automatically reset every day.
- Intrabar Accuracy: Dives into 1-minute intrabar data to distribute volume accurately within the chart's bars.
- Session History: Keep historical sessions alive on the chart, allowing you to instantly visually backtest how the volume profile evolved day over day.
How to Use
- Add the indicator to your chart.
- Open the settings menu and configure your preferred Timezone. All fixed time pickers and session windows respect this timezone automatically.
- Select your Range Mode (e.g. 'Daily Session' for the RTH open).
- Customize your resolution (`Rows`), rendering styles, and gradients.
Phát hành các Ghi chú
Small update, reorganizing the inputs, chart. Phát hành các Ghi chú
Library UpdatePhát hành các Ghi chú
There was a time zone error for date specific ranges - fixed.Phát hành các Ghi chú
Update - Profile History, Levels, and SettingsThis update expands the indicator's session-history and appearance controls while keeping POC, Value Area High, and Value Area Low available through the Data Window.
New and Updated Features
- Reorganized settings: Profile now contains Value Area %, Rows, and Width %. Display begins with Show Profile Visuals. Split Buy/Sell is the first Appearance option.
- Shared row resolution: Rows now controls the volume distribution used by Boxes, Polylines, and Curved Polylines.
- Flexible polyline fills: Line Fill can be None, Solid, or Gradient. Gradient quality adapts automatically to the available polyline budget.
- Expanded level controls: Point of Control and Value Area lines have separate visibility, color, width, style, label, text-color, and text-size controls.
- Extended recurring levels: Extend Lines One Extra Session carries each completed session's POC and Value Area levels through the following session.
- Larger session history: Previous Sessions requests the full history target. The engine keeps as many complete profiles as Pine permits and preserves range boxes and selected levels for the remainder.
- Range-box priority: An enabled Range Box is reserved for every represented session before the remaining box budget is assigned to volume rows.
- Clearer statistics: The table now reports Bars, Total Volume, POC, VA High, VA Low, and Full Sessions / Requested. Session counts are displayed as whole numbers.
Settings Notes
- The Timezone setting applies to Daily Anchor, Daily Session, and level-label dates. Fixed Range Start and Range End pickers remain absolute timestamps displayed in the chart timezone.
- Show Profile Visuals hides chart drawings without disabling calculations or Data Window outputs.
- Reducing Rows, disabling Split Buy/Sell, or selecting a lighter polyline fill allows more sessions to remain fully drawn.
Phát hành các Ghi chú
Update - 200 Row Limit, POC Buy/Sell Volumes, Custom Label Prefixes & Date FormatsThis update introduces higher row resolution, POC volume metrics in both the Data Window and statistics table, and customizable level labels.
New and Updated Features
- Higher Row Ceiling: Rows setting now supports up to 200 rows for ultra-high-resolution profiles.
- POC Volume in Statistics Table: The table now displays POC Buy Volume and POC Sell Volume directly beneath Total Volume.
- Data Window POC Volume Plots: Most Recent POC Buy Volume and Most Recent POC Sell Volume are now plotted to the Data Window for alerts and downstream indicator/strategy integration.
- Customizable Level Labels: Set custom prefix text for POC, VAH, and VAL labels, and toggle origin date visibility on or off.
- Date Format Selection: Choose between multiple date formats for origin labels, including Day/Month names (e.g. "Monday", "Mon Aug 31"), numerical formats (e.g. "31/08", "08/31"), and ISO standard ("yyyy-MM-dd").
Phát hành các Ghi chú
Small change to update the public library used: Utility Library.Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.