OPEN-SOURCE SCRIPT
Atualizado

Range breaking indicator

84
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).”
Notas de Lançamento
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).”
Notas de Lançamento
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).”
Notas de Lançamento
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).”

Aviso legal

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.