Move the call to Display_Vlines() from the OnChartEvent() to OnCalculate()
Or click on the chart whenever you want to refresh it :) As simple click on the chart will do the way your code is written. But you have more issues with that code (starting from the fact that your Current_Time is fixed to the time when indicator is attached or reloaded)
Hello mladen,Already tried, but didn't work.When a new bar comes (tested on M1), the Vlines stay in place et do not refresh and replace on their new bar.I have to change the time frame...Any idea why ?
And what can adjust the time please ?
datetime time2 = Time+(Datas_BarShift_Time-1)*PeriodSeconds();
datetime time3 = Time+(Datas_BarShift_Time2-1)*PeriodSeconds();
datetime Current_Time = TimeCurrent();
Hello,I have tried again and it's ok now...maybe it was to late for me yesterday.thank you.