OPEN-SOURCE SCRIPT
Telah dikemas kini

Prev D/W/M + Asia & London Levels [Oeditrades]

237
Prev D/W/M + Asia & London Levels [Oeditrades]
Author: Oeditrades
Platform: Pine Script® v6

What it does
Plots only the most recent, fully completed:

Previous Day / Week / Month highs & lows

Asia and London session highs & lows

Levels are drawn as true horizontal lines from the period/session start and extended to the right for easy confluence reading. The script is non-repainting.

How it works
Prev Day/Week/Month: Uses completed HTF candles (high[1] / low[1]) so values are fixed for the entire next period.

Sessions (NY time): Asia (default 20:00–03:00) and London (default 03:00–08:00) are tracked in America/New_York time. High/low are locked when the session ends, and the line is anchored at that session’s start.

Inputs & customization
Visibility: toggle Previous Day/Week/Month, Asia, London, and labels.

Colors: highs default red; lows default green (user-configurable). Session highs default pink, lows aqua (also editable).

Style: line style (solid/dotted/dashed) and width.

Sessions: editable time windows for Asia and London (still interpreted in New York time).

Disclaimer: optional on-chart disclaimer panel with editable text.

Notes
Works on any timeframe. For intraday charts, the HTF values remain constant until the next HTF bar completes.

If your market’s overnight hours differ, simply adjust the session windows in Inputs.

Lines intentionally show only the latest completed period/session to keep charts clean.

Use cases
Quick view of PDH/PDL, PWH/PWL, PMH/PML for bias and liquidity.

Intraday planning around Asia/London range breaks, retests, and overlaps with prior levels.

Disclaimer
This tool is for educational purposes only and is not financial advice. Markets involve risk; past performance does not guarantee future results.









Nota Keluaran
Prev D/W/M + Asia & London Levels v2 [Oeditrades]

This indicator plots key market structure levels directly on your main chart: the previous Day/Week/Month highs and lows, plus the most recent Asia and London session ranges. It’s designed to be clean, fast, and non‑repainting so you can quickly see where price is interacting with widely watched levels.

The previous period levels (PDH/PDL, PWH/PWL, PMH/PML) are calculated using higher‑timeframe data with lookahead disabled, so they don’t repaint once a period closes. Session ranges track the most recent completed Asia and London sessions on intraday charts, marking each session’s high and low from its actual start to end, then extending forward as reference levels.

You can customize colors for previous period highs/lows separately from session highs/lows, choose line styles and widths, and toggle each level type and labels on or off independently. Session times default to New York time and are fully editable, letting you match your own definition of Asia and London sessions. A compact on‑chart disclaimer can be shown or hidden.

How it works under the hood: the script uses timeframe.change() to detect new periods reliably, clamps drawing coordinates within the visible history buffer to prevent runtime errors, and updates existing lines instead of constantly recreating them to keep the chart responsive. The result is a stable, low‑overhead overlay that won’t get in the way of price action.

Quick start: add the indicator to your chart, keep it on the main price pane (overlay), choose your session times in New York time if you want something different from the defaults, and optionally switch labels or specific level groups on or off. The session levels only appear on intraday timeframes; previous period levels work on any timeframe.

Notes and limitations: the indicator does not generate alerts. Session detection relies on the chart being intraday and the New York timezone setting in the inputs. All levels are for educational reference only and are not trade signals.
Nota Keluaran
Fixed Runtime Errors and Vertical lines
Nota Keluaran
Fixed Runtime Error

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.