OPEN-SOURCE SCRIPT

Multi-Session Volume Profile [MarkitTick]

131
💡 This comprehensive Multi-Session Volume Profile indicator offers a sophisticated, array-based approach to Auction Market Theory. By simultaneously processing Daily, Weekly, Monthly, and Custom Session profiles, it empowers traders to visualize the migration of value across multiple timeframes without the performance overhead of standard heavy profile scripts. It is designed to identify key liquidity nodes, support/resistance zones defined by volume, and the directional bias of the market through Point of Control (POC) shifts.

✨ Originality and Utility

● Multi-Dimensional Value Analysis
Unlike standard volume profiles that often restrict users to a single timeframe or require multiple instances of an indicator, this script consolidates four distinct profile calculations into a single, efficient tool. It leverages Pine Script® arrays and custom types (`VPSlot`, `VolumeProfile`) to dynamically calculate volume distribution, ensuring minimal lag while maintaining high data granularity.

● Dynamic POC Shift Tracking
A standout feature of this utility is the "Shift Analysis." The indicator does not merely plot the current Point of Control; it calculates the delta between the current session's POC and the previous session's POC. This provides immediate visual feedback on "Value Migration"—whether the market is accepting higher prices (Bullish Shift) or lower prices (Bearish Shift).

● Granular Control via Custom Types
The script utilizes a custom quantitative structure (`type VolumeProfile`) to manage raw volume, highs, lows, and volatility slots independently for each timeframe. This allows for precise "row" calculations, ensuring that the volume distribution accurately reflects price action within the specific session, rather than broad approximations.

🔬 Methodology and Concepts

● Array-Based Bucketing
The core engine relies on a "Row Size" input to divide the session's price range into horizontal buckets (slots). As new price bars form, the script distributes the bar's volume across these slots. If a bar spans multiple slots, volume is distributed proportionally; if a bar is contained within a single slot, the total volume accumulates there. This mimics a true TPO (Time Price Opportunity) calculation using volume as the weight.

● Statistical Value Area Calculation
The Value Area (VA) is determined using a standard deviation proxy. The script identifies the POC (the slot with the highest accumulated volume) and then iteratively adds the next highest volume slots above or below the POC until the total accumulated volume reaches the user-defined percentage (default 70%).

● Session Logic and Reset
The indicator employs state-logic variables (`isNewDay`, `isNewWeek`, `isNewMonth`) to detect session boundaries. Upon a boundary cross, the `reset()` method clears the arrays and initializes a new profile, while the `draw()` method finalizes the visualization of the completed session. This ensures that the lines on the chart always represent the developing or completed structure of the specific time period.

🎨 Visual Guide

The indicator renders up to four distinct profiles, each color-coded for rapid identification.

● Daily Profile (Default: Yellow)
  • Solid Yellow Line: Represents the Daily POC (Point of Control)—the price level with the most volume traded today.
  • Dashed/Dotted Yellow Lines: Represent the Value Area High (VAH) and Value Area Low (VAL).
  • Yellow Background Box: Highlights the 70% Value Area, showing where the bulk of the day's trading occurred.


● Weekly Profile (Default: Blue)
  • Solid Blue Line: The Weekly POC. Use this to gauge the medium-term trend direction.
  • Blue Background: Encapsulates the weekly value area. A breakout from this zone often signals a significant trend continuation.


● Monthly Profile (Default: Purple)
  • Solid Purple Line: The Monthly POC. This is a high-timeframe magnet level, often acting as major support or resistance.
  • Purple Background: Shows the macro acceptance zone for the asset.


● Custom Session Profile (Default: Cyan)
  • Solid Cyan Line: Tracks the POC for a specific time window (e.g., 09:30-16:00). Ideal for isolating RTH (Regular Trading Hours) from electronic sessions.


● Labels and Shift Arrows
  • Right-Side Labels: Display the exact price of the POC for each active profile.
  • Shift Indicators (▲ / ▼): Located inside the label. A "▲" indicates the current POC is higher than the previous session's POC (Value Migration Up), while "▼" indicates the opposite.


📖 How to Use

● Trend Confirmation via Value Migration
Observe the Shift Arrows in the labels. If the Daily and Weekly profiles both show "▲" (Up Shift), it confirms that value is migrating higher, suggesting a healthy uptrend. Do not short the market when value is migrating up unless price breaks below the VAL.

● Mean Reversion Trades
When price extends far away from the POC but fails to establish value (volume) at those new levels, it often reverts back to the POC. Use the POC lines as profit targets for mean reversion strategies.

● Breakout Validation
A breakout is considered valid if price closes outside the Value Area (Background Box) and volume begins to build at the new levels. If price spikes out of the VAH but quickly returns inside the box, it is a "Failed Auction," and a rotation to the VAL is probable.

● Confluence Zones
Look for price levels where the Daily POC and Weekly VAL/VAH overlap. These "clusters" of volume act as reinforced support or resistance levels.

⚙️ Inputs and Settings

● General Settings
  • Row Size: Determines the resolution of the profile. Higher numbers (e.g., 100) give smoother, more precise profiles but use more resources. Lower numbers (e.g., 24) are blockier but faster.
  • Value Area %: The percentage of total volume to include in the VA. Standard is 70.0.
  • Show POC Shift Analysis: Toggles the display of the ▲/▼ drift comparison.


● Profile Toggles (Daily, Weekly, Monthly, Session)
  • Each section has individual toggles for Show Profile, Show Value Area, and Show Background.
  • Start of Week Day: Allows you to define when the weekly profile resets (e.g., Sunday or Monday).


● Alert Settings
  • Approach Distance (Ticks): Defines how close price must get to a POC/VAH/VAL level to trigger an "Approaching" alert.
  • Enable Alerts: Master switch to turn on internal alert condition checks.


🔍 Deconstruction of the Underlying Scientific and Academic Framework

● Auction Market Theory (AMT)
The script is grounded in Auction Market Theory, which posits that the market's primary purpose is to facilitate trade. Price advertises opportunity, and Volume records the acceptance of that opportunity. The "Value Area" represents the fair value established by buyers and sellers, while the POC represents the price of maximum consensus.

● Gaussian Distribution Application
The calculation of the Value Area at 70% is derived from the statistical properties of a Normal (Gaussian) Distribution, where approximately 68.2% of data points typically fall within one standard deviation of the mean. In this script, the POC acts as the mode (peak frequency), and the Value Area represents that first standard deviation of transactional volume.

● Volume-Price Integration
By integrating volume into price buckets (`VPSlot`), the indicator transforms two-dimensional time/price data into three-dimensional data (Time, Price, Volume). This reveals the "texture" of the market structure, distinguishing between high-volume nodes (strong acceptance) and low-volume nodes (rejection or emotional trading).

⚠️ Disclaimer

All provided scripts and indicators are strictly for educational exploration and must not be interpreted as financial advice or a recommendation to execute trades. I expressly disclaim all liability for any financial losses or damages that may result, directly or indirectly, from the reliance on or application of these tools. Market participation carries inherent risk where past performance never guarantees future returns, leaving all investment decisions and due diligence solely at your own discretion.

Penafian

Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.