У меня есть индикатор для добавления номера бара на каждые 5 минут на каждые два бара, см. Ниже. Он работает хорошо, но кажется, что веб-страница «отстает», есть идеи, в чем может быть проблема? Я знаю, что это проблема производительности, но, будучи новичком в pinescript, я не уверен, где может быть причина ... Также есть ли лучший способ сделать то, чего я хочу достичь? см. рисунок ниже:
введите описание изображения здесь
Мой текущий код ниже: введите описание изображения здесь
study("Count Bars Day",overlay=true)
is_new_day() =>
d=dayofweek
na(d[1]) or d != d[1]
plotchar((barssince(is_new_day())+1)==2,char='',transp=75,text="2",textcolor=black,location=location.belowbar)
plotchar((barssince(is_new_day())+1)==4,char='',transp=75,text="4",textcolor=black,location=location.belowbar)
plotchar((barssince(is_new_day())+1)==6,char='',transp=75,text="6",textcolor=black,location=location.belowbar)
plotchar((barssince(is_new_day())+1)==8,char='',transp=75,text="8",textcolor=black,location=location.belowbar)
plotchar((barssince(is_new_day())+1)==10,char='',transp=75,text="10",textcolor=black,location=location.belowbar)
plotchar((barssince(is_new_day())+1)==12,char='',transp=50,text="12",textcolor=blue,location=location.belowbar)
plotchar((barssince(is_new_day())+1)==14,char='',transp=75,text="14",textcolor=black,location=location.belowbar)
plotchar((barssince(is_new_day())+1)==16,char='',transp=75,text="16",textcolor=black,location=location.belowbar)
plotchar((barssince(is_new_day())+1)==18,char='',transp=50,text="18",textcolor=red,location=location.belowbar)
plotchar((barssince(is_new_day())+1)==20,char='',transp=75,text="20",textcolor=black,location=location.belowbar)
plotchar((barssince(is_new_day())+1)==22,char='',transp=75,text="22",textcolor=black,location=location.belowbar)
plotchar((barssince(is_new_day())+1)==24,char='',transp=75,text="24",textcolor=black,location=location.belowbar)
plotchar((barssince(is_new_day())+1)==26,char='',transp=75,text="26",textcolor=black,location=location.belowbar)
plotchar((barssince(is_new_day())+1)==28,char='',transp=75,text="28",textcolor=black,location=location.belowbar)
plotchar((barssince(is_new_day())+1)==30,char='',transp=50,text="30",textcolor=blue,location=location.belowbar)
plotchar((barssince(is_new_day())+1)==32,char='',transp=75,text="32",textcolor=black,location=location.belowbar)
plotchar((barssince(is_new_day())+1)==34,char='',transp=75,text="34",textcolor=black,location=location.belowbar)
plotchar((barssince(is_new_day())+1)==36,char='',transp=75,text="36",textcolor=black,location=location.belowbar)
plotchar((barssince(is_new_day())+1)==38,char='',transp=75,text="38",textcolor=black,location=location.belowbar)
plotchar((barssince(is_new_day())+1)==40,char='',transp=75,text="40",textcolor=black,location=location.belowbar)
plotchar((barssince(is_new_day())+1)==42,char='',transp=75,text="42",textcolor=black,location=location.belowbar)
plotchar((barssince(is_new_day())+1)==44,char='',transp=75,text="44",textcolor=black,location=location.belowbar)
plotchar((barssince(is_new_day())+1)==46,char='',transp=75,text="46",textcolor=black,location=location.belowbar)
plotchar((barssince(is_new_day())+1)==48,char='',transp=50,text="48",textcolor=blue,location=location.belowbar)
plotchar((barssince(is_new_day())+1)==50,char='',transp=75,text="50",textcolor=black,location=location.belowbar)
plotchar((barssince(is_new_day())+1)==52,char='',transp=75,text="52",textcolor=black,location=location.belowbar)
plotchar((barssince(is_new_day())+1)==54,char='',transp=75,text="54",textcolor=black,location=location.belowbar)
plotchar((barssince(is_new_day())+1)==56,char='',transp=75,text="56",textcolor=black,location=location.belowbar)
plotchar((barssince(is_new_day())+1)==58,char='',transp=75,text="58",textcolor=black,location=location.belowbar)
plotchar((barssince(is_new_day())+1)==60,char='',transp=75,text="60",textcolor=black,location=location.belowbar)
plotchar((barssince(is_new_day())+1)==62,char='',transp=75,text="62",textcolor=black,location=location.belowbar)
plotchar((barssince(is_new_day())+1)==64,char='',transp=75,text="64",textcolor=black,location=location.belowbar)
plotchar((barssince(is_new_day())+1)==66,char='',transp=50,text="66",textcolor=blue,location=location.belowbar)
plotchar((barssince(is_new_day())+1)==68,char='',transp=75,text="68",textcolor=black,location=location.belowbar)
plotchar((barssince(is_new_day())+1)==70,char='',transp=75,text="70",textcolor=black,location=location.belowbar)
plotchar((barssince(is_new_day())+1)==72,char='',transp=75,text="72",textcolor=black,location=location.belowbar)
plotchar((barssince(is_new_day())+1)==74,char='',transp=75,text="74",textcolor=black,location=location.belowbar)
plotchar((barssince(is_new_day())+1)==76,char='',transp=75,text="76",textcolor=black,location=location.belowbar)
plotchar((barssince(is_new_day())+1)==78,char='',transp=75,text="78",textcolor=black,location=location.belowbar)