How to plot line only for first 30 mins i.e 9:00 to 9:30 AM

When you insert code then please use code tags.
Read here and here before posting.


tn = TimeNum();
timeWindow = tn >= 090000 AND tn < 093000;
timeWindow_start = timeWindow != Ref(timeWindow,-1);

myLine = ValueWhen(timeWindow_start, Open );// or whatever is your line
myLine = IIf( timeWindow, myLine, Null );// plot line only if timeWindow is true

Plot( C, "Price", colorDefault, styleBar );
Plot(myline ,"myline",colorGreen,styleLine);

25

3 Likes