Building an Interactive Anchored Multi-Timeframe Volume Profile in MQL5
Summary
The article explains how to build an anchored volume profile indicator in MQL5 that displays current-timeframe activity on the main chart and a selected higher-timeframe profile in a separate window. A draggable anchor sets the start of the analysis range, while the visible chart endpoint sets its end. Both profiles use the same time range and bin count, enabling comparison of volume distribution across timeframes.
The implementation covers interactive bin-count editing, higher-timeframe validation, anchor normalization and restoration, volume accumulation, and event-driven redraws when the chart view or anchor changes. Each candle’s volume is assigned according to its close price; profile lengths represent relative activity, with the Point of Control highlighted. The article describes an indicator-building method rather than evidence that volume-profile signals improve trading results. Its accumulation rule and reliance on the visible range are design choices that may affect interpretation, and no performance evaluation is provided.
Key ideas
- A draggable anchor and the visible chart endpoint define the period profiled.
- The current and higher-timeframe profiles share the same analysis range and bin structure.
- Users can edit the bin count through keyboard input when the anchor is selected.
- Volume is assigned to a price bin based on each candle’s close price.
- Chart and anchor events trigger recalculation and redraw of the profiles.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.