OPEN-SOURCE SCRIPT

3D Market Profile [BOSWaves]

6 006
3D Market Profile [BOSWaves] - TPO Time Price Distribution with Polyline 3D Extrusion, Value Area Construction, and Initial Balance Mapping

Overview

3D Market Profile [BOSWaves] is a Time Price Opportunity profile system that constructs a TPO distribution from recent chart history and renders it as a three-dimensional extruded structure using polyline geometry, where row width reflects the number of TPO period prints at each price level, density-based gradient coloring communicates participation concentration, and perspective faces on the top and side edges of each row provide spatial depth that standard two-dimensional profiles cannot convey.

снимок

Instead of displaying a flat histogram alongside price, this system aggregates chart bars into complete TPO periods at the configured timeframe, assigns sequential alphabet letters to each period, and accumulates per-row letter counts across the full profile window. The resulting distribution drives a full market profile analytical framework including Point of Control identification, Value Area expansion from the POC outward, and Initial Balance range derivation from the opening TPO periods. All structural levels are rendered as extending reference lines and labeled price readouts that project beyond the profile face.

This creates a market profile visualization that combines the structural depth of conventional TPO analysis with a three-dimensional rendering system that makes profile shape and density immediately readable across varying chart zoom levels. The extruded top and side faces follow the profile contour row by row, the rear glass plane frames the distribution within a perspective bounding box, and the complete wireframe connects front and rear geometry with depth-offset corner lines that reinforce the spatial orientation of the profile structure.

Price is therefore evaluated against a fully formed TPO distribution anchored to recent chart history, with POC, Value Area, and Initial Balance levels providing the standard market profile reference framework in a spatially rich visual presentation.

Conceptual Framework

3D Market Profile is founded on the principle that TPO market profile analysis becomes significantly more visually accessible when the distribution is rendered with three-dimensional spatial depth, allowing traders to read profile shape, density concentration, and structural levels at a glance without the visual ambiguity that flat two-dimensional histogram representations produce at different zoom levels and screen resolutions.

Traditional market profile implementations render uniform flat row boxes where the only visual differentiation between high and low density rows is bar width, which becomes difficult to assess comparatively when profiles contain many rows or are viewed on smaller screens. This framework adds spatial depth through extruded top and side faces that follow the profile contour, creating a volumetric bar chart where density is communicated through both width and three-dimensional geometry simultaneously, and gradient coloring that progresses from the configured low-density to high-density colors adds a third visual dimension that reinforces the density reading.

Three core principles guide the design:
  1. TPO distribution should be constructed from complete timeframe periods rather than individual bars, ensuring each period contributes exactly one letter print to each price row it trades through regardless of how many chart bars compose that period.
  2. The three-dimensional extrusion should follow the profile contour row by row rather than applying a uniform rectangular extrusion, preserving the profile's structural shape in the depth geometry and maintaining the analytical significance of the distribution's outline.
  3. Standard market profile reference levels including POC, Value Area High, Value Area Low, and Initial Balance should be derived from the TPO distribution using conventional methodology and rendered as structural references that extend beyond the profile face for ongoing price interaction monitoring.

This shifts market profile visualization from flat histogram reading into a spatially rich three-dimensional distribution analysis where density, shape, and structural levels are simultaneously communicated through geometry, color, and depth.

Theoretical Foundation

The indicator combines chart bar aggregation into complete TPO periods at the configured timeframe, sequential alphabetical letter assignment per period, per-row letter count accumulation across the full profile window, density-normalized gradient coloring with power transformation, POC identification through maximum count with proximity tiebreaking, outward value area expansion from POC with alternating upper and lower priority, Initial Balance derivation from the opening period count, and polyline-based 3D geometry construction using depth-offset coordinates for top faces, side end caps, and rear glass plane.

