OPEN-SOURCE SCRIPT

Fixed Range Volume Profile [ApexFlow]

3 174
━━━━━━━━━━━━━━━━━━━━
📊 WHAT THIS INDICATOR DOES
━━━━━━━━━━━━━━━━━━━━

Fixed Range Volume Profile (FRVP) distributes traded volume across discrete price levels over a user-defined lookback window. It identifies the [color=#F5C518]Point of Control (POC)[/color], [color=#00E676]Value Area High (VAH)[/color], and [color=#FF5252]Value Area Low (VAL)[/color] — the three levels used by institutional order flow analysts to determine where the majority of market participation occurred within any given range.

━━━━━━━━━━━━━━━━━━━━
⚙️ METHODOLOGY
━━━━━━━━━━━━━━━━━━━━

📦 PRICE BINS
The high-to-low price range of the lookback window is divided into N equal-height rows (default: 24). Each row represents a discrete price bucket.

📐 VOLUME DISTRIBUTION — ACCURATE MODE
When "Accurate Distribution" is enabled, each bar's volume is spread proportionally across all rows whose price range overlaps with that bar's high-to-low span. The weight assigned to each row equals:

overlap / (bar_high − bar_low) × bar_volume

This mirrors how footprint charts distribute volume and produces a more precise profile than HLC3 bucket placement alone.

⚡ VOLUME DISTRIBUTION — FAST MODE
When Accurate mode is off, each bar's volume is allocated to a single row using the bar's typical price: (High + Low + Close) / 3. Faster on large lookbacks.

🎯 [color=#F5C518]POINT OF CONTROL (POC)[/color]
The row with the highest accumulated volume. Represents the price level with the greatest degree of two-sided market activity. POC acts as a magnetic reference for price — markets frequently return to test it during subsequent sessions.

📦 VALUE AREA (VA)
Starting from the POC row, adjacent rows are added in order of highest volume — expanding upward or downward, whichever row holds more volume at each step — until the cumulative volume of selected rows reaches the user-defined percentage of total volume (default: 70%). This mirrors the CME Group standard for Market Profile value area construction.

VAH = top of the highest included row
VAL = bottom of the lowest included row

📏 RANGE HIGH / LOW
The absolute high and low of all bars in the lookback window. Displayed as dotted reference lines when enabled.

━━━━━━━━━━━━━━━━━━━━
🖥️ VISUAL COMPONENTS
━━━━━━━━━━━━━━━━━━━━

▶ Right Histogram — volume bars drawn to the right of current price, scaled to the highest-volume row. [color=#F5C518]POC row[/color] highlighted in gold, [color=#00BCD4]value area rows[/color] in teal, non-value area rows in grey.

▶ Value Area Zone — a semi-transparent box spanning [color=#00E676]VAH[/color] to [color=#FF5252]VAL[/color] across the entire range. Provides immediate visual context for the accepted range of market activity.

▶ POC Band — a narrow band centered on the [color=#F5C518]POC line[/color] showing the exact price-row boundaries of the control point.

▶ Key Level Lines[color=#F5C518]POC[/color] (bold solid), [color=#00E676]VAH[/color] (dashed), [color=#FF5252]VAL[/color] (dashed), Range H/L (dotted). All extend right by a configurable number of bars.

▶ Labels — live price values pinned to the right end of each line.

━━━━━━━━━━━━━━━━━━━━
🔧 SETTINGS
━━━━━━━━━━━━━━━━━━━━

PROFILE
Lookback Bars — number of bars the profile covers (20–500, default 100)
Rows — price bucket resolution (10–100, default 24)
Value Area % — percentage of volume defining the accepted value area (default 70)
Accurate Distribution — spread volume across bar range vs. HLC3 bucket placement

DISPLAY
Right Histogram — toggle the volume bars
Value Area Zone — toggle the VA fill box
POC Band — toggle the POC price-row highlight band
Range H/L — toggle the range extreme lines
Histogram Width (bars) — horizontal size of the volume bars (5–150)
Extend Right (bars) — how far key level lines project beyond current price (10–300)

COLORS
All elements are independently color-configurable including transparency.

━━━━━━━━━━━━━━━━━━━━
📈 HOW TO USE
━━━━━━━━━━━━━━━━━━━━

🧲 [color=#F5C518]POC as a Magnet[/color] — price tends to revisit the POC after extended moves away from it. A failed auction above [color=#00E676]VAH[/color] or below [color=#FF5252]VAL[/color] often results in a rotation back through the value area toward [color=#F5C518]POC[/color].

⚖️ Value Area as Acceptance / Rejection — price trading inside the value area signals balanced, two-sided activity (consolidation). Price trading outside and rejecting signals one-sided pressure (trend continuation). Price breaking outside and holding signals value migration.

🔑 [color=#00E676]VAH[/color] / [color=#FF5252]VAL[/color] as Reaction Levels — institutional participants often defend [color=#00E676]VAH[/color] and [color=#FF5252]VAL[/color] as reference points for entries, scaling, or stops. Watch for reaction candles at these levels.

🔭 Adjust Lookback to Context
Intraday scalping: 30–60 bars on 1–5 min
Swing setups: 50–200 bars on 1H–4H
Directional bias: 100–500 bars on Daily

━━━━━━━━━━━━━━━━━━━━
📝 NOTES
━━━━━━━━━━━━━━━━━━━━

• Calculation runs on the last bar only — zero performance impact on historical bars.
• Profile updates on every tick of the current bar, keeping all levels live.
• Histogram draws into future bar space to avoid obscuring price candles.
• On instruments without reliable volume data (e.g. some forex pairs), Fast Mode produces acceptable results as the distribution difference is minimal.


Haftungsausschluss

Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.