OPEN-SOURCE SCRIPT
מעודכן

Range breaking indicator

175
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).”
הערות שחרור
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).”
הערות שחרור
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).”
הערות שחרור
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).”
הערות שחרור
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).”
הערות שחרור
ange Breaking Indicator

The Range Breaking Indicator analyzes the balance between bullish and bearish pressure over a selected number of candles to help identify potential range breakouts or trend continuation points.

This indicator calculates the cumulative “area” of bullish and bearish candles — optionally weighted by volume — to determine which side of the market is currently dominant. When the bullish and bearish areas become nearly equal within a user-defined threshold, the indicator flags a balance zone, suggesting that the market may be preparing to break out of its current range.

Key Features:

Candle Area Analysis: Measures the total bullish and bearish candle areas (optionally volume-weighted) over a rolling window.

Balance Detection: Highlights moments when bullish and bearish forces are nearly equal, often preceding volatility expansion or trend shifts.

Customizable Settings:

Number of Candles to Analyze: Defines how many past candles are considered.

Use Volume Weighting: Optionally gives more importance to candles with higher trading volume.

Balance Threshold: Adjusts sensitivity for detecting equilibrium conditions.

Visual Representation:

Plots Bullish (%) and Bearish (%) area dominance.

Marks the 50% equilibrium line and highlights potential range-ending signals.

Alert System: Triggers alerts when a balanced condition is detected, signaling a potential range breakout setup.

Interpretation:

When Bullish % > 50%, buying pressure dominates.

When Bearish % > 50%, selling pressure dominates.

When the values converge near 50% ± threshold, the market is in a potential balance phase, often preceding a strong directional move.

כתב ויתור

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.