Period aggregation groups chart bars by their TPO clock value, merging consecutive bars sharing the same period timestamp into a single period high-low range. Each completed period receives the next sequential alphabet letter from A through Z then a through z, repeating modularly for profiles with more periods than the alphabet. Row assignment maps each period's full high-low range to the corresponding row bins, contributing one print to every row from the period low bin to the period high bin inclusive. The POC selection resolves ties between equal-count rows by choosing the one closest to the mid-range price. Value area expansion adds rows alternately from the high and low sides of the POC based on which adjacent row has the greater count, continuing until the accumulated count reaches the target percentage of total prints.

Four internal systems operate in tandem:
  • Period Aggregation Engine: Groups chart bars by TPO clock timestamp into complete periods, accumulating per-period high-low ranges and assigning sequential letter identifiers that are used for both letter rendering and Initial Balance period counting.
  • TPO Distribution Builder: Accumulates per-row letter strings and print counts from the period high-low ranges, producing the row width and text data that drives all subsequent profile rendering and level calculations.
  • 3D Geometry Engine: Constructs polyline polygon arrays for the extruded top faces following each row's width contour, side end cap faces at the outer edge of each row, and the rear glass plane bounding box, using configurable depth bar and depth row offsets to establish perspective coordinates.
  • Level and Label System: Derives POC, VAH, VAL, and IB level prices from the distribution, renders dual glow and core lines extending across the profile and beyond with configurable tail length, and places price readout labels at the right edge of the level lines.

This design ensures the 3D geometry follows the actual distribution contour while all standard market profile reference levels are derived from the same underlying TPO count data that drives the visual rendering.

How It Works

3D Market Profile evaluates price through a sequence of aggregation and profile-building processes:
  1. Profile Range Calculation: The highest high and lowest low across the configured bar count establish the full profile range, which is divided into the configured number of rows to produce the uniform row height used for all price-to-row mapping.
  2. TPO Period Aggregation: Chart bars are grouped by their TPO timeframe clock value. Consecutive bars sharing the same period timestamp are merged into a single period with the accumulated high and low. Each completed period boundary triggers storage of the completed period data.
  3. Letter Assignment and Row Filling: Each period is assigned the next sequential alphabet letter. For each period, the low and high row bins are calculated and the period letter is appended to the row text string for every row from low to high inclusive, with the row print count incremented accordingly.
  4. Initial Balance Derivation: The first N periods as configured by the IB Periods setting contribute their highs and lows to the Initial Balance range, producing the IBH and IBL reference levels that mark the range established during the opening portion of the profile window.
  5. POC Identification: The row with the maximum print count is identified as the POC. When multiple rows share the maximum count the row closest to the profile mid-range price is selected, providing a consistent tie-breaking rule that favors centrally located levels.
  6. Value Area Construction: Starting from the POC row, adjacent rows are added one at a time by selecting the higher-count neighbor on each iteration until the accumulated count reaches the VA percentage target of total prints.
  7. Profile Geometry Calculation: The profile start position is determined by the placement setting, with Right of Price positioning the profile in forward chart space at the configured right offset and On Range anchoring it to the beginning of the analyzed window. Row widths are calculated as print count multiplied by cell width.
  8. 3D Top Face Construction: For each occupied row, a quadrilateral polyline polygon is constructed connecting the row's front top-left, front top-right, depth-offset rear top-right, and depth-offset rear top-left coordinates, producing the extruded top surface that follows the profile contour.
  9. 3D Side Cap Construction: For each occupied row, a quadrilateral polyline polygon connects the front right edge top, front right edge bottom, depth-offset rear right bottom, and depth-offset rear right top, producing the side end cap that closes the extruded row geometry.
  10. Front Profile Rendering: Box objects are created for each occupied row with density-gradient fill coloring, POC and single print override coloring, and border styling that distinguishes the POC row, single print rows, Value Area rows, and standard rows.
  11. TPO Letter Rendering: Individual label objects are placed at the center x and mid-price y position of each letter's cell within the profile, with color distinguishing POC, single print, and standard rows.
  12. Level and Label Rendering: POC lines are rendered as dual glow and core polylines. VAH and VAL render as dotted lines. IBH and IBL render as dashed lines. All extend from the configured tail length left of the profile to the right edge of the depth geometry. Price labels are placed at the right extent of each line.

