Prior period levels
All indicators

LibraryTime

Indicator

Prior period levels

The open, high, low and close of the last finished day, week or month, and the open, high and low of the running one so far.

TimeOn the price2 inputsPrior

How it is calculated

Periods turn as for pivot points: days start at 17:00 New York (daylight saving included) or, as Day starts chooses, at 00:00 UTC; weeks with Monday's day, months with the 1st. At the first bar of a new period the running period's open, high, low and last close become the previous ones; the running open, high and low then start from that bar. The previous values are empty until the first period in the data has ended.

Reference: Prior day, week and month high, low, open and close, on the trading day pivot points use

How to read it

Yesterday's high and low are levels many traders watch: a break above the previous high or a rejection from it. With the default 17:00 New York day a forex Sunday evening already belongs to Monday, so Monday's previous day is Friday. A gap of several periods makes the last period with bars the previous one.

In a strategy

A breakout of yesterday's range: with p = ctx.ind("prior_levels", period="day") go long when the close crosses above p.prev_high and short when it crosses below p.prev_low, the stop at the other side.

Inputs

InputTypeDefaultRange or choices
PeriodperiodChoice"day"Day, Week, Month
Day startssessionChoice"ny"17:00 New York, 00:00 UTC

What it draws

LineDrawn as
Previous highSteps
Previous lowSteps
Previous closeSteps
Previous openSteps
High so farSteps
Low so farSteps
OpenSteps

Used in

No strategy template reads it yet.

OrionQuant