LinearRegressionVolume Profile
- Indicatori
- Arinze Michael Ejike
- Versione: 1.0
- Attivazioni: 5
The Linear Regression Volume Profile indicator combines linear regression analysis with volume distribution profiling to create a sophisticated market structure visualization tool. The foundation begins with linear regression calculation across a specified number of historical bars, computing both the slope (tilt) and y-intercept values that define the trend line's trajectory through price action. This regression line serves as the central axis around which volume distribution is analyzed, automatically adapting to the prevailing trend direction rather than remaining horizontally static. The indicator then calculates an ATR-based channel around this regression line, with the channel width determined by a user-defined ratio multiplied against a 200-period Average True Range value, ensuring the profile levels adapt proportionally to current market volatility. Volume distribution analysis occurs by dividing this channel into multiple horizontal levels (default 7 above and 7 below the regression line), where each level represents a specific price zone tilted along the regression angle. For each historical bar within the calculation period, the indicator examines which price levels were touched by that bar's high-low range and accumulates the corresponding volume into those levels. The resulting volume distribution is visualized through color-coded horizontal bars extending from each level, with colors interpolating between minimum volume (purple) and maximum volume (yellow) based on each level's percentage of total accumulated volume. A directional arrow appears at the oldest bar in the calculation period, pointing upward for positive regression slopes (downtrends in the indicator's reversed logic) and downward for negative slopes (uptrends), providing immediate visual confirmation of the calculated trend direction. The profile automatically recalculates on each new bar, maintaining a rolling analysis of the most recent price action and volume distribution within the regression channel. When FirstBarToUse is set above zero, a vertical white dotted line marks the starting point of the calculation period, clearly delineating which portion of the chart is being analyzed. The percentage labels displayed beside each profile level show what proportion of total volume was traded at that specific price zone, helping traders identify high-volume nodes that may act as support or resistance areas. This combination of regression-adjusted levels with volume profiling creates a tool that reveals where significant trading activity occurred relative to the prevailing trend structure, rather than analyzing volume against fixed horizontal price levels.
Parameters:
- FirstBarToUse: Offset from current bar to begin calculations (0 starts from the most recent bar)
- CalculationLength: Number of historical bars included in regression and volume analysis (default 101)
- NumberOfLevels: Quantity of profile levels above and below the regression line (default 7, creating 15 total levels)
- ProfileWidth: Visual thickness of the volume profile bars in pixels (default 7)
- ChannelSize: Multiplier applied to 200-period ATR for channel width calculation (default 0.8)
- ColorMaxVolume: Color assigned to levels with highest volume concentration (default yellow 0xFFEB3B)
- ColorMinVolume: Color assigned to levels with lowest volume concentration (default purple 0xC022DC)
- LineStyle: Visual style for the level lines (default dotted)
- ShowArrow: Toggle for displaying the directional trend arrow (default true)
- UpTrendColor: Color for upward trend arrow indication (default lime)
- DownTrendColor: Color for downward trend arrow indication (default red)
- FontSizeArrows: Size of the directional arrow symbol in points (default 20)
