Refresh bar just before new bar start

wmclennan77 since: 29 Jun 2021;

  19 Jan 2023, 16:41
Refresh bar just before new bar start


I am looking for a solution to a problem I am having with an indicator, it needs to reload the chart basically 2 or 3 seconds before the new bar forms.

Is this in any way possible?


firemyst since: 26 Mar 2019;

  25 Jan 2023, 06:21

Probably not, because there's no way to know when a new bar is going to start. A new bar forms on the first tick after the previous bar closes. It could take half a second, or 10 seconds (depending on the time of day and symbol) on when that next tick will come in to cause a new bar to open up.