OPEN-SOURCE SCRIPT

TPO Market Profile, Value Area, POC & Initial Balance [LunqFX]

3 649
A volume profile answers how MUCH traded at each price. A Market Profile answers a different question: how LONG price stayed there. This indicator draws the second one — a TPO profile, built letter by letter from the session's own half-hour brackets, with the Point of Control, the Value Area and the Initial Balance that come with it.

That distinction is the whole reason Market Profile exists as a separate discipline. Price can sit on a level for four hours on thin volume, and a volume profile will draw a narrow bar there while the auction was in fact spending most of its day at that price. Time at price and volume at price are two different maps of the same session, and they routinely disagree about where value actually is.

TPO stands for Time Price Opportunity, and the profile is the shape those opportunities build. It is the same structure floor traders assembled by hand before screens existed, which is why the Point of Control, the Value Area and the Initial Balance are named the way they are rather than the way a modern indicator would name them.

Included: TPO letters per session, the Point of Control, a value area at a percentage you choose, the Initial Balance of the first hour, levels extended to the right, a dashboard reading where price sits against that structure, and alerts on acceptance outside value and on the initial balance breaking.

❶ THE PROFILE AND WHAT IT COUNTS

The session is split into brackets of thirty minutes by default. Bracket one is A, bracket two is B, and so on. A bracket is credited to a price row when it traded anywhere inside that row, and each row is then drawn to the length of the count it collected.

The counting rule matters more than it sounds: a bracket counts ONCE for a row however many bars of that bracket touched it. That single rule is what makes the result a measure of time rather than of activity, and it is the entire difference from the volume profile beside it on your chart.

Brackets are cut from elapsed session time rather than from bar count, so the same profile appears whether you run the chart on 5 minutes or on 15.

A bracket can never be finer than a bar, and the script enforces that rather than letting you ask for something the chart cannot deliver. Request thirty-minute brackets on a one-hour chart and every bar would jump the counter by two, leaving half the brackets empty and the letter view printing A, C, E with the gaps missing. The bracket size is floored at the chart's own timeframe, and the dashboard shows the size actually in use.

The classic letter view — A, B, C printed at every price the bracket reached — is in the settings, and it is worth knowing why it is not the default. A true TPO grid needs one text object per row per bracket: forty rows across twenty-six brackets is more than a thousand objects for one session, against a platform cap of five hundred for the whole script. Packing each row's letters into a single text object instead runs into a second wall, because Pine centres a label's text on its anchor and gives no way to left-align it, so the profile spreads both ways from the anchor and lands on top of price. Rows drawn to their own length say the same thing and can be read at a glance. Both views are one setting apart, and there is a shift control for moving either clear of the candles.

❷ POINT OF CONTROL — THE POC

The price row that collected the most brackets — the price the session spent the most time at. It is drawn as a solid line and its row of letters is coloured gold.

A volume profile has a POC too, and the two are frequently at different prices on the same day. That gap is worth looking at: a volume POC well away from the time POC means the heavy trading and the long acceptance happened in different places, which is usually where the day's argument was.

The POC is where the auction found agreement. Traders use it as the session's magnet: price that leaves it tends to come back to it, and a session whose POC is far from its close often has unfinished business there.

❸ VALUE AREA

The band containing the chosen share of the session's total time, seventy percent by convention. It is built the classic way: start at the Point of Control, then step outward one row at a time, always taking whichever neighbouring row holds more time, until the target is enclosed.

Rows inside the value area are drawn bright; rows outside are dimmed. What you are looking at is the difference between where the market agreed on price and where it merely passed through.

❹ INITIAL BALANCE

The high and low set during the first two brackets — the first hour of the session on default settings. Drawn as two dotted lines.

The Initial Balance is the day's opening statement. A session that spends the rest of the day inside it is balanced and rotational, and its edges are the fade. A session that leaves it early has found a direction, and the break level becomes the reference for the rest of the day. The dashboard says which of the two is happening.

❺ THE DASHBOARD

A header that reads IN VALUE, ABOVE VALUE or BELOW VALUE according to where price sits against the developing profile, the number of brackets built so far, the Point of Control, both value area edges, the Initial Balance range, and whether that balance is still holding.

HOW TO USE IT

1 — Read the header first. In value means the session is balanced and the edges are the trade. Above or below value means price is away from agreement and either seeking a new one or coming back.

2 — Use the Point of Control as the session's magnet. It is the single most-referenced price of the day and the most common target for a return move.

3 — Watch the Initial Balance in the first two hours. Holding inside it points to a rotational day; leaving it early points to a directional one, and that judgement changes which of the levels above are worth trading.

