OPEN-SOURCE SCRIPT
4 Timeframe EMA 20

4 Timeframe EMA 20 is a multi-timeframe overlay indicator that plots four EMA lines on a single chart using the same EMA length across four different timeframes: 5-minute, 15-minute, 1-hour, and 4-hour. This allows you to view short-term and higher-timeframe trend structure at the same time without switching between charts.
The script calculates each EMA with request.security(), so each line reflects the EMA value from its own timeframe while remaining visible on your current chart. By default, the indicator displays a 20-period EMA for all four timeframes with distinct colors and line styles for quick visual separation.
Default appearance:
5m EMA 20: gray solid line.
15m EMA 20: blue dotted line.
1h EMA 20: orange dashed line.
4h EMA 20: red solid line.
Customizable options:
EMA Length: change the EMA period used for all four timeframes.
Show 5m EMA: turn the 5-minute EMA on or off.
Show 15m EMA: turn the 15-minute EMA on or off.
Show 1h EMA: turn the 1-hour EMA on or off.
Show 4h EMA: turn the 4-hour EMA on or off.
Style tab controls: adjust each line’s color, thickness, visibility, and line presentation directly from TradingView’s built-in Style settings.
This indicator is useful for traders who want a fast read on trend alignment across execution and higher timeframes. For example, you can use the 5m and 15m EMAs for short-term structure while keeping the 1h and 4h EMAs on the chart as broader directional context.
The script calculates each EMA with request.security(), so each line reflects the EMA value from its own timeframe while remaining visible on your current chart. By default, the indicator displays a 20-period EMA for all four timeframes with distinct colors and line styles for quick visual separation.
Default appearance:
5m EMA 20: gray solid line.
15m EMA 20: blue dotted line.
1h EMA 20: orange dashed line.
4h EMA 20: red solid line.
Customizable options:
EMA Length: change the EMA period used for all four timeframes.
Show 5m EMA: turn the 5-minute EMA on or off.
Show 15m EMA: turn the 15-minute EMA on or off.
Show 1h EMA: turn the 1-hour EMA on or off.
Show 4h EMA: turn the 4-hour EMA on or off.
Style tab controls: adjust each line’s color, thickness, visibility, and line presentation directly from TradingView’s built-in Style settings.
This indicator is useful for traders who want a fast read on trend alignment across execution and higher timeframes. For example, you can use the 5m and 15m EMAs for short-term structure while keeping the 1h and 4h EMAs on the chart as broader directional context.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.