OPEN-SOURCE SCRIPT
20MA / 200 MA Konvergenz & Elephant Bar Filter

The script creates a Momentum Filter designed to identify stocks that are currently exhibiting a transition from long-term price stability to short-term explosive volatility.
1. 🧘 Long-Term Stability Logic (Convergence)
The first part of the script identifies assets in a state of tight consolidation. This suggests that market participants have reached a temporary equilibrium, creating pent-up energy for a future trend.
A. Moving Average (MA) Proximity
The script checks if the fast MA (20 periods) and the slow MA (200 periods) are very close together.
It calculates the percentage difference, filtering for stocks where the separation between the two MAs is less than 2%. This defines the narrow range.
This condition confirms that the short-term and long-term price trends are essentially flat and aligned.
B. Price Nearness to the Long-Term MA
It further ensures that the current closing price is also within a tight range (e.g., less than 2%) of the 200-period MA.
This confirms the asset is actively trading at the center of the consolidation zone, simulating the "parallel" alignment of the MAs.
2. 💥 Explosive Breakout Logic (The Large Candle)
The second part of the script looks for the catalyst—an event that signals a sudden shift in supply and demand, ending the period of calm.
A. Above-Average Body Size
The script calculates the average absolute size of the candle body (the distance between open and close) over the last 20 periods.
It filters for stocks where the current candle body is at least three times (3x) larger than that historical average. This is the core signal of a powerful, convinced price move.
B. High Body-to-Range Ratio
To ensure the move was decisive and met little resistance, the script verifies that the candle body accounts for at least 85% of the candle's total range (high minus low).
This eliminates candles with long wicks (shadows), which would indicate volatility but a lack of directional conviction.
🎯 Summary
The combined screening identifies assets that have maintained long-term stability (MA convergence) but have just experienced a high-conviction, low-resistance breakout (Large Candle), indicating that a new, strong trend may be initiating.
1. 🧘 Long-Term Stability Logic (Convergence)
The first part of the script identifies assets in a state of tight consolidation. This suggests that market participants have reached a temporary equilibrium, creating pent-up energy for a future trend.
A. Moving Average (MA) Proximity
The script checks if the fast MA (20 periods) and the slow MA (200 periods) are very close together.
It calculates the percentage difference, filtering for stocks where the separation between the two MAs is less than 2%. This defines the narrow range.
This condition confirms that the short-term and long-term price trends are essentially flat and aligned.
B. Price Nearness to the Long-Term MA
It further ensures that the current closing price is also within a tight range (e.g., less than 2%) of the 200-period MA.
This confirms the asset is actively trading at the center of the consolidation zone, simulating the "parallel" alignment of the MAs.
2. 💥 Explosive Breakout Logic (The Large Candle)
The second part of the script looks for the catalyst—an event that signals a sudden shift in supply and demand, ending the period of calm.
A. Above-Average Body Size
The script calculates the average absolute size of the candle body (the distance between open and close) over the last 20 periods.
It filters for stocks where the current candle body is at least three times (3x) larger than that historical average. This is the core signal of a powerful, convinced price move.
B. High Body-to-Range Ratio
To ensure the move was decisive and met little resistance, the script verifies that the candle body accounts for at least 85% of the candle's total range (high minus low).
This eliminates candles with long wicks (shadows), which would indicate volatility but a lack of directional conviction.
🎯 Summary
The combined screening identifies assets that have maintained long-term stability (MA convergence) but have just experienced a high-conviction, low-resistance breakout (Large Candle), indicating that a new, strong trend may be initiating.
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.