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!
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.