OPEN-SOURCE SCRIPT
Mis à jour Range breaking indicator

Description
Bull/Bear Area Ratio (last N candles) helps identify potential end-of-range situations by analyzing the relative strength of bullish vs bearish candles over a rolling window of N bars.
Instead of simply counting up or down candles, this script measures the "area" of each candle — the absolute distance between open and close, optionally weighted by volume.
By summing these areas over the last N bars, it calculates the percentage of bullish and bearish energy within that period.
When both sides become balanced (near 50/50), it often signals range exhaustion or possible trend transition.
How it works
Calculates the bullish and bearish area of each candle (abs(close - open), optionally × volume).
Maintains rolling buffers of the last N bars to compute running totals.
Plots both Bullish % (green) and Bearish % (red).
Highlights possible range-ending zones when the bullish ratio nears 50% ± threshold.
Displays a label showing the current balance.
Includes an alert condition when equilibrium is detected.
Inputs
Number of candles (N) – Rolling window length.
Use volume weighting – Multiplies each candle’s area by its volume.
Balance threshold (%) – Sensitivity for detecting equilibrium (default: 10%).
Best use
Combine with volume or volatility indicators to confirm market compression or expansion.
Use on higher timeframes (H1, H4, D1) to detect early signs of accumulation or distribution.
Works across all asset types: crypto, forex, stocks, indices, etc.
Alerts
An alert is triggered when:
“The range of the last N candles is balanced (possible end of range).”
Bull/Bear Area Ratio (last N candles) helps identify potential end-of-range situations by analyzing the relative strength of bullish vs bearish candles over a rolling window of N bars.
Instead of simply counting up or down candles, this script measures the "area" of each candle — the absolute distance between open and close, optionally weighted by volume.
By summing these areas over the last N bars, it calculates the percentage of bullish and bearish energy within that period.
When both sides become balanced (near 50/50), it often signals range exhaustion or possible trend transition.
How it works
Calculates the bullish and bearish area of each candle (abs(close - open), optionally × volume).
Maintains rolling buffers of the last N bars to compute running totals.
Plots both Bullish % (green) and Bearish % (red).
Highlights possible range-ending zones when the bullish ratio nears 50% ± threshold.
Displays a label showing the current balance.
Includes an alert condition when equilibrium is detected.
Inputs
Number of candles (N) – Rolling window length.
Use volume weighting – Multiplies each candle’s area by its volume.
Balance threshold (%) – Sensitivity for detecting equilibrium (default: 10%).
Best use
Combine with volume or volatility indicators to confirm market compression or expansion.
Use on higher timeframes (H1, H4, D1) to detect early signs of accumulation or distribution.
Works across all asset types: crypto, forex, stocks, indices, etc.
Alerts
An alert is triggered when:
“The range of the last N candles is balanced (possible end of range).”
Notes de version
DescriptionBull/Bear Area Ratio (last N candles) helps identify potential end-of-range situations by analyzing the relative strength of bullish vs bearish candles over a rolling window of N bars.
Instead of simply counting up or down candles, this script measures the "area" of each candle — the absolute distance between open and close, optionally weighted by volume.
By summing these areas over the last N bars, it calculates the percentage of bullish and bearish energy within that period.
When both sides become balanced (near 50/50), it often signals range exhaustion or possible trend transition.
How it works
Calculates the bullish and bearish area of each candle (abs(close - open), optionally × volume).
Maintains rolling buffers of the last N bars to compute running totals.
Plots both Bullish % (green) and Bearish % (red).
Highlights possible range-ending zones when the bullish ratio nears 50% ± threshold.
Displays a label showing the current balance.
Includes an alert condition when equilibrium is detected.
Inputs
Number of candles (N) – Rolling window length.
Use volume weighting – Multiplies each candle’s area by its volume.
Balance threshold (%) – Sensitivity for detecting equilibrium (default: 10%).
Best use
Combine with volume or volatility indicators to confirm market compression or expansion.
Use on higher timeframes (H1, H4, D1) to detect early signs of accumulation or distribution.
Works across all asset types: crypto, forex, stocks, indices, etc.
Alerts
An alert is triggered when:
“The range of the last N candles is balanced (possible end of range).”
Notes de version
DescriptionBull/Bear Area Ratio (last N candles) helps identify potential end-of-range situations by analyzing the relative strength of bullish vs bearish candles over a rolling window of N bars.
Instead of simply counting up or down candles, this script measures the "area" of each candle — the absolute distance between open and close, optionally weighted by volume.
By summing these areas over the last N bars, it calculates the percentage of bullish and bearish energy within that period.
When both sides become balanced (near 50/50), it often signals range exhaustion or possible trend transition.
How it works
Calculates the bullish and bearish area of each candle (abs(close - open), optionally × volume).
Maintains rolling buffers of the last N bars to compute running totals.
Plots both Bullish % (green) and Bearish % (red).
Highlights possible range-ending zones when the bullish ratio nears 50% ± threshold.
Displays a label showing the current balance.
Includes an alert condition when equilibrium is detected.
Inputs
Number of candles (N) – Rolling window length.
Use volume weighting – Multiplies each candle’s area by its volume.
Balance threshold (%) – Sensitivity for detecting equilibrium (default: 10%).
Best use
Combine with volume or volatility indicators to confirm market compression or expansion.
Use on higher timeframes (H1, H4, D1) to detect early signs of accumulation or distribution.
Works across all asset types: crypto, forex, stocks, indices, etc.
Alerts
An alert is triggered when:
“The range of the last N candles is balanced (possible end of range).”
Notes de version
DescriptionBull/Bear Area Ratio (last N candles) helps identify potential end-of-range situations by analyzing the relative strength of bullish vs bearish candles over a rolling window of N bars.
Instead of simply counting up or down candles, this script measures the "area" of each candle — the absolute distance between open and close, optionally weighted by volume.
By summing these areas over the last N bars, it calculates the percentage of bullish and bearish energy within that period.
When both sides become balanced (near 50/50), it often signals range exhaustion or possible trend transition.
How it works
Calculates the bullish and bearish area of each candle (abs(close - open), optionally × volume).
Maintains rolling buffers of the last N bars to compute running totals.
Plots both Bullish % (green) and Bearish % (red).
Highlights possible range-ending zones when the bullish ratio nears 50% ± threshold.
Displays a label showing the current balance.
Includes an alert condition when equilibrium is detected.
Inputs
Number of candles (N) – Rolling window length.
Use volume weighting – Multiplies each candle’s area by its volume.
Balance threshold (%) – Sensitivity for detecting equilibrium (default: 10%).
Best use
Combine with volume or volatility indicators to confirm market compression or expansion.
Use on higher timeframes (H1, H4, D1) to detect early signs of accumulation or distribution.
Works across all asset types: crypto, forex, stocks, indices, etc.
Alerts
An alert is triggered when:
“The range of the last N candles is balanced (possible end of range).”
Notes de version
DescriptionBull/Bear Area Ratio (last N candles) helps identify potential end-of-range situations by analyzing the relative strength of bullish vs bearish candles over a rolling window of N bars.
Instead of simply counting up or down candles, this script measures the "area" of each candle — the absolute distance between open and close, optionally weighted by volume.
By summing these areas over the last N bars, it calculates the percentage of bullish and bearish energy within that period.
When both sides become balanced (near 50/50), it often signals range exhaustion or possible trend transition.
How it works
Calculates the bullish and bearish area of each candle (abs(close - open), optionally × volume).
Maintains rolling buffers of the last N bars to compute running totals.
Plots both Bullish % (green) and Bearish % (red).
Highlights possible range-ending zones when the bullish ratio nears 50% ± threshold.
Displays a label showing the current balance.
Includes an alert condition when equilibrium is detected.
Inputs
Number of candles (N) – Rolling window length.
Use volume weighting – Multiplies each candle’s area by its volume.
Balance threshold (%) – Sensitivity for detecting equilibrium (default: 10%).
Best use
Combine with volume or volatility indicators to confirm market compression or expansion.
Use on higher timeframes (H1, H4, D1) to detect early signs of accumulation or distribution.
Works across all asset types: crypto, forex, stocks, indices, etc.
Alerts
An alert is triggered when:
“The range of the last N candles is balanced (possible end of range).”
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.