OPEN-SOURCE SCRIPT
$$$ EMAS & WEEKLY PIVOTS $$$

EMAS & WEEKLY PIVOTS by PINE DIGGA
A lightweight, no-clutter overlay that pairs three fully customizable EMAs with a clean set of classic weekly pivots. Built as a companion to the GOLD DIGGA suite, it gives you trend context and weekly support/resistance in one indicator — without repainting and without crowding your chart.
What it does
Three EMAs (default 50 / 100 / 200)
Each EMA is independent: its own length, colour, line style (solid / dashed / dotted) and on-off toggle. Use them as a fast/mid/slow stack for trend bias, dynamic support and resistance, or pullback reference. A shared source input and line-width control keep things tidy.
Weekly pivots (PP, R1–R3, S1–S3)
Standard floor-trader pivots calculated from the last completed week's High, Low and Close. Levels are drawn as extending lines into the future with optional price labels, so you always know where the week's key reaction zones sit.
The pivot math is the classic formula set:
PP = (High + Low + Close) / 3
R1 = 2·PP − Low • S1 = 2·PP − High
R2 = PP + (High − Low) • S2 = PP − (High − Low)
R3 = High + 2·(PP − Low) • S3 = Low − 2·(High − PP)
Why it doesn't repaint
The weekly values are pulled with request.security using a one-bar shift and lookahead_off, so the current (still-forming) week never leaks into the calculation. The levels you see are based only on data that has already closed — what prints in real time is what you'd have seen historically.
Notes
This is a charting and analysis tool, not financial advice or a signal service. Always combine it with your own analysis and risk management. Open-source under the Mozilla Public License 2.0 — feel free to study the code.
A lightweight, no-clutter overlay that pairs three fully customizable EMAs with a clean set of classic weekly pivots. Built as a companion to the GOLD DIGGA suite, it gives you trend context and weekly support/resistance in one indicator — without repainting and without crowding your chart.
What it does
Three EMAs (default 50 / 100 / 200)
Each EMA is independent: its own length, colour, line style (solid / dashed / dotted) and on-off toggle. Use them as a fast/mid/slow stack for trend bias, dynamic support and resistance, or pullback reference. A shared source input and line-width control keep things tidy.
Weekly pivots (PP, R1–R3, S1–S3)
Standard floor-trader pivots calculated from the last completed week's High, Low and Close. Levels are drawn as extending lines into the future with optional price labels, so you always know where the week's key reaction zones sit.
The pivot math is the classic formula set:
PP = (High + Low + Close) / 3
R1 = 2·PP − Low • S1 = 2·PP − High
R2 = PP + (High − Low) • S2 = PP − (High − Low)
R3 = High + 2·(PP − Low) • S3 = Low − 2·(High − PP)
Why it doesn't repaint
The weekly values are pulled with request.security using a one-bar shift and lookahead_off, so the current (still-forming) week never leaks into the calculation. The levels you see are based only on data that has already closed — what prints in real time is what you'd have seen historically.
Notes
This is a charting and analysis tool, not financial advice or a signal service. Always combine it with your own analysis and risk management. Open-source under the Mozilla Public License 2.0 — feel free to study the code.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.