OPEN-SOURCE SCRIPT
2MA Cross with Glow Effects

2MA Cross with Glow Effects
Overview
This indicator enhances the classic moving average crossover strategy with a dynamic and visually appealing "glow" effect. It plots two customisable moving averages on the chart and illuminates the area around them when a crossover occurs, providing a clear and intuitive signal for potential trend changes.
Features
How It Works
The core of the indicator is the calculation of two moving averages based on the user's selected type and length. The script continuously monitors the relationship between these two MAs.
The "glow" is a sophisticated visual effect achieved by using Pine Script's `fill()` function to create a smooth, colored gradient around the MA lines. The glow is conditionally rendered:
To ensure a consistent visual appearance across different chart timeframes, the indicator incorporates a `tfMultiplier` that automatically adjusts the glow's width.
How to Use
This indicator can be used in the same way as a standard moving average crossover strategy
Traders can use this for trend identification, entry/exit signals, and as a component of a more comprehensive trading system. For example, a common setup is using a 20-period EMA and a 50-period EMA to capture medium-term trends.
Disclaimer
This indicator is designed as a technical analysis tool and should be used in conjunction with other forms of analysis and proper risk management.
Past performance does not guarantee future results, and traders should thoroughly test any strategy before implementing it with real capital.
Overview
This indicator enhances the classic moving average crossover strategy with a dynamic and visually appealing "glow" effect. It plots two customisable moving averages on the chart and illuminates the area around them when a crossover occurs, providing a clear and intuitive signal for potential trend changes.
Features
- Dual Moving Averages: Configure two independent moving averages to suit your trading style.
- Multiple MA Types: Choose from a wide range of moving average types for each line, including:
SMA (Simple Moving Average)
EMA (Exponential Moving Average)
WMA (Weighted Moving Average)
VWMA (Volume-Weighted Moving Average)
RMA (Relative Moving Average)
HMA (Hull Moving Average)
ALMA (Arnaud Legoux Moving Average)
LSMA (Least Squares Moving Average)
- Customisable Appearance: Adjust the length, line width, and color for each moving average.
- Unique Glow Effect: A configurable glow appears around the moving averages during a crossover, providing an unmistakable visual cue. You can control the intensity and width of this effect.
How It Works
The core of the indicator is the calculation of two moving averages based on the user's selected type and length. The script continuously monitors the relationship between these two MAs.
The "glow" is a sophisticated visual effect achieved by using Pine Script's `fill()` function to create a smooth, colored gradient around the MA lines. The glow is conditionally rendered:
- When the first moving average (MA1) crosses above the second (MA2), MA1 will glow above its line.
- When MA1 crosses below MA2, it will glow below its line.
- The same logic is applied to MA2, creating a dual-glow effect that clearly shows which MA is dominant.
To ensure a consistent visual appearance across different chart timeframes, the indicator incorporates a `tfMultiplier` that automatically adjusts the glow's width.
How to Use
This indicator can be used in the same way as a standard moving average crossover strategy
- Bullish Signal: Look for the shorter-period moving average to cross above the longer-period moving average. The glow effect will make this event highly visible.
- Bearish Signal: Look for the shorter-period moving average to cross below the longer-period moving average.
Traders can use this for trend identification, entry/exit signals, and as a component of a more comprehensive trading system. For example, a common setup is using a 20-period EMA and a 50-period EMA to capture medium-term trends.
Disclaimer
This indicator is designed as a technical analysis tool and should be used in conjunction with other forms of analysis and proper risk management.
Past performance does not guarantee future results, and traders should thoroughly test any strategy before implementing it with real capital.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.