4 — Compare today's value area with yesterday's. Higher value against lower value is the cleanest read of whether the auction is migrating, and it is visible at a glance once several sessions are on the chart.

5 — Read it beside a volume profile, not instead of one. Where the two disagree — heavy volume at a price the market barely spent time at, or the reverse — is where the most information is.

HOW IT WORKS

Sessions come from the symbol's own trading day, so nothing has to be configured per market. Elapsed session time in minutes divided by the bracket size gives each bar its bracket number, which keeps letters tied to the clock rather than to bar count.

When a session closes, its range is divided into the chosen number of rows. For every row the script walks the session's bars and marks which brackets overlapped that row, then counts the distinct brackets and builds the letter string. The row with the highest count becomes the Point of Control. The value area grows outward from it, one row at a time toward whichever neighbour holds more, until the chosen share of total brackets is enclosed. The Initial Balance is the extreme high and low among bars belonging to brackets one and two.

A completed session is drawn once and never touched again. The developing session is rebuilt once per closed bar.

Best used on intraday charts from 5 to 30 minutes, on instruments with a defined session — index futures and CFDs, gold, forex majors, large-cap crypto.

LIMITATIONS — read before relying on any of it

▸ This is a bar-based approximation of a floor-based technique. Classic TPO is built from every price the market printed during a bracket; here a bracket is credited to a row when any bar of that bracket overlapped the row. On low timeframes the two are nearly identical; on higher ones a single wide bar credits its bracket to more rows than the market may truly have spent time in, and the profile widens accordingly. Use 5 to 30 minute charts and the difference stays small.

▸ It needs an intraday chart. A profile is built from many bars inside one session, so on a daily chart or higher a single bar IS the session and there is nothing to divide. The script draws nothing there and the dashboard says so rather than printing a meaningless block. Use 5 to 30 minutes.

▸ Sessions are the symbol's own trading day. On a market that trades around the clock that is the calendar day in exchange time, which is a convention rather than a real auction boundary. Crypto profiles are therefore useful for structure but not for session theory in the futures sense.

▸ Only the most recent sessions are built. Older sessions are skipped entirely rather than drawn and discarded, because building every session of a long history is enough to time the script out. Scroll back far enough and the profiles stop.

▸ The first session on a freshly loaded chart can be partial. The script starts counting a session from the first bar it is given, and if the chart begins in the middle of a trading day that profile covers only the part it could see. It is normally out of range of the sessions actually drawn, but on a very short chart it is the one to distrust.

▸ The row count changes the shape. More rows give a finer profile with a more precise Point of Control; fewer rows smooth it. Two readings are only comparable at the same row count.

▸ The letter view is a compromise, and the default block view exists because of it. Pine caps a script at five hundred drawing objects and centres a label's text on its anchor with no way to left-align it, so neither a true letter grid nor a clean left-anchored letter column is possible. If you switch the letters on, expect them centred on the anchor rather than laid out as a terminal would lay them out.

▸ There is a hard platform limit on drawings. With the default forty rows and five sessions the script stays well inside it, but raising both together will start dropping the oldest rows.

▸ The Initial Balance is the first two brackets, which is one hour on default settings. Traders who define it differently should change the bracket size rather than expect the level to move.

▸ None of this predicts anything. A profile describes an auction that has already happened.

WHY IT IS ORIGINAL

Time at price and volume at price are different measurements, and this publication implements the first. The counting rule — one credit per bracket per row regardless of how many bars touched it — is what separates the two, and it is stated openly here rather than left inside the code.

The parts belong together because they are one object read at four resolutions. The letters are the raw shape. The Point of Control is its densest point. The value area is the band that shape encloses. The Initial Balance is the first hour of it, kept separate because the day's character is decided there. Remove the letters and the levels float above nothing; remove the levels and the shape has to be read by eye.

SETTINGS

▸ Profile — bracket size in minutes, price rows per session, value area percentage, how many sessions to keep. The bracket size is floored at the chart's timeframe, and the profile width is capped at the session's own bar count, so neither setting can be pushed into a state the chart cannot render honestly. ▸ Levels — Point of Control, value area edges, initial balance, and how far levels extend to the right. ▸ Visuals — blocks or letters, profile width and transparency, letter size, how far to shift the profile sideways, neon candles, dashboard and its position.

ALERTS — accepted above value, accepted below value, initial balance broken up, initial balance broken down. All fire on closed bars.

NON-REPAINTING — a completed session's profile is drawn once from closed bars and is never recalculated. Only the developing session updates, and it rebuilds once per closed bar rather than tick by tick.

This indicator is an educational market-analysis tool, not financial advice. It describes the structure of sessions that have already completed and does not predict future prices. Always confirm with your own analysis and manage your risk.

免責事項

これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。