defparam drawonlastbaronly=true
PeriodPercent = 30 //5% of the time remains to start blinking the chart
// ------
once NbBar = 1
MyDay=openday
dayminutes = 1440*(MyDay-MyDay[1])
MyHour=openhour
hourminutes = 60*(MyHour-MyHour[1])
MyMin=openminute
barminutes = MyMin - MyMin[1] + hourminutes + dayminutes
barminutes=abs(barminutes)
imin = lowest[NbBar](barminutes)[1]
isec = imin*60
itime=opentime
iremain = (time-itime)
if islastbarupdate then
if iremain>=isec*(1-(periodpercent/100)) then //blink
if $alpha[0]=0 then
$alpha[0]=50
else
$alpha[0]=0
endif
//backgroundcolor(255,0,0,$alpha[0])
drawrectangle(0,0,barindex,100000) coloured(255,0,0,$alpha[0]) bordercolor(255,0,0,$alpha[0])
endif
endif
return