OPEN-SOURCE SCRIPT
Market Profile with TPO - chorse

This Pine Script indicator draws a Market Profile (also known as a Time Price Opportunity, or TPO, chart) directly onto your candlestick chart. It is an advanced analytical tool used primarily by futures and commodities traders to understand market structure and who is in control (buyers or sellers) at various price levels.
The Market Profile is built over a specific trading session (which you can customize) and visually organizes price data to show where the market spent the most time at a particular price.
TPO (Time Price Opportunity)
The basic building block. Each letter (A, B, C, etc.) represents a specific, equal block of time (e.g., 30 minutes) during the session. The profile is formed by stacking these letters horizontally across the price axis, showing all the price levels traded during that time block. The script plots TPO letters (TPO_Names array) at the bar index corresponding to when that price was traded. This creates the typical profile shape.
Point of Control (POC)
The single price level that has the most TPOs (the longest horizontal row of letters). It represents the level where the market spent the most time and is considered the fairest price or gravitational center for the session.
Calculated by finding the price level (TPO_POC) with the maximum number of TPOs (max_TPOs). The script includes logic to break ties by choosing the POC closest to the session's midpoint (TPO_mid). This level is highlighted with a box and a line.
Value Area (VA)
The price range that contains a configurable percentage of the total TPOs (typically 68.26% or 70%). This zone is considered the "fair value" range where the majority of the session's activity occurred. Calculated as the range between the Value Area High (VAH) and Value Area Low (VAL). The script uses an iterative function (fn_build_VA) to expand out from the POC until the defined percentage (value_area_pct) of TPOs is included. These boundaries are highlighted with lines.
The Market Profile is built over a specific trading session (which you can customize) and visually organizes price data to show where the market spent the most time at a particular price.
TPO (Time Price Opportunity)
The basic building block. Each letter (A, B, C, etc.) represents a specific, equal block of time (e.g., 30 minutes) during the session. The profile is formed by stacking these letters horizontally across the price axis, showing all the price levels traded during that time block. The script plots TPO letters (TPO_Names array) at the bar index corresponding to when that price was traded. This creates the typical profile shape.
Point of Control (POC)
The single price level that has the most TPOs (the longest horizontal row of letters). It represents the level where the market spent the most time and is considered the fairest price or gravitational center for the session.
Calculated by finding the price level (TPO_POC) with the maximum number of TPOs (max_TPOs). The script includes logic to break ties by choosing the POC closest to the session's midpoint (TPO_mid). This level is highlighted with a box and a line.
Value Area (VA)
The price range that contains a configurable percentage of the total TPOs (typically 68.26% or 70%). This zone is considered the "fair value" range where the majority of the session's activity occurred. Calculated as the range between the Value Area High (VAH) and Value Area Low (VAL). The script uses an iterative function (fn_build_VA) to expand out from the POC until the defined percentage (value_area_pct) of TPOs is included. These boundaries are highlighted with lines.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının mimarı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının mimarı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.