Market Profile with TPO
Oct 8, 2021

The Market Profile with TPO indicator visualizes market activity by displaying time spent at specific price levels within a trading session. This tool helps traders identify key horizontal support and resistance areas through Time Price Opportunity (TPO) structures, highlighting where the market has spent the most time rather than just where the highest volume occurred.
Usage
The Usage section describes how the script can be used to analyze session dynamics and price distribution.
- Session Identification: The script automatically divides the trading day into sessions (Asian, London, US, Pre-Market, or 24hr). Each session generates its own Market Profile.
- Identifying Value Areas: Use the highlighted Value Area (VA) to determine where 68.26% (default) of the session's time was spent. Price trading above the Value Area High (VAH) or below the Value Area Low (VAL) can indicate expansion or mean-reversion opportunities.
- Point of Control (POC): Locate the price level with the highest TPO count, marked as the POC. This represents the "fairest" price of the session where the most time was spent.
- TPO Letters: If enabled, the script plots letters to show the progression of time. Each letter represents a period spent at a price tick, allowing traders to see the sequential development of the profile.
Details
The script functions by segmenting price action into "ticks" and counting how many time units (bars) price remains within those levels.
- Time Profile vs. Volume Profile: Unlike a traditional Volume Profile which measures liquidity, this indicator measures time. It highlights price levels that the market "accepted" by staying there longer.
- Tick Size Calculation: The script includes an "Auto Tick Size" feature that calculates an optimal price increment based on the average session height over a specified lookback period. This ensures the profile remains readable across different assets and volatilities.
- Pinescript Limitations: To maintain performance and adhere to platform limits, the indicator is capped at 500 TPOs. It uses labels and boxes to construct the visual profile.
- Dynamic Adjustments: The Value Area is calculated by starting at the POC and expanding outward to include the most significant TPO clusters until the target percentage is met.
Settings
Tick Size
- Auto Tick Size?: When enabled, the script automatically determines the price increment for TPO rows.
- Avg Tick Size - Bars Back: The number of bars used to calculate the average session height for auto-tick sizing.
- Average Target Session Height: The desired vertical density of the profile when using auto-tick sizing.
- Manual Tick Size: The fixed price increment used if Auto Tick Size is disabled.
Market Profile Options
- Value Area Percent: Sets the percentage of TPOs to include in the Value Area calculation (typically 70% or 68.26%).
- TPO Colors: Individual color settings for the Open, POC, In-Value, and Out-of-Value TPOs.
- TPO Letter Size: Adjusts the font size of the TPO labels on the chart.
- Plot TPO Letters?: Toggles the visibility of the alphabetic TPO characters.
- Show TPO Info Text?: Displays a summary table with session statistics (VAH, VAL, POC).
Market Session
- Use 24hr Session?: If enabled, the script treats the entire day as a single session.
- Session Times (1-4): Defines the specific GMT time ranges for different trading sessions.
- Show Session (1-4): Toggles the calculation and display for specific sessions.
FAQ
How does TPO differ from Volume Profile? TPO (Time Price Opportunity) measures the amount of time price spends at a specific level, whereas Volume Profile measures the amount of shares or contracts traded at that level.
Why are some letters missing or the profile looks cut off? Due to platform limitations, the script is limited to 500 TPO labels. If the tick size is too small or the session is too long, the script may reach this limit. Adjusting the "Target Session Height" or "Manual Tick Size" can resolve this.
How can I access this tool? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Free indicator
Get free access to this indicator on the platforms below.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.