OPEN-SOURCE SCRIPT
Weekly MA60 (Show on Any Chart)

📘 Description: Weekly MA60 (Show on Any Chart)
This indicator displays the 60-period Moving Average (MA) calculated on the weekly timeframe, regardless of which chart timeframe you’re currently viewing (for example, it shows the weekly MA60 even on a daily chart).
It’s useful for traders who want to keep track of higher-timeframe trend direction while analyzing lower-timeframe price action.
⸻
🧩 How It Works
• The script uses the request.security() function to fetch data from the weekly timeframe.
• It then calculates either a Simple Moving Average (SMA) or an Exponential Moving Average (EMA) over 60 periods.
• The resulting value is plotted directly on your active chart (daily, 4H, etc.), allowing you to visualize the long-term trend without switching timeframes.
⸻
⚙️ Settings
• Period: default = 60
• Source: default = close
• Type: choose between SMA or EMA
⸻
💡 Use Cases
• Identify whether the current price is above or below the weekly trend while working on lower-timeframe setups.
• Combine with daily MAs or shorter EMAs for multi-timeframe confluence.
• Great for swing traders and position traders who monitor long-term momentum while refining entries on the daily or 4H chart.
⸻
🛠 Technical Notes
• Built in Pine Script® v6 for full compatibility.
• Uses barmerge.gaps_off and barmerge.lookahead_off for accurate data alignment.
• Minimal and optimized for overlay display (no separate window).
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。