Building a Price-Binned Volume Profile from Historical Bars
Summary
This indicator constructs a volume profile by rounding or stepping each bar's selected source price, then adding that bar's volume to the corresponding price bucket. An option weights volume by the price source, approximating volume in currency terms. The history window is configurable, and the resulting profile is drawn beside the latest bar as a scaled polyline, with the three largest-volume price buckets highlighted.
The script also allows display choices such as profile width, offset, color, and curved or closed lines. It describes a visualization method rather than an entry or exit strategy, and provides no evidence that the largest-volume levels predict future price behavior. The profile's shape depends on the chosen price source, bucketing precision, available bars, and the chart's volume data; it should not be treated as a direct measure of volume traded at every price within each bar.
Key ideas
- Each bar contributes its volume to a bucket selected by a rounded or stepped price source.
- An optional price weighting turns the bucket total into a currency-weighted volume estimate.
- The profile is normalized to a maximum display width and plotted beside the current bar.
- The three buckets with the greatest accumulated volume are marked separately.
- The visualization does not test whether profile levels have predictive value.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.