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.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.