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');
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.