Chartbreaker
    Preparing search index...

    BarCounter Generator

    The BarCounter generator displays a real-time countdown timer showing the remaining time until the current candle closes. The timer is positioned next to the latest candle.

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

    const barCounterGenerator = controller.addGenerator('BarCounter');
    
    • Only available for intraday charts - daily or longer intervals are not supported.
    • Tick charts are not supported.
    • Requires a valid instrument with push data for real-time updates.
    • Type: color

    • Default: 'rgba(233,59,45,1)' (red)

    • Details

      Sets the color of the countdown text displayed on the chart.

    The generator subscribes to real-time push data for the current instrument and updates the countdown every 500ms. The timer displays the remaining time in HH:MM:SS format.

    When a new candle appears, the timer automatically repositions itself adjacent to it.

    The generator includes a legend entry showing the current countdown value.