OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Live update last N bars in TradingView candlestick chart

  • Thread starter Thread starter wmbtrmb
  • Start date Start date
W

wmbtrmb

Guest
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?

<p>I'm using <strong>TradingView</strong> (v22.032) library to render OHLC chart. I was using <a href="https://www.tradingview.com/chartin...rting_Library.IDatafeedChartApi#subscribebars" rel="nofollow noreferrer">subsribeBars</a> to constantly update the value of last bar, but now I have a source of candlestick data, which may update last 2 candles. Unfortunately <a href="https://www.tradingview.com/charting-library-docs/latest/api/modules/Datafeed#subscribebarscallback" rel="nofollow noreferrer">SubscribeBarsCallback</a> doesn't allow to rewrite historical data. So I'm in search of how to live update last 2 bars in TradingView chart.</p>
<p>I saw some examples, but they use Lightweight chart, which doesn't fit me. Copilot/GPTs are suggesting to resetData, but...</p>
<ol>
<li>I don't understand how to properly do that.</li>
<li><code>.resetData()</code> makes chart re-render fully, which produces chart blinks, and I think that's suboptimal</li>
</ol>
<p>Has any clue how to handle this?</p>
 

Latest posts

M
Replies
0
Views
1
Meliodas Dragon
M
Top