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

Hi ,

I see there is minute() function , but not sure how to use it .
I wanna plot an line time based i.e from 9:00 to 9:30 AM , how to do it .

Pseduo code

If time is between 9 and 10 am
Plot(myline ,"myline",colorGreen,styleLine);

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

This works cool , thanks appreciate!.
timenum function is cool ..