Together, these elements form a complete three-dimensional market profile rendering where the TPO distribution drives both the analytical reference framework and the spatial geometry of the extruded visualization.

Interpretation

3D Market Profile should be interpreted as a conventional TPO market profile with three-dimensional spatial depth encoding applied to the distribution geometry:
  • Profile Width: The horizontal extent of each row reflects its total TPO print count relative to the maximum, with wider rows indicating more time spent at that price level and narrower rows indicating less acceptance.
  • Density Gradient Coloring: Row fill progresses from the configured low-density color at minimum print count to the high-density color at maximum print count, with a power-transformed gradient that spreads color differentiation across the density range.
  • Point of Control Row (POC): The widest row rendered in the POC color identifies the price level with the greatest time-at-price concentration across the profile window, representing the most accepted price during the analyzed period.
  • Value Area: Rows between VAH and VAL rendered with full opacity represent the price range containing the configured percentage of total TPO prints, identifying the zone of concentrated acceptance around the POC.
  • Non-Value Area Rows: Rows outside the Value Area are rendered with additional transparency and darkened coloring, visually receding from the Value Area rows to communicate their reduced relative acceptance.
  • Single Print Rows: Rows with exactly one TPO period print are highlighted in the high-density color with a distinct border, marking price levels visited by only one period that price may return to complete the auction.
  • TPO Letters: Sequential alphabet letters within each row identify which periods traded through that price level, with the letter sequence providing a chronological audit trail of price movement across the profile window.
  • 3D Top Faces: Extruded top surfaces following the profile contour row by row provide depth cues that make the profile shape readable as a three-dimensional structure, with the contour step pattern revealing the distribution's outline in spatial form.
  • 3D Side Caps: End cap faces at the outer edge of each row close the extruded geometry and reinforce the row width differences through the depth dimension, with darker coloring distinguishing the side geometry from the front profile.
  • 3D Frame: The rear glass plane and wireframe perspective box orient the profile within three-dimensional chart space, connecting front and rear geometry with corner depth lines that establish the spatial extent of the distribution structure.
  • POC Level: Dual glow and core lines extending from the profile mark the POC price for ongoing reference, with the glow providing visual prominence that makes the POC immediately identifiable against background price action.
  • VAH and VAL Lines: Dotted lines at the Value Area boundaries mark the upper and lower edges of the high-acceptance zone for ongoing price interaction monitoring.
  • IBH and IBL Lines: Dashed lines at the Initial Balance high and low mark the range established during the opening TPO periods, providing the conventional IB reference framework for range extension and balance monitoring.

Profile shape, POC location, Value Area extent, single print density, and IB range collectively provide more structural context than any element in isolation.

Signal Logic & Visual Cues

3D Market Profile does not generate discrete entry or exit signals but provides continuous structural reference through the standard market profile analytical framework:
  1. POC Magnetic Reference: The POC level identifies the price where the greatest time-based acceptance occurred within the window, frequently acting as a mean reversion magnet when price extends to the Value Area boundaries.
  2. Value Area Boundary Interaction: Price moving outside the Value Area enters statistically less accepted price territory, providing context for potential reversion trades back toward the Value Area or range extension trades when acceptance establishes beyond the boundary.

Initial Balance range interactions provide the conventional IB framework where price accepting above IBH or below IBL signals potential range extension, while price remaining within the IB range suggests balanced auction conditions.

Strategy Integration

