OPEN-SOURCE SCRIPT
Volume Profile Breakout Continuation

What this is - and is not. This is one state machine, not separate tools stacked on a chart. A range-compression detector, a volume profile, a higher-timeframe filter, a pullback tracker and a trade-management layer are chained so that each stage only exists because the previous one fired. It is not a volume profile indicator with signals bolted on, and it is not a breakout indicator with a profile drawn next to it.
Why the parts are inseparable. The profile is built only over the bars of a detected accumulation range - remove the range detector and there is nothing to profile. The breakout is defined as a close outside that same range - remove the profile and the pullback has no POC to return to. The trigger is a close back through the POC in the breakout direction - remove the breakout and the trigger has no direction. Take any stage away and the remaining logic has nothing to act on.
Mechanism
1. Accumulation. When the range of the last N bars is at or under k × ATR, an accumulation box opens on that bar and grows while price stays inside. It is drawn as it forms, not in hindsight. A box that expands past the abandon threshold, or runs too long, is dropped and faded.
2. Profile. A small volume-at-price histogram is built inside the box from the accumulation bars only and refreshed each bar. Each bar's volume is spread evenly across the rows its high-low spans. POC is the heaviest row; the value area is expanded outward from the POC to the chosen percentage.
3. Breakout. A confirmed close outside the box. With the higher-timeframe filter on, long breakouts require the prior completed HTF close above its EMA and shorts below. At this moment POC, VAL and VAH are frozen and a second box opens to frame the pullback.
4. Pullback. Price comes back into the POC zone (a tolerance expressed as a percentage of the range height). The setup is invalidated by a close through the far edge of the value area or by a wait timeout.
5. Trigger. A confirmed close back through the POC in the breakout direction marks the entry.
What you see
- Purple accumulation boxes with the profile tucked inside (heatmap or single-hue mode, POC row in gold).
- A teal pullback box from the breakout bar to the trigger bar, with the POC line running through it and a label on the bar that touches the zone.
- Entry labels with entry, TP and SL; TP and SL boxes that extend while the trade is open and truncate at the exit; exit labels showing the percentage actually taken. Past trades stay on the chart.
- A developing session profile floated off the last bar, plus finished day profiles painted in place at each rollover and never redrawn.
- A monospace dashboard: stage, HTF bias, accumulation range, setup and day POC, day value area, pullback status, position, TP/SL, running record, readiness.
Settings
- Accumulation: range lookback, compression multiple, minimum and maximum bars, abandon multiple, ATR length.
- Setup profile: rows, value-area percentage, histogram width, past-setup fade and count.
- Session profile: rows, width, offset, side, color mode, past profiles to keep and their width and transparency.
- HTF bias: on/off, timeframe (auto steps up one tier from the chart), EMA length.
- Pullback: POC zone half-width, maximum wait.
- Trade management: fixed-percent or ATR-multiple TP/SL, max bars in trade, entry cooldown, optional post-exit cooldowns by exit type, past-box fade.
- Session: end-of-day flatten hour and minute (New York).
- Webhook: optional JSON payload on entry and exit with a strategy id and quantity.
How to use. Start with the default settings on the timeframe you normally trade and watch how often boxes form and how often breakouts fail before the pullback. Tighten the compression multiple for fewer, cleaner ranges; widen the POC zone if pullbacks are missing the level by a hair. The trade-management layer is a study aid: the labels and boxes show what the mechanical rules would have done, so you can judge the logic against your own read of the chart.
The defaults are a starting point for one instrument, not an optimized or recommended configuration, not intended to suggest any particular outcome.
Non-repainting. Every state transition, entry and time-based exit is evaluated on confirmed bars only. The higher-timeframe values are requested with lookahead off and reference the previous completed HTF bar, so history and live behave the same. Finished day profiles are painted once at the rollover and never redrawn. TP and SL are checked against the bar's high and low. The profile uses chart-timeframe bar volume, not tick data, so it is an approximation, as every profile built in Pine is; instruments without volume fall back to a time-at-price count.
สคริปต์แบบโอเพนซอร์ส
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
This INDICATOR to STRATEGY to LIVE Trading
Brokerage Setup: Tradovate (futures) & Alpaca (stocks/crypto)
TUTORIAL Trade live in 2 min: youtube.com/@CodaPro-ai
Platform: codapro.ai
Custom builds: upwork.com/freelancers/ariscodes
Brokerage Setup: Tradovate (futures) & Alpaca (stocks/crypto)
TUTORIAL Trade live in 2 min: youtube.com/@CodaPro-ai
Platform: codapro.ai
Custom builds: upwork.com/freelancers/ariscodes
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน
สคริปต์แบบโอเพนซอร์ส
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
This INDICATOR to STRATEGY to LIVE Trading
Brokerage Setup: Tradovate (futures) & Alpaca (stocks/crypto)
TUTORIAL Trade live in 2 min: youtube.com/@CodaPro-ai
Platform: codapro.ai
Custom builds: upwork.com/freelancers/ariscodes
Brokerage Setup: Tradovate (futures) & Alpaca (stocks/crypto)
TUTORIAL Trade live in 2 min: youtube.com/@CodaPro-ai
Platform: codapro.ai
Custom builds: upwork.com/freelancers/ariscodes
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน