OPEN-SOURCE SCRIPT
Multiple EMA + SMA (8-in-1, or 4 of each)

This combo indicator takes Tradingview's default SMA and EMA Pinescript code and basically duplicates it 8 times. There are 4 EMAs and 4 SMAs, each configurable to their own timeframe, line, color, etc. I did this so I could see several combinations of moving averages on various chart timeframes, such as:
- Daily chart: 200 SMA, 50 SMA, 20 EMA
- 4 hour chart: 200 SMA, 50 EMA, 20 EMA
- 1 hour chart: 50 EMA, 20 EMA, 9 EMA
- 30 minute chart: 50 EMA, 20 EMA, 9 EMA
Moving Averages Are Filters, Not Triggers: The moving average smooths price action to reveal the dominant market current, not to provide buy or sell signals alone. It filters market noise but requires price action confirmation for entry decisions.Therefore it's important to note the **slope** direction of the MA too.
Matching Time Frame and Holding Period: Using a moving average setting built on a timeframe inconsistent with your trade duration (e.g., a short moving average on a multi-month trade) causes frequent whipsaws. The setting must reflect your trade horizon.
Three Roles of Moving Averages on Any Time Frame:
1. **Tide (Slowest Line)** — Indicates the overall market direction and which side to trade.
2. **Trend (Middle Line)** — Represents the active trend you trade around.
3. **Timing (Fastest Line)** — Identifies pullback zones and potential entry points.
Consistency and Discipline are Crucial: The hardest part of trading is not knowing the settings but patiently waiting for alignment of the tide, trend, and timing lines, and resisting impulsive trades.
When to use EMA or SMA: Shorter time frames use EMAs for faster reaction to price changes, whereas longer time frames use SMAs to smooth out noise and emphasize broader trends. The 200-day SMA is particularly important as it is the most widely followed moving average, creating real support/resistance due to collective market attention.
Examples and Practical Application:
- A trader looking for a long trade on the daily chart might identify:
- Price above a rising slope 200 SMA (tide) = only look for long trades
- Price above a rising slope 50 SMA (trend) = confirms a healthy trend
- Price pulls back to 20 EMA (timing zone) = start watching for price action confirming the entry
- Crossovers like the "golden cross" (50 SMA crossing 200 SMA) are only contextual signals indicating trend shifts, don't use them as entry triggers.
- On faster charts (1-hour and 30-minute), multiple touches of moving averages happen frequently due to noise; thus, confirmation from price action, volume, or other indicators is essential.
The core takeaway here is that knowing precise moving average numbers is easy. Mastering the **patience, discipline, and risk management** to trade only when the tide, trend, and timing all align is what really separates successful traders from losing ones.
- Daily chart: 200 SMA, 50 SMA, 20 EMA
- 4 hour chart: 200 SMA, 50 EMA, 20 EMA
- 1 hour chart: 50 EMA, 20 EMA, 9 EMA
- 30 minute chart: 50 EMA, 20 EMA, 9 EMA
Moving Averages Are Filters, Not Triggers: The moving average smooths price action to reveal the dominant market current, not to provide buy or sell signals alone. It filters market noise but requires price action confirmation for entry decisions.Therefore it's important to note the **slope** direction of the MA too.
Matching Time Frame and Holding Period: Using a moving average setting built on a timeframe inconsistent with your trade duration (e.g., a short moving average on a multi-month trade) causes frequent whipsaws. The setting must reflect your trade horizon.
Three Roles of Moving Averages on Any Time Frame:
1. **Tide (Slowest Line)** — Indicates the overall market direction and which side to trade.
2. **Trend (Middle Line)** — Represents the active trend you trade around.
3. **Timing (Fastest Line)** — Identifies pullback zones and potential entry points.
Consistency and Discipline are Crucial: The hardest part of trading is not knowing the settings but patiently waiting for alignment of the tide, trend, and timing lines, and resisting impulsive trades.
When to use EMA or SMA: Shorter time frames use EMAs for faster reaction to price changes, whereas longer time frames use SMAs to smooth out noise and emphasize broader trends. The 200-day SMA is particularly important as it is the most widely followed moving average, creating real support/resistance due to collective market attention.
Examples and Practical Application:
- A trader looking for a long trade on the daily chart might identify:
- Price above a rising slope 200 SMA (tide) = only look for long trades
- Price above a rising slope 50 SMA (trend) = confirms a healthy trend
- Price pulls back to 20 EMA (timing zone) = start watching for price action confirming the entry
- Crossovers like the "golden cross" (50 SMA crossing 200 SMA) are only contextual signals indicating trend shifts, don't use them as entry triggers.
- On faster charts (1-hour and 30-minute), multiple touches of moving averages happen frequently due to noise; thus, confirmation from price action, volume, or other indicators is essential.
The core takeaway here is that knowing precise moving average numbers is easy. Mastering the **patience, discipline, and risk management** to trade only when the tide, trend, and timing all align is what really separates successful traders from losing ones.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。