# Previous Highs & Lows

Previous Highs & Lows is an indicator on [Vela](https://vela.luxalgo.com/chart), our next-generation charting platform, written in Pine Script®.

Previous Highs & Lows plots the developing high and low of the current period (level 0, dashed) and the high and low of each completed period (hourly through yearly) as numbered levels on the chart, with optional zones built from the percentile ranks of those extremes. Position filtering keeps only the levels that still matter relative to price, giving traders an instant map of the references markets test most often.

- Indicator in the LuxAlgo Library, by LuxAlgo, published Jul 22, 2024.
- Access: free.
- Concepts: [Prior Period Levels](https://www.luxalgo.com/library/concept/prior-period-levels/) (primary)
- Open on Vela: https://vela.luxalgo.com/chart?pineScriptCodeId=cmpwn4rks006nvhsgarfwzpb7
- Page: https://www.luxalgo.com/library/indicator/previous-highs-lows/

**Previous Highs & Lows** keeps the market's reference points on screen: the developing high and low of the current interval (level 0, dashed) and the high and low of each completed interval, plotted as numbered [prior-period highs and lows](https://www.luxalgo.com/library/concept/prior-period-levels/) that remain visible as new periods form, one of the most direct tools in the [levels family](https://www.luxalgo.com/library/family/levels/). Alongside the individual levels, two shaded areas built from the percentile ranks of those highs and lows outline broader zones where reactions tend to cluster.

## How to Trade the Previous Highs & Lows?

- **Level tests**: previous highs and lows are pivotal decision points. Watch for reactions there, and treat clean breaks as information about who controls the market.
- **Numbering and gradient**: recent levels carry lower numbers and brighter colors, so the freshest references stand out from stale ones.
- **Position filtering**: enable it and only highs above the current close and lows below it remain, precisely the levels price can run into next.
- **Upper and lower areas**: the percentile-based zones give a wider engagement region than any single level; a wider area reflects a more dispersed collection of past extremes.

Interval choice matters. Daily is the common habit, but hourly through yearly are available. Just note that high intervals viewed on low timeframes can place levels far from current price.

## Previous Highs & Lows Settings

- **Show Last**: how many previous high and low levels to display alongside the current period's level 0; the areas are toggled separately with **Show Areas** in the Style settings.
- **Frequency**: the period defining each high and low (Hour, Day, Week, Month or Year; Day by default).
- **Areas Width**: widens or narrows the percentile-based top and bottom areas.
- **Filter Based On Position**: shows only highs above and lows below the current closing price.
- **Minimum Gradient Transparency**: fades the oldest levels so recent ones dominate visually.

## Frequently Asked Questions

### Which interval should I run?

Match it to your holding period: intraday traders usually watch daily levels, swing traders weekly or monthly. Higher intervals on low-timeframe charts produce levels that may sit far away and stay out of play for a while.

### Can I trade breakouts of these levels, not just reactions?

Yes, and it's a natural pairing: the [Breakout Detector](https://www.luxalgo.com/library/indicator/breakout-detector-previous-mtf-high-low-levels/) applies signal logic to previous multi-timeframe highs and lows, making the two a coherent level-plus-trigger stack.

### How do I get Previous Highs & Lows?

Free, on the LuxAlgo Library. Apply it from this page, or open it in Quant, our coding agent, to test how price behaves around each interval's levels. You can also copy the source code from this page and run it anywhere Pine Script® runs.

## Related indicators

- [HTF Candle Projections](https://www.luxalgo.com/library/indicator/htf-candle-projections/) (Prior Period Levels): markdown at https://www.luxalgo.com/library/indicator/htf-candle-projections.md
- [Breakout Detector (Previous MTF High Low Levels)](https://www.luxalgo.com/library/indicator/breakout-detector-previous-mtf-high-low-levels/) (Prior Period Levels): markdown at https://www.luxalgo.com/library/indicator/breakout-detector-previous-mtf-high-low-levels.md
- [Average Daily Range](https://www.luxalgo.com/library/indicator/average-daily-range/) (Period Opens): markdown at https://www.luxalgo.com/library/indicator/average-daily-range.md
- [VWAP Periodic Close](https://www.luxalgo.com/library/indicator/vwap-periodic-close/) (Anchored VWAP As Level): markdown at https://www.luxalgo.com/library/indicator/vwap-periodic-close.md
- [Naked POC](https://www.luxalgo.com/library/indicator/naked-poc/) (Naked POC As Level): markdown at https://www.luxalgo.com/library/indicator/naked-poc.md
- [Overnight & ETH Levels](https://www.luxalgo.com/library/indicator/overnight-and-eth-levels/) (Support/Resistance & Levels): markdown at https://www.luxalgo.com/library/indicator/overnight-and-eth-levels.md
- [All Time High (ATH) Levels](https://www.luxalgo.com/library/indicator/all-time-high-ath-levels/) (All-time & 52-week Extremes): markdown at https://www.luxalgo.com/library/indicator/all-time-high-ath-levels.md
- [Monday Range](https://www.luxalgo.com/library/indicator/monday-range/) (Support/Resistance & Levels): markdown at https://www.luxalgo.com/library/indicator/monday-range.md

---

Source: https://www.luxalgo.com/library/indicator/previous-highs-lows/ (LuxAlgo Library). Free to use with attribution: https://www.luxalgo.com/library/license/
