Chartbreaker
    Preparing search index...

    VolumeProfile Generator

    The VolumeProfile generator visualizes the distribution of trading volume across price levels using heat maps. It aggregates OHLC data at multiple intervals to create a detailed volume-at-price profile, helping traders identify areas of high and low liquidity.

    Use a Controller object to add the generator to a chart:

    const volumeProfile = controller.addGenerator('VolumeProfile');
    
    • Volume Profile: A histogram showing how much volume was traded at each price level over a period.
    • Point of Control (POC): The price level with the highest traded volume.
    • Value Area: The price range that contains a specified percentage of total volume (typically 68-70%).

    The generator provides extensive configuration organized into groups.

    • Type: enum

    • Default: 'fullscreen'

    • Values: 'fullscreen' | 'fixedInterval' | 'freePlacement'

    • Details

      • 'fullscreen': A single heat map covers the entire visible chart area.
      • 'fixedInterval': Heat maps are created at regular intervals (yearly, monthly, weekly, daily, etc.).
      • 'freePlacement': Heat maps can be placed manually at custom positions.
    • Type: enum

    • Default: 'monthly'

    • Values: 'yearly' | 'monthly' | 'weekly' | 'daily' | 'fourhourly' | 'hourly' | 'halfhourly' | 'fifteenminutely' | 'fiveminutely' | 'minutely'

    • Details

      Determines the time period each heat map covers in fixedInterval mode. Available values are filtered dynamically - only intervals larger than the chart's current candle interval are offered.

    • Type: boolean

    • Default: false

    • Details

      When enabled in fixedInterval mode, all available heat maps are displayed. When disabled, only the number specified by numMaps is shown.

    • Type: integer

    • Range: >0

    • Details

      The number of heat maps to display in fixedInterval mode. Only used when displayMaxMaps is disabled.

    • Type: button

    • Details

      Buttons to add or remove heat maps in freePlacement mode.

    • Type: enum

    • Default: 'count'

    • Values: 'count' | 'priceSpan' | 'percentage'

    • Details

      Controls how the height of each volume bar is determined:

      • 'count': A fixed number of bars across the price range.
      • 'priceSpan': Each bar covers a fixed price range.
      • 'percentage': Each bar covers a percentage of the total price range.
    • Type: integer
    • Default: 150
    • Range: 10 - 1000
    • Details: Number of bars when using 'count' mode.
    • Type: float
    • Default: 10
    • Range: >0
    • Details: Price range per bar when using 'priceSpan' mode.
    • Type: float
    • Default: 5
    • Range: 0 - 50
    • Details: Percentage of total range per bar when using 'percentage' mode.
    • Type: enum
    • Default: 'right'
    • Values: 'left' | 'right'
    • Details: Controls whether the volume bars grow from the left or right side of the chart.
    • Type: enum

    • Default: 'show'

    • Values: 'show' | 'hide' | 'only'

    • Details

      Controls the display of the Point of Control (highest volume price level).

      • 'show': The POC line is drawn alongside the volume bars.
      • 'hide': The POC line is hidden.
      • 'only': Only the POC line is drawn, without volume bars.
    • Type: boolean
    • Details: When enabled, the value area is highlighted with a stronger opacity.
    • Type: integer
    • Default: 70
    • Range: 1 - 99
    • Details: The percentage of total volume that defines the value area (e.g., 70 means the value area contains 70% of the volume).
    • Type: boolean
    • Details: When enabled, a line is drawn at the volume-weighted average price on the heat map itself.
    • Type: integer

    • Default: 20

    • Range: 1 - 100

    • Details

      The width of the heat map as a percentage of the chart area. Used in fullscreen mode.

    • Type: integer

    • Default: 70

    • Range: 1 - 100

    • Details

      The width of the heat map as a percentage of the chart area. Used in fixedInterval and freePlacement modes.

    • Type: integer

    • Default: 80

    • Range: 1 - 100

    • Details

      The opacity of the volume bars, expressed as a percentage.

    • Type: boolean
    • Details: When enabled, outlier bars (detected using standard deviation analysis) are scaled down to avoid visual distortion.
    • Type: boolean
    • Details: When enabled, the most recently traded price level is labeled within the heat map.
    • Type: boolean
    • Details: When enabled, the heat map is rendered as an area with a semi-transparent color gradient instead of individual bars.
    • Type: boolean
    • Details: When enabled, volume bars are split into up (buying) and down (selling) volume with separate colors.
    • Type: color
    • Details: Color for up/buying volume (used in split mode).
    • Type: color
    • Details: Color for down/selling volume (used in split mode).
    • Type: color
    • Details: Color for the movable volume bars.
    • Type: color
    • Details: Color for the Point of Control line.

    In fixedInterval mode, the following intervals are available:

    • Yearly, Monthly, Weekly, Daily
    • 4-Hourly, Hourly, 30-Minute, 15-Minute, 5-Minute, 1-Minute

    The generator fetches OHLC data at multiple resolutions and aggregates them into volume-at-price histograms. It uses a layered buffer system where finer intervals provide more detail and coarser intervals fill gaps.

    The aggregation algorithm:

    1. Collects candle data for the selected time range.
    2. Divides the price range into bars based on the bar width configuration.
    3. Distributes each candle's volume across the bars it touches.
    4. Optionally detects and scales down outliers using a 4-sigma standard deviation threshold.
    5. Calculates the Point of Control (bar with highest volume).
    6. Calculates the value area by expanding outward from the POC until the target percentage is reached.

    Heat maps update dynamically as new data arrives (and as the chart is scrolled when using fullscreen mode).

    Permissions

    The generator has a built-in permission check, which is called in its onStart method. It calls the provided checkPermission method (via Controller) with the key VolumeProfile.