You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Check out the new article: Building a Swing-Based Volume Profile Indicator in MQL5.
This article presents a swing-based volume profile indicator in MQL5 that analyzes platform tick volume within completed high-to-low and low-to-high legs. It confirms swing points, partitions each leg's range into ATR(200)‑adaptive price bins, distributes tick volume, and marks the Point of Control. The indicator draws a ZigZag and renders the profile on chart rectangles, helping you study volume concentration within each swing relative to price structure.
In this project, we will build a Swing-Based Volume Profile indicator for MetaTrader 5 that identifies confirmed market swings, draws a ZigZag structure between them, and displays tick volume distribution within each completed swing leg. The indicator will use a configurable swing length to determine potential swing highs and lows before confirming them.
A swing point will not be drawn immediately when an extreme is detected. For example, with a swing length of 5, if a bar forms the highest high within the selected five-bar window, it becomes a potential swing high. The indicator then waits for the next bar after the candidate extreme. If that bar fails to make a higher high, the previous bar is confirmed as the swing high. The same process applies to a swing low: when a bar forms the lowest low within the selected window and the next bar after the candidate extreme fails to make a lower low, that bar is confirmed as the swing low.
After confirmed swing points are available, the indicator tracks the direction of the market. A direction change completes either a high-to-low or low-to-high swing leg. The two confirmed swing points are then connected with a ZigZag line, while the price range between them is used to construct the volume profile.
For each completed leg, the indicator uses half of ATR(200) to determine the initial price-bin size and distributes the tick volume of the bars within the leg across those bins according to their closing prices. The bin with the highest accumulated tick volume becomes the Point of Control (POC), while the remaining bins are displayed as profile bars with widths proportional to their relative volume. This allows the volume distribution of each high-to-low and low-to-high movement to be analyzed alongside its ZigZag structure.
Author: ALGOYIN LTD