3D Market Profile fits within conventional market profile and auction theory-based analytical approaches:
  • POC Reversion Framework: Use the POC line as a dynamic mean reversion reference when price has extended to or beyond the Value Area boundaries, with the POC representing the price where the distribution's greatest acceptance occurred and where reversion activity frequently concentrates.
  • Value Area Boundary Trading: Monitor price behavior at VAH and VAL for acceptance or rejection signals. Price accepting above VAH or below VAL by closing multiple bars beyond the boundary suggests genuine range extension. Price rejecting at the boundaries and returning inside the Value Area suggests reversion continuation.
  • Initial Balance Range Extension: Use IBH and IBL as directional range extension references. Price establishing acceptance above IBH with sustained closes indicates potential bullish range extension. Price accepting below IBL indicates potential bearish extension.
  • Single Print Targeting: Treat single print rows as potential return targets for incomplete auction areas, monitoring for price to revisit and fill these levels with additional TPO participation in subsequent sessions.
  • Profile Placement Selection: Use Right of Price placement to keep the profile in forward chart space as a live reference for current and upcoming price interaction. Use On Range placement to anchor the profile to the historical window for post-session analysis and retrospective structural assessment.
  • Timeframe and Length Calibration: Match the TPO timeframe to the trading session type being analyzed. Thirty-minute TPOs with standard length produce a conventional daily profile. Shorter timeframes produce intraday micro-profiles. Longer timeframes produce multi-day macro profiles that reveal larger structural distribution patterns.

Technical Implementation Details
  • Period Aggregation: TPO clock-based grouping of chart bars into complete periods with high-low range accumulation and sequential letter assignment
  • Distribution Builder: Per-row letter string accumulation and print count tracking across the full period set
  • POC Selection: Maximum count identification with mid-range proximity tiebreaking for consistent level placement
  • Value Area Engine: Outward expansion from POC with alternating upper and lower priority based on adjacent row count comparison
  • 3D Geometry: Polyline quadrilateral construction for top faces and side caps using depth bar and depth row offset coordinates
  • Front Profile: Box objects with density gradient fill, POC override, single print override, and Value Area transparency differentiation
  • Level System: Dual glow and core POC lines, dotted VA lines, dashed IB lines, and price readout labels at configurable tail length
  • Performance Profile: Full object cleanup and rebuild on last bar with label count cap enforcement and configurable profile length maximum

Optimal Application Parameters

Timeframe Guidance:
  • 1 - 5 min: Intraday micro-profile analysis with shorter length and faster TPO timeframe for session-level distribution tracking within a single trading day
  • 15 - 60 min: Session profile construction with standard thirty-minute TPO timeframe and balanced row count for conventional daily market profile analysis
  • 4H - Daily: Multi-session macro-profile analysis with longer length and higher TPO timeframe for structural distribution patterns spanning multiple sessions

Suggested Baseline Configuration:
  • Length: 180
  • Rows: 24
  • Value Area %: 70
  • Placement: Right of Price
  • TPO Timeframe: 30
  • Show TPO Letters: Enabled
  • Initial Balance Periods: 2
  • 3D Depth (Bars): 6
  • 3D Height (Rows): 0.42
  • Show 3D Frame: Enabled
  • Show POC / VA: Enabled
  • Show Initial Balance: Enabled
  • Show Level Labels: Enabled

These suggested parameters should be used as a baseline; their effectiveness depends on the instrument's session structure, typical daily range, and preferred profile granularity, so fine-tuning is expected for optimal performance.

Parameter Calibration Notes

