I'm developing an indicator that shows custom time zone sessions by changing chart background.
For that I use this function to check if one bar is inside one of my defined time sessions:
InSession(sess) => na(time(period, sess)) == false
Where sess
it's something similar to "0130-0800"
.
But it's not drawing anything during the weekend. It seems that the time()
function only checks its input on workdays. But I use this indicator in cryptocurrencies that are open every day.
Is there any way to extend the time()
check to the weekends? If not, can you think of another method to check if a bar is within a timeframe?
PS: This is the full indicator code: https://es.tradingview.com/script/NMjZ2616/