OPEN-SOURCE SCRIPT

Key Level Matrix | AlphaScript

482
Key Level Matrix brings the high-timeframe and session levels traders watch most onto a single chart, then groups any that share the same price into one clean line through its confluence merge engine.
You get a complete map of where significant prices sit across every timeframe and session at once — without the chart turning into a stack of overlapping lines.

🧠 Concept
Markets repeatedly react to a specific set of reference prices: the opens, highs, lows, and midpoints of higher timeframes and sessions, where prior auctions concluded and resting orders concentrate.
What makes a given price matter is how many independent references land on it.
A level that is simultaneously the daily high, the weekly open, and the Asia session mid carries far more weight than any one of them alone — and finding those overlaps by eye, across a dozen sources, is exactly what this tool removes the work from.

🔍 What it does
Plots reference levels across the market's natural cycles, each labeled and color-coded by source and extended to the right of price:

Timeframes — 4H, Daily, Weekly, Monthly, Quarterly, Yearly: open, high, low, mid, and the prior period's high, low, and mid
Sessions — Asia, London, New York (windows configurable, in New York time): high, low, mid, and the prior session's levels
Monday Range — high, low, and mid of the week's opening day

⚙️ How it works
Every enabled level is sorted by price, and any group falling within your Merge Threshold — set in ticks, so it scales to each instrument — collapses into a single line carrying one combined label that names each contributing source, for example "Daily High / Weekly Open / Asia Mid." One line, with an instant read on how much agreement sits behind it.
All values are retrieved with non-repainting historical requests. Levels from closed periods and sessions are final; the active period and session develop in real time and lock once they close.

📈 How to use it
Treat merged, multi-source levels as your highest-conviction zones — primary areas for entries, targets, and invalidation — and single-source levels as secondary structure between them.
Enable only what matches your timeframe: an intraday trader might run New York, London, and Daily; a swing trader Weekly, Monthly, and Quarterly.
Widen the Merge Threshold on volatile, large-tick symbols; tighten it on indices and FX where prices sit closer together.

Every level, session, color, and style is independently configurable. It's a reference and confluence framework meant to complement your analysis, not a buy/sell signal generator, and it works on any market and timeframe.

📝 Notes
A decision-support tool, not a strategy. Levels are drawn from confirmed data and don't repaint. They mark where price has reacted before — not where it will. Always apply your own risk management.

Wyłączenie odpowiedzialności

Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.