About Previous Day and Weekly High Low
Unlike previous high and low tools that only draw the lines, Previous Day and Weekly High Low also tracks each level after price reaches it: swept, broken, retested or failed.
How it works
- PDH and PDL are the previous day's high and low, PWH and PWL the previous week's, PMH and PML the previous month's (off by default). They come from the chart's daily, weekly and monthly candles (on forex the day ends at 17:00 New York), so past bars show the levels as they were at that time.
- Day starts at: choose midnight in New York, London, UTC or Tokyo instead, with daylight saving time. On forex the short Sunday or Saturday piece is joined to Monday or Friday.
- States are set when a bar closes. Untouched: price has not reached the level. Swept: the wick went past the level and the bar closed back inside. Broken: a close beyond the level. Failed break: after a break, a close back inside. Retest: after a break, price moves fully away, comes back to the level and closes on the broken side. Turn off Show swept state to count only closes.
- Distance past the level: the farthest point beyond the level in the period.
- A week belongs to the month of its Friday. W1 is the week with the first Friday of the month.
On the chart
- The current lines start at the bar where their high or low was made. Solid: untouched. Dashed: swept or failed break. Dotted and lighter: broken.
- Labels show the name and the state only. High labels sit above the line and low labels below it. Levels at the same or a close price share one label, for example "PDH / PWH". Prices are on the price scale.
- Only levels near the visible range are drawn, so a far level never squeezes the candles. The nearest one above and below is shown at the edge with its distance.
- A dotted line marks how far price went past a level, with the distance.
- Optional: 50% lines (PD 50%, PW 50%, PM 50%), open lines (Day open, Week open, Month open), today's and this week's high and low so far, past days and weeks (older lines thinner and lighter), day separators, and a summary table with each level's day, week or month, for example "PDL (Mon) 159.348 Swept · wick 1.3 pips below".
- Colors, line widths and text size can be changed, and every part can be turned off.
Alerts
Use the "Any alert() function call" condition and choose the levels (all, one period, highs only, lows only or a single level) and the events: near, reached, swept, broken, retest and failed break, plus the 50% and open lines crossed. Reached is sent the moment price touches a level; the others when a bar closes. Each event is sent once per level per period. The message can be text or JSON for webhooks. Each event is also in the Condition list as its own alert.
Notes
- Previous day levels show below the daily timeframe, previous week below the weekly and previous month below the monthly.
- Distances are in pips on forex and metals and in percent on other markets (Distance unit).
- With a Midnight setting, a level shows "Not enough bars" when the chart does not reach back to the start of its period.
How to add it
- 1Open the script page on TradingView with the button above (or here).
- 2Click “Add to favorites” on that page.
- 3On any chart, open Indicators, go to Favorites and click Previous Day and Weekly High Low [Saikix].
First steps on the chart
- Start with the labels at the right end: each shows the level and what price did there, for example "PDL · Swept", and a dotted line shows how far price went past it, for example "1.3 pips".
- Day starts at is the setting to check first. Daily candle follows the chart's daily candles (on forex the day ends at 17:00 New York); the Midnight options start the day at 00:00 in New York, London, UTC or Tokyo.
- In a TradingView alert, use the "Any alert() function call" condition and choose the levels and the events: near, reached, swept, broken, retest and failed break. Reached is sent the moment price touches a level; the others when a bar closes.
- Only levels near the visible range are drawn. The nearest one above and below is shown at the edge with its distance, for example "PDH 33.6 pips above", so the candles keep their full height on low timeframes.