# Prior period levels

`prior_levels`

The previous day, week or month open, high, low and close (PDH, PDL), carried forward.

## Inputs

| Name | Type | Default | Range |
| --- | --- | --- | --- |
| period | choice | D |  |
| day_boundary | text | 17:00 America/New_York |  |

## Outputs

| Name | Kind |
| --- | --- |
| prev_open | value |
| prev_high | value |
| prev_low | value |
| prev_close | value |

Warm-up: 0 bars (0 at the defaults).

Repaints: No.

## Formula

A trading day starts at day_boundary. With period D each trading day is one period; with W a week starts on the first trading day of its ISO week (Monday); with M a month starts on its first trading day.

prev_open, prev_high, prev_low and prev_close are the first open, the highest high, the lowest low and the last close of the previous period.

A value appears on the first bar of a period and stays for the whole period, so it is known before that bar closes. A period already under way at the first bar of the data is not used. A period holding a missing bar has no levels.
