# Opening Range Dashboard

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

Source: https://algobarsx.com/docs/ex-27-opening-range-dashboard/

```algobarsx
indicator "Opening Range Dashboard"
    pane: price

input range_start = 09:30
input range_end = 10:00

state or_high: price = na
state or_low: price = na

in_range = time_of_day between range_start and range_end

if time_of_day == range_start:
    or_high = high
    or_low = low
elif in_range:
    or_high = max(or_high, high)
    or_low = min(or_low, low)

background blue.fade(92), when: in_range
hline or_high, style: dashed, color: green
hline or_low, style: dashed, color: red
dashboard 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.
