Fixed Volume Profile
- Indicatori
- Carlos Pascual Perez Maturano
- Versione: 1.0
- Attivazioni: 5
This indicator, titled "Fixed Volume Profile.mq5", is a custom tool for MetaTrader 5 (MQL5) designed to calculate and display a Volume Profile over a user-defined fixed time range. The Volume Profile shows the distribution of trading volume at different price levels during a specific period, helping to identify areas of high activity (such as Points of Control or POCs) and volume-based support/resistance areas.
Main Functionality:
Interactive Range: The indicator creates two vertical lines on the chart ("FP begin" for the start and "FP finish" for the end of the range). These lines can be manually dragged to adjust the analysis period. By default, the initial range covers the last 60 bars from the current time.
Profile Calculation: It divides the price range (from the minimum to the maximum in the selected period) into a number of "bins" or levels defined by the "precision" parameter (default, 100).
It accumulates the volume of each candlestick (bar) at the corresponding price levels, prorating the volume if a candlestick spans multiple levels (considering wicks, tails, and body).
It uses actual or tick volume according to the "applied volume" parameter.
It identifies the Point of Control (POC), which is the price level with the highest accumulated volume, and highlights it with a different color.
Display: It draws horizontal bars (using rectangular labels) on the right side of the chart, aligned with the end of the range.
The length of each bar is proportional to the volume at that level relative to the POC, adjusted by the "ratio" parameter (relationship to the chart width, default 0.25).
The bars adapt to the chart height and are automatically redrawn when moving the lines or changing the zoom level.
Customizable colors: general bars (default, clrLightSalmon), POC (clrBlueViolet), and range lines (clrGray). Input parameters:
tf0: Timeframe for calculation (default, the current chart timeframe).
precision: Number of levels in the profile (must be greater than 0).
av: Volume type (real or ticks).
ratio: Factor for bar size relative to chart width.
gc, pocc, svlc, evlc: Colors for bars, points of control (POC), and range lines.
Additional notes:
If the selected timeframe is higher than the current timeframe, use the current timeframe to avoid errors.
The indicator updates on events such as dragging objects or chart changes, but not on every tick to optimize performance.
Removing the indicator removes the vertical lines; otherwise, it simply redraws the chart.
It is useful for traders who analyze volumes within specific ranges, such as trading sessions or historical periods, to detect volume build-ups and potential reversal points.
