OPEN-SOURCE SCRIPT
Moving Average Projection

Displays 2-5 moving averages (solid lines) and projects their future trajectory (dashed lines) based on current trend momentum. This helps you anticipate where key MAs are heading and identify potential future support/resistance levels.
Important: Projections show where MAs would move IF the current trend continues—they're not predictions. Market conditions change, so use projections as planning tools, not trading signals.
General Settings
Number of MAs (2-5) controls how many moving averages display on your chart. Start with 2-3 to avoid clutter. Projection Bars (1-100) determines how far into the future to project—use 10-20 for intraday charts and 20-40 for daily charts. Lookback for Slope (2-100) sets the number of bars used to calculate trend slope, where shorter lookbacks are more responsive and longer ones are smoother. The default of 20 works well for most situations.
Individual MA Settings (MA 1-5)
Each MA has four settings: Length sets the period for the MA (common values are 9, 20, 50, 100, and 200), Type lets you choose between SMA, EMA, WMA, HMA, VWMA, or RMA (EMA is most popular), Color sets the historical MA line color, and Projection Color sets the projected line color (usually a lighter or transparent version of the main color).
MA Types Quick Reference: EMA is most popular and responsive to recent prices. SMA gives equal weight to all periods and is the smoothest. HMA is very responsive with low lag. VWMA incorporates volume data.
Quick Setup Examples
Day Trading: 3 MAs (9/21/50 EMA), 10-15 projection bars, 10-15 lookback
Swing Trading: 2 MAs (50/200 EMA), 20-30 projection bars, 20 lookback
Scalping: 2 MAs (9/20 EMA), 5-10 projection bars, 5-10 lookback
How to Use
Trend Identification: An uptrend shows price above rising MAs with projections pointing up. A downtrend shows price below falling MAs with projections pointing down. Consolidation appears as flat MAs with horizontal projections.
Support & Resistance: Rising MA projections act as future dynamic support levels, while falling MA projections act as future dynamic resistance levels.
Anticipating Changes: Watch for projected MA crossovers before they happen. When projections converge, expect volatility or consolidation. Steep projections suggest unsustainable trends, so be cautious. Flat projections indicate ranging markets.
Trade Planning: Check the current trend using MA alignment, then look at projections to gauge trend continuation likelihood. Use projected MA levels for potential targets or stop placement.
Important Tips
When Projections Work Best: Projections are most reliable in stable trending markets with consistent momentum, low volatility environments, and away from major news events.
When to Be Cautious: Use caution during high volatility or choppy price action, around major economic releases, when projections show extreme or parabolic angles, and during trend transitions.
Combine With Other Analysis: Don't trade projections alone. Use them alongside price action, volume, support and resistance levels, and other indicators for confirmation.
Best Practices
Start with 2-3 MAs to avoid chart clutter. Match your projection and lookback bars to your trading timeframe. Use consistent color schemes for quick interpretation. Adjust settings as market conditions change. Always use proper risk management—projections are planning tools, not guarantees.
Troubleshooting
Projections not showing: Check that Projection Bars > 0 and you're viewing the most recent bar
Chart too cluttered: Reduce number of MAs or increase projection color transparency
Projections too volatile: Increase lookback bars or switch to EMA/SMA from HMA
Can't see certain MAs: Verify "Number of MAs" setting includes them (MA 3 won't show if set to 2)
Important: Projections show where MAs would move IF the current trend continues—they're not predictions. Market conditions change, so use projections as planning tools, not trading signals.
General Settings
Number of MAs (2-5) controls how many moving averages display on your chart. Start with 2-3 to avoid clutter. Projection Bars (1-100) determines how far into the future to project—use 10-20 for intraday charts and 20-40 for daily charts. Lookback for Slope (2-100) sets the number of bars used to calculate trend slope, where shorter lookbacks are more responsive and longer ones are smoother. The default of 20 works well for most situations.
Individual MA Settings (MA 1-5)
Each MA has four settings: Length sets the period for the MA (common values are 9, 20, 50, 100, and 200), Type lets you choose between SMA, EMA, WMA, HMA, VWMA, or RMA (EMA is most popular), Color sets the historical MA line color, and Projection Color sets the projected line color (usually a lighter or transparent version of the main color).
MA Types Quick Reference: EMA is most popular and responsive to recent prices. SMA gives equal weight to all periods and is the smoothest. HMA is very responsive with low lag. VWMA incorporates volume data.
Quick Setup Examples
Day Trading: 3 MAs (9/21/50 EMA), 10-15 projection bars, 10-15 lookback
Swing Trading: 2 MAs (50/200 EMA), 20-30 projection bars, 20 lookback
Scalping: 2 MAs (9/20 EMA), 5-10 projection bars, 5-10 lookback
How to Use
Trend Identification: An uptrend shows price above rising MAs with projections pointing up. A downtrend shows price below falling MAs with projections pointing down. Consolidation appears as flat MAs with horizontal projections.
Support & Resistance: Rising MA projections act as future dynamic support levels, while falling MA projections act as future dynamic resistance levels.
Anticipating Changes: Watch for projected MA crossovers before they happen. When projections converge, expect volatility or consolidation. Steep projections suggest unsustainable trends, so be cautious. Flat projections indicate ranging markets.
Trade Planning: Check the current trend using MA alignment, then look at projections to gauge trend continuation likelihood. Use projected MA levels for potential targets or stop placement.
Important Tips
When Projections Work Best: Projections are most reliable in stable trending markets with consistent momentum, low volatility environments, and away from major news events.
When to Be Cautious: Use caution during high volatility or choppy price action, around major economic releases, when projections show extreme or parabolic angles, and during trend transitions.
Combine With Other Analysis: Don't trade projections alone. Use them alongside price action, volume, support and resistance levels, and other indicators for confirmation.
Best Practices
Start with 2-3 MAs to avoid chart clutter. Match your projection and lookback bars to your trading timeframe. Use consistent color schemes for quick interpretation. Adjust settings as market conditions change. Always use proper risk management—projections are planning tools, not guarantees.
Troubleshooting
Projections not showing: Check that Projection Bars > 0 and you're viewing the most recent bar
Chart too cluttered: Reduce number of MAs or increase projection color transparency
Projections too volatile: Increase lookback bars or switch to EMA/SMA from HMA
Can't see certain MAs: Verify "Number of MAs" setting includes them (MA 3 won't show if set to 2)
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。