Use the following adjustments to refine behavior without altering the core logic:
  • Too few or too many rows: Adjust Rows to increase or decrease vertical price resolution, calibrating row height to the instrument's typical daily range so rows represent meaningful price increments rather than noise-level or excessively large bands.
  • Letters too cramped or too sparse: Adjust TPO Cell Width to control the horizontal space allocated to each letter, increasing for wider, more readable letter display or decreasing to fit more prints within the same profile width.
  • Profile too narrow or too wide: The profile width scales automatically with the maximum row print count multiplied by cell width. Adjust Length to include more or fewer bars in the profile window, and adjust Cell Width to scale the resulting profile width.
  • 3D extrusion too deep or shallow: Adjust 3D Depth (Bars) to control horizontal perspective extent and 3D Height (Rows) to control vertical depth, calibrating the spatial effect to the chart's aspect ratio and current zoom level.
  • Profile overlapping price action: Use Right of Price placement with a larger Right Offset value to push the profile further from current price, or switch to On Range placement to anchor it to the beginning of the analyzed window instead.
  • Initial Balance range too narrow or wide: Adjust Initial Balance Periods to include more or fewer opening TPO periods in the IB calculation. Two periods represents the conventional first trading hour using thirty-minute TPOs; increase for a wider opening range definition.
  • TPO timeframe mismatch: Match the TPO Timeframe to the session type being analyzed. Using a thirty-minute timeframe on a daily chart produces very few periods and minimal distribution differentiation; use a timeframe appropriate to the chart timeframe and session length.

Adjustments should be incremental and evaluated across multiple session types rather than isolated market conditions.

Performance Characteristics

High Effectiveness:
  • Session-structured markets where a defined trading window produces a clear distribution with identifiable POC and Value Area that serve as reliable structural references across subsequent sessions
  • Instruments with consistent daily range where row height calibrates to meaningful price increments and the distribution produces a recognizable bell-curve or skewed profile shape
  • Market profile-based trading approaches where POC, Value Area, and Initial Balance provide the primary structural reference framework for directional bias and level interaction analysis
  • Three-dimensional visualization workflows where the extruded profile geometry provides immediate spatial readability that improves structural assessment speed relative to flat two-dimensional profiles

Reduced Effectiveness:
  • Markets with highly variable daily ranges where a fixed row count produces inconsistent row heights across different sessions, reducing the comparability of distribution shapes between profile windows
  • Instruments without clear session structure where the TPO period aggregation produces few complete periods within the profile length, resulting in sparse distributions with limited analytical differentiation
  • Very short profile lengths where insufficient bars produce too few TPO periods to create a statistically meaningful distribution with identifiable POC and Value Area levels
  • Extremely compressed consolidation environments where price trades within a narrow range and all rows receive similar print counts, producing a flat distribution without the structural differentiation that makes POC and Value Area meaningful
  • Markets with frequent large gaps where the profile range is dominated by gap space rather than traded price, producing distributions with many empty rows that reduce the analytical value of the concentration levels

Integration Guidelines
  • Confluence: Combine with BOSWaves structural tools, order flow analysis, or momentum indicators to validate POC and Value Area interactions with broader analytical context before acting on market profile reference levels
  • POC Migration Tracking: Monitor whether successive profile POC levels are migrating higher, lower, or remaining stable as a secondary directional bias indicator. Consistently rising POC levels across multiple sessions suggest sustained upward value migration.
  • Value Area Overlap Assessment: Compare Value Area ranges across successive profiles to assess whether price is finding acceptance in overlapping value zones, indicating market balance, or developing non-overlapping value areas, indicating directional value migration.
  • Single Print Completion Monitoring: Track single print rows as potential return targets in subsequent sessions. The market profile principle that incomplete auctions tend to be revisited makes single prints valuable anticipatory reference levels for future price behavior.
  • IB Range Context: Use the Initial Balance range as a daily bias anchor. Strong directional moves that establish acceptance well outside the IB range early in the session carry greater continuation probability than marginal IB extensions that quickly revert inside.

Disclaimer

3D Market Profile [BOSWaves] is a professional-grade TPO market profile visualization and auction theory analysis tool. It uses timeframe-based period aggregation with standard market profile methodology but does not predict future price movements. Results depend on market conditions, instrument session structure, parameter selection, and disciplined execution. BOSWaves recommends deploying this indicator within a broader analytical framework that incorporates order flow context, structural analysis, and comprehensive risk management.

Отказ от ответственности

Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.