Appearance
Personalize your experience
Mode
Accent Color
Layout
Direction
TPO Market Profile
Admin's ChoiceFreeTime-price-opportunity distribution with balance detection
0.0(0)
0 installs 0 0 commentsQ
42 listings12400 followers
Official QuaTick team — building advanced charting & trading tools for the Indian market.
View Profiletpomarket-profileauctioncanvasvalue-areaadvanced
Free
Open in QuaTick IDE Edit in IDE Version1.0.0
Updated2026-01-15
Compatiblecandlestick, heiken-ashi, line
Live Preview — BTC/USDT
About
TPO-style market profile based on repeated price acceptance from OHLC bars, useful for balance, initiative activity, and rotation reads.
Inputs
• OHLCV bars from Quatick Charts
• Optional orderbook snapshots for depth-aware variants
Renderer
• CANVAS tagged for marketplace filtering and runtime selection
Outputs & Parameters
Outputs
TPO Balancehistogram
Parameters
Profile Bars96
Tick Size1
Output Modedistance
Source Code
Edit in IDEtypescript
| 1 | /** |
| 2 | * TPO Market Profile - Quatick Marketplace Indicator |
| 3 | * Renderer: CANVAS |
| 4 | * Tags: tpo, market-profile, auction, canvas, value-area |
| 5 | */ |
| 6 | |
| 7 | const metadata = { |
| 8 | "id": "tpo-market-profile", |
| 9 | "name": "TPO Market Profile", |
| 10 | "renderer": "canvas", |
| 11 | "tags": [ |
| 12 | "tpo", |
| 13 | "market-profile", |
| 14 | "auction", |
| 15 | "canvas", |
| 16 | "value-area" |
| 17 | ], |
| 18 | "version": "1.0.0" |
| 19 | }; |
| 20 | const defaultParams = { |
| 21 | "lookback": 96, |
| 22 | "tickSize": 1, |
| 23 | "mode": "distance" |
| 24 | }; |
| 25 | |
| 26 | interface BarData { |
| 27 | time: number; |
| 28 | open: number; |
| 29 | high: number; |
| 30 | low: number; |
| 31 | close: number; |
| 32 | volume?: number; |
| 33 | } |
| 34 | |
| 35 | interface OrderBookLevel { |
| 36 | price: number; |
| 37 | size: number; |
| 38 | } |
| 39 | |
| 40 | interface OrderBookSnapshot { |
| 41 | time: number; |
| 42 | bids: OrderBookLevel[]; |
| 43 | asks: OrderBookLevel[]; |
| 44 | } |
| 45 | |
| 46 | interface IndicatorPoint { |
| 47 | time: number; |
| 48 | value: number; |
| 49 | color?: string; |
| 50 | } |
| 51 | |
| 52 | function priceBucket(price: number, tickSize: number): number { |
| 53 | return Math.round(price / tickSize) * tickSize; |
| 54 | } |
| 55 | |
| 56 | function calculate( |
| 57 | bars: BarData[], |
| 58 | params = defaultParams, |
| 59 | orderbook: OrderBookSnapshot[] = [] |
| 60 | ): IndicatorPoint[] { |
| 61 | const lookback = Math.max(1, Number(params.lookback ?? params.sessionBars ?? params.rows ?? 50)); |
| 62 | const tickSize = Math.max(0.000001, Number(params.tickSize ?? 1)); |
| 63 | const decay = Math.min(0.999, Math.max(0.01, Number(params.decay ?? 0.94))); |
| 64 | const profile = new Map<number, number>(); |
| 65 | const outputs: IndicatorPoint[] = []; |
| 66 | |
| 67 | for (let i = 0; i < bars.length; i += 1) { |
| 68 | const bar = bars[i]; |
| 69 | const start = Math.max(0, i - lookback + 1); |
| 70 | profile.clear(); |
| 71 | |
| 72 | for (let j = start; j <= i; j += 1) { |
| 73 | const sourceBar = bars[j]; |
| 74 | const bucket = priceBucket((sourceBar.high + sourceBar.low + sourceBar.close) / 3, tickSize); |
| 75 | const weight = Math.pow(decay, i - j); |
| 76 | const volume = Number(sourceBar.volume ?? 0) * weight; |
| 77 | profile.set(bucket, (profile.get(bucket) ?? 0) + volume); |
| 78 | } |
| 79 | |
| 80 | const snapshot = orderbook.find(book => book.time === bar.time) ?? orderbook[orderbook.length - 1]; |
| 81 | if (snapshot) { |
| 82 | for (const level of [...snapshot.bids, ...snapshot.asks]) { |
| 83 | const bucket = priceBucket(level.price, tickSize); |
| 84 | profile.set(bucket, (profile.get(bucket) ?? 0) + level.size * Number(params.orderbookWeight ?? 1)); |
| 85 | } |
| 86 | } |
| 87 | |
| 88 | let pocPrice = bar.close; |
| 89 | let maxVolume = 0; |
| 90 | for (const [price, volume] of profile.entries()) { |
| 91 | if (volume > maxVolume) { |
| 92 | maxVolume = volume; |
| 93 | pocPrice = price; |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | const delta = (bar.close - bar.open) * Number(bar.volume ?? 0); |
| 98 | const normalizedDelta = maxVolume > 0 ? delta / maxVolume : 0; |
| 99 | const distanceFromPoc = tickSize > 0 ? (bar.close - pocPrice) / tickSize : 0; |
| 100 | const value = Number(params.mode === 'delta' ? normalizedDelta : params.mode === 'distance' ? distanceFromPoc : maxVolume); |
| 101 | |
| 102 | outputs.push({ |
| 103 | time: bar.time, |
| 104 | value, |
| 105 | color: value >= 0 ? '#22c55e' : '#ef4444', |
| 106 | }); |
| 107 | } |
| 108 | |
| 109 | return outputs; |
| 110 | } |
| 111 |
Read-only preview. Open in the QuaTick IDE to edit and deploy.
Reviews
No reviews yet. Be the first to review this listing.
Discussion
Sign in to join the discussion.
Changelog
v1.0.0
Added as advanced Quatick volume/orderbook indicator with renderer metadata.
2026-01-15