Hiding inactive period in sparsed chart


Is it possible to hide blank periods in chart created using SparseExpand/SparseCompress functions?

I would like to see „continuous“ charts (with some gaps between different sessions of course).

My code:

tn = TimeNum();

CS = tn >= 093000 AND tn < 142900;

x = SparseCompress( CS, Close); 
y = SparseExpand( CS, Close); 

O = SparseExpand(CS, SparseCompress(CS, Open ) ); // sparse data 
H = SparseExpand(CS, SparseCompress(CS, High ) ); // sparse data 
L = SparseExpand(CS, SparseCompress(CS, Low ) ); // sparse data 
C = SparseExpand(CS, SparseCompress(CS, Close ) ); // sparse data 

Plot( C, "Price", colorDefault, styleCandle); 

is so far producing correct "sessions" but with a lots of empty spaces that I would like to hide:


If you want to hide it why not using database settings - intraday settings - day and night session?

And on tool bar you can choose different day sessions.

1 Like

Of course, you are correct. I forgot about the database settings.
Thank you for reminder.