Opening Range Dashboard

Opening Range Dashboard is an indicator drawn over the price chart.

tables and dashboardsstate

opening-range-dashboard.abx
1indicator "Opening Range Dashboard"
2pane: price
3
4input range_start = 09:30
5input range_end = 10:00
6
7state or_high: price = na
8state or_low: price = na
9
10in_range = time_of_day between range_start and range_end
11
12if time_of_day == range_start:
13or_high = high
14or_low = low
15elif in_range:
16or_high = max(or_high, high)
17or_low = min(or_low, low)
18
19background blue.fade(92), when: in_range
20hline or_high, style: dashed, color: green
21hline or_low, style: dashed, color: red
22dashboard position: top_right, rows: [["Range high", "{or_high:0.00}"], ["Range low", "{or_low:0.00}"], ["Width", "{or_high - or_low:0.00}"]]
What this script says

Opening Range Dashboard is an indicator drawn over the price chart.

You can change 2 inputs: range_start (default 09:30) and range_end (default 10:00).

It remembers or_high and or_low from one bar to the next.

It calculates in_range as whether the time of day is between range_start and range_end.

On each bar, it checks whether the time of day is range_start and, if so, sets or_high to the high and sets or_low to the low; otherwise, if in_range, sets or_high to the max (a or_high, b the high); it also sets or_low to the min (a or_low, b the low).

On the chart, it shades the background when in_range, draws a horizontal line at or_high, draws a horizontal line at or_low and shows a dashboard.

Try this in the Terminal. AlgoBars is free: $0 a month, no card needed.

Create my free account