I have an indicator to plot the Highest and Lowest for a period of bars intraday (minute bars) but needs to calculate only during market hours (9:30 to 4:00) even though I am including Pre-Market data in the chart. Inotherwords the highest and the Lowest for the Input Lookback shall fall within the regular market hours. The code I have shows for all time including Premarket hrs. See image below. Any suggestions to modify the code below are welcome. Thanks in advance.
The code below calculates premarket data as well which I don't want included in the plot calculation.
Code: Select all
Input: Lookback (20);
Vars: UpperC(0),
LowerC(0);
If
Time > 0930 AND Time < 1600
then begin
UpperC = HighestFC (High, Lookback )[1];
LowerC = LowestFC (Low, Lookback )[1];
Plot1 (UpperC, "Upper");
Plot2 (LowerC, "Lower");
End;