OPEN-SOURCE SCRIPT
Percentage Distance from 200-Week SMA

200-Week SMA % Distance Oscillator (Clean & Simple)
This lightweight, no-nonsense indicator shows how far the current price is from the classic 200-week Simple Moving Average, expressed as a percentage.
Key features:
• True percentage distance: (Price − 200w SMA) / 200w SMA × 100
• Auto-scaling oscillator (no forced ±100% range → the line actually moves and looks alive)
• Clean zero line
• +10% overbought and −10% oversold levels with subtle background shading
• Real-time table showing the exact current percentage
• Small label on the last bar for instant reading
• Alert conditions when price moves >10% above or below the 200-week SMA
Why 200-week SMA?
Many legendary investors and hedge funds (Stan Druckenmiller, Paul Tudor Jones, etc.) use the 200-week SMA as their ultimate long-term trend anchor. Being +10% or more above it has historically signaled extreme optimism, while −10% or lower has marked deep pessimism and generational buying opportunities.
Perfect for Bitcoin, SPX, gold, individual stocks – works on any timeframe (looks especially good on daily and weekly charts).
Open-source • No repainting • Minimalist & fast
Enjoy and trade well!
This lightweight, no-nonsense indicator shows how far the current price is from the classic 200-week Simple Moving Average, expressed as a percentage.
Key features:
• True percentage distance: (Price − 200w SMA) / 200w SMA × 100
• Auto-scaling oscillator (no forced ±100% range → the line actually moves and looks alive)
• Clean zero line
• +10% overbought and −10% oversold levels with subtle background shading
• Real-time table showing the exact current percentage
• Small label on the last bar for instant reading
• Alert conditions when price moves >10% above or below the 200-week SMA
Why 200-week SMA?
Many legendary investors and hedge funds (Stan Druckenmiller, Paul Tudor Jones, etc.) use the 200-week SMA as their ultimate long-term trend anchor. Being +10% or more above it has historically signaled extreme optimism, while −10% or lower has marked deep pessimism and generational buying opportunities.
Perfect for Bitcoin, SPX, gold, individual stocks – works on any timeframe (looks especially good on daily and weekly charts).
Open-source • No repainting • Minimalist & fast
Enjoy and trade well!
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.