OPEN-SOURCE SCRIPT

[TL5 Volume Profile] Market Structure Volume Distribution

91
[TL5 Volume Profile] Market Structure Volume Distribution (LuxAlgo – Modified)

Overview
This indicator is a modified version of the original
“Market Structure Volume Distribution” by LuxAlgo.

Attribution & Disclaimer
This script is not an official LuxAlgo release.
All original concepts, logic, and methodology are credited to LuxAlgo.
This modified version is shared for educational and experimental purposes only.

The script analyzes market structure breaks and distributes volume across price levels only when a confirmed break of structure (BOS) occurs, producing a structure-driven volume profile.

Important
The core calculation logic is unchanged
Only the visual communication of volume has been modified

Core Logic (Unmodified – Original LuxAlgo)
The following components are identical to the original LuxAlgo implementation:
Pivot high / pivot low detection
Break of structure (BOS) confirmation
Directional bias classification:
Bullish → Buy volume
Bearish → Sell volume
Volume attribution using breakout candle volume
Price-row aggregation
Execution window logic
Non-repainting behavior after pivot confirmation
How volume is calculated → unchanged

Modifications in This Version
1️⃣ Visual Communication Changes (Primary Modification)
The representation of volume has been modified while preserving the underlying data:
Alternative volume profile box layout
Fixed-width stacked profile rows
Buy vs sell dominance-based coloring
Increased text size for improved readability
Dashed execution range grid lines
How volume is displayed → modified
What volume represents → unchanged

2️⃣ Execution-Level Enhancements (Added)
Additional visual and alert-based features were added for workflow convenience:
Execution high and low tracking
Extended horizontal lines at execution boundaries
Alerts on execution high / low detection
Alerts on bullish and bearish structure breaks
These features do not affect volume calculations.

3️⃣ Parameter Default Adjustments
Increased default profile row count
Adjusted default profile width

These changes impact visual resolution only, not logic.
Input Parameters
Data Gathering

Execute on all visible range
Uses all visible bars on the chart.

Execute on the last N bars
Limits calculations to the most recent bars.

Pivot Length
Controls sensitivity of structure detection.

Profile
Profile Rows – Number of price levels
Profile Width – Maximum visual width
Profile Mode
Total Volume
Buy & Sell Volume

Style
Buy volume color
Sell volume color
Optional dotted grid levels

Limitations & Safeguards
Requires at least one confirmed BOS inside the execution window
Execution windows above 5000 bars are restricted
Uses confirmed pivots → non-repainting after confirmation
Script will prompt parameter adjustment if no BOS is detected

Attribution & Disclaimer
This script is not an official LuxAlgo release.
All original concepts, logic, and methodology are credited to LuxAlgo.
This modified version is shared for educational and experimental purposes only.

For the original and supported version, please refer to LuxAlgo’s official indicators on TradingView.

Intended Audience
Market structure traders
Volume profile users
Institutional-style price action analysis
Intraday and swing traders on liquid markets

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.