wmbtrmb
wmbtrmb

Reputation: 307

Live update last N bars in TradingView candlestick chart

I'm using TradingView (v22.032) library to render OHLC chart. I was using subsribeBars to constantly update the value of last bar, but now I have a source of candlestick data, which may update last 2 candles. Unfortunately SubscribeBarsCallback doesn't allow to rewrite historical data. So I'm in search of how to live update last 2 bars in TradingView chart.

I saw some examples, but they use Lightweight chart, which doesn't fit me. Copilot/GPTs are suggesting to resetData, but...

  1. I don't understand how to properly do that.
  2. .resetData() makes chart re-render fully, which produces chart blinks, and I think that's suboptimal

Has any clue how to handle this?

Upvotes: 0

Views: 128

Answers (0)

Related Questions