Skip to content
All library documents

Customizing a Volume Indicator with an Average and Value Table

Article TradingView scripts

Summary

This example adapts a built-in volume indicator to make current volume and its simple moving average easier to read. It retains volume columns and adds a configurable average overlay, while an on-chart table displays the latest values. The table uses color to show whether the average is rising and whether current volume is above the average. Column colors can reflect either the bar’s open-to-close direction or the change from the previous close.

The accompanying explanation demonstrates practical customization choices: organizing inputs, using named color constants, setting display options, and building a table with adjustable position, size, and spacing. It also notes that missing volume data is handled as zero for the average calculation. This is a visualization and coding example, not a trading signal or tested strategy; it presents no evidence that the displayed volume conditions predict returns.

Key ideas

  • The indicator displays volume columns alongside a configurable simple moving average of volume.
  • A table reports the latest volume and average, with colors encoding the average’s direction and volume’s relation to it.
  • Column colors can be based on candle direction or the current close relative to the previous close.
  • Inputs and named color constants make visual settings easier to organize and change.
  • The example explains indicator presentation but does not test a trading edge.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.