Hello,
I have several timeframes open of the same asset. At near the end of a timeframe I would like ot make the windows blinking or something like that so that I see we are approaching the end of a main timeframe.
The end of a time frame could be assumed for example when 5% of the time remains (so e.g. at 4min45sec for the 5 min timeframe, 14min15sec for the 15 min timeframe etc…)
How would proceed ? Any existing solution which makes already blinking a window ?
Thank you
The below code will make the price chart blink (every time the price is updated) with a red background color.
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
Perfect… Thank you very much.