OPEN-SOURCE SCRIPT
Quarterly Range Breakout with Targets

Quarterly Range Breakout with Targets
Quarterly Range Breakout with Targets is a higher-timeframe market-structure indicator designed to show how price interacts with the previous quarter’s range and how far price may expand once that range begins to break.
At the start of each new calendar quarter, the indicator automatically identifies the completed previous quarter’s:
High
Low
50% midpoint
Those levels are then projected across the current quarter.
The indicator also calculates customizable Fibonacci-based expansion targets above and below the previous quarter’s range.
Each quarter remains visually independent, with its own range levels, targets, labels, and quarter divider.
The Idea Behind the Indicator
The concept is based on a simple market-structure question:
How does the current quarter behave relative to the range established during the previous quarter?
Intraday traders often use opening ranges, previous-day highs and lows, session ranges, and similar reference levels.
Quarterly Range Breakout applies that same idea to a much larger timeframe.
Instead of asking:
“Where is price relative to today’s opening range?”
the indicator asks:
“Where is price relative to the previous three months of price discovery?”
The completed quarter becomes the reference range.
The new quarter then shows whether price:
The goal is not to predict price direction.
The goal is to create a clean structural map and then observe what price actually does around those levels.
Previous Quarter Range
The indicator automatically calculates three core levels.
Previous Quarter High
This is the highest price reached during the completed quarter.
It may act as:
Previous Quarter Midpoint
The midpoint is calculated as:
(Previous Quarter High + Previous Quarter Low) ÷ 2
This represents the 50% point of the previous quarter’s range.
It can help identify whether price is operating in the upper or lower half of that range.
Above the midpoint, price is trading in the upper half.
Below the midpoint, price is trading in the lower half.
The midpoint may also act as an area of balance, support, resistance, or transition.
Previous Quarter Low
This is the lowest price reached during the completed quarter.
It may act as:
Quarterly Expansion Targets
The target system is based on the size of the completed previous quarter.
First, the indicator calculates:
Quarterly Range = Previous Quarter High − Previous Quarter Low
That range is then used to project expansion targets above and below the original range.
For example, a 1.618 target above the range is calculated using:
Previous Quarter Low + (Quarterly Range × 1.618)
The equivalent downside target is mirrored below the range:
Previous Quarter High − (Quarterly Range × 1.618)
This creates symmetrical expansion levels above and below the previous quarter.
The default target levels include:
Additional customizable target slots are also included.
The Fib numbers can be changed manually, allowing traders to test other expansion ratios.
Why Use Range-Based Targets?
The purpose of the target system is not to suggest that price must stop exactly at a Fibonacci number.
Instead, the targets provide a structured way to measure how far price expands relative to the range that existed before the move.
A completed quarter represents roughly three months of price discovery.
If price breaks outside that range, the previous quarter provides an objective measurement unit for evaluating the size of the expansion.
For example:
Previous quarter range = 100 points.
A move to the 1.618 level means price has traveled approximately 1.618 times the size of that previous quarterly range from the opposite side of the range.
This creates a consistent framework that can be compared across different assets and different price levels.
How to Use the Indicator
The indicator can be used as a market-structure framework rather than a standalone entry signal.
A trader might first ask:
Where is price relative to the previous quarter?
Above the high
Inside the range
Below the low
Then:
How is price behaving around the boundary?
Rejecting
Breaking
Retesting
Consolidating
Accepting outside the range
If price breaks above the previous-quarter high, the upside Fib levels can provide objective expansion areas to monitor.
If price breaks below the previous-quarter low, the downside Fib levels can provide the same type of structure.
Example Bullish Sequence
A possible bullish progression might look like:
Previous-quarter high is tested
→ Price closes above the high
→ Price holds above the range
→ Previous-quarter high is retested
→ Buyers continue higher
→ Price begins moving toward the next expansion target
The Fib targets can then act as areas where traders monitor:
Example Bearish Sequence
A bearish sequence may look like:
Previous-quarter midpoint fails
→ Price enters the lower half of the range
→ Previous-quarter low breaks
→ Price remains below the range
→ The low is retested from underneath
→ Selling continues toward lower expansion targets
Again, the targets are reference levels rather than guaranteed turning points.
Quarter-by-Quarter Structure
Each quarter is visually separated by a vertical divider.
All range levels and targets:
begin with the current quarter
remain inside that quarter
stop at the end of the quarter
When the next quarter begins, the indicator automatically calculates a completely new range based on the quarter that just finished.
This keeps historical structure clean and makes it easy to study how each quarter behaved relative to the one before it.
Customization
The indicator includes extensive visual customization.
Users can change:
Fib labels remain inside the quarter they belong to so the chart remains visually organized.
Best Use
The indicator is designed primarily for higher-timeframe analysis, especially the Daily chart.
It can be applied to many different markets, including:
Different markets have different volatility characteristics, so traders should test the concept independently on the instruments they trade.
The Thought Process Behind Quarterly Range Breakout
The indicator is intentionally simple.
It is built around one core principle:
The previous quarter defines the range.
The current quarter reveals the reaction.
The targets measure the expansion.
Rather than filling the chart with many indicators, Quarterly Range Breakout focuses on a small number of objective price levels.
Those levels provide the structure.
Price action provides the information.
The trader decides what to do with it.
Quarterly Range Breakout with Targets is a higher-timeframe market-structure indicator designed to show how price interacts with the previous quarter’s range and how far price may expand once that range begins to break.
At the start of each new calendar quarter, the indicator automatically identifies the completed previous quarter’s:
High
Low
50% midpoint
Those levels are then projected across the current quarter.
The indicator also calculates customizable Fibonacci-based expansion targets above and below the previous quarter’s range.
Each quarter remains visually independent, with its own range levels, targets, labels, and quarter divider.
The Idea Behind the Indicator
The concept is based on a simple market-structure question:
How does the current quarter behave relative to the range established during the previous quarter?
Intraday traders often use opening ranges, previous-day highs and lows, session ranges, and similar reference levels.
Quarterly Range Breakout applies that same idea to a much larger timeframe.
Instead of asking:
“Where is price relative to today’s opening range?”
the indicator asks:
“Where is price relative to the previous three months of price discovery?”
The completed quarter becomes the reference range.
The new quarter then shows whether price:
- remains inside that range
- rejects the boundaries
- rotates around the midpoint
- breaks above the high
- breaks below the low
- expands beyond the range
The goal is not to predict price direction.
The goal is to create a clean structural map and then observe what price actually does around those levels.
Previous Quarter Range
The indicator automatically calculates three core levels.
Previous Quarter High
This is the highest price reached during the completed quarter.
It may act as:
- resistance
- breakout level
- retest level
- support after a successful breakout
Previous Quarter Midpoint
The midpoint is calculated as:
(Previous Quarter High + Previous Quarter Low) ÷ 2
This represents the 50% point of the previous quarter’s range.
It can help identify whether price is operating in the upper or lower half of that range.
Above the midpoint, price is trading in the upper half.
Below the midpoint, price is trading in the lower half.
The midpoint may also act as an area of balance, support, resistance, or transition.
Previous Quarter Low
This is the lowest price reached during the completed quarter.
It may act as:
- support
- breakdown level
- retest level
- resistance after a successful breakdown
Quarterly Expansion Targets
The target system is based on the size of the completed previous quarter.
First, the indicator calculates:
Quarterly Range = Previous Quarter High − Previous Quarter Low
That range is then used to project expansion targets above and below the original range.
For example, a 1.618 target above the range is calculated using:
Previous Quarter Low + (Quarterly Range × 1.618)
The equivalent downside target is mirrored below the range:
Previous Quarter High − (Quarterly Range × 1.618)
This creates symmetrical expansion levels above and below the previous quarter.
The default target levels include:
- 1.618
- 2.618
- 3.618
- 4.236
Additional customizable target slots are also included.
The Fib numbers can be changed manually, allowing traders to test other expansion ratios.
Why Use Range-Based Targets?
The purpose of the target system is not to suggest that price must stop exactly at a Fibonacci number.
Instead, the targets provide a structured way to measure how far price expands relative to the range that existed before the move.
A completed quarter represents roughly three months of price discovery.
If price breaks outside that range, the previous quarter provides an objective measurement unit for evaluating the size of the expansion.
For example:
Previous quarter range = 100 points.
A move to the 1.618 level means price has traveled approximately 1.618 times the size of that previous quarterly range from the opposite side of the range.
This creates a consistent framework that can be compared across different assets and different price levels.
How to Use the Indicator
The indicator can be used as a market-structure framework rather than a standalone entry signal.
A trader might first ask:
Where is price relative to the previous quarter?
Above the high
Inside the range
Below the low
Then:
How is price behaving around the boundary?
Rejecting
Breaking
Retesting
Consolidating
Accepting outside the range
If price breaks above the previous-quarter high, the upside Fib levels can provide objective expansion areas to monitor.
If price breaks below the previous-quarter low, the downside Fib levels can provide the same type of structure.
Example Bullish Sequence
A possible bullish progression might look like:
Previous-quarter high is tested
→ Price closes above the high
→ Price holds above the range
→ Previous-quarter high is retested
→ Buyers continue higher
→ Price begins moving toward the next expansion target
The Fib targets can then act as areas where traders monitor:
- slowing momentum
- rejection
- consolidation
- profit taking
- continuation through the level
Example Bearish Sequence
A bearish sequence may look like:
Previous-quarter midpoint fails
→ Price enters the lower half of the range
→ Previous-quarter low breaks
→ Price remains below the range
→ The low is retested from underneath
→ Selling continues toward lower expansion targets
Again, the targets are reference levels rather than guaranteed turning points.
Quarter-by-Quarter Structure
Each quarter is visually separated by a vertical divider.
All range levels and targets:
begin with the current quarter
remain inside that quarter
stop at the end of the quarter
When the next quarter begins, the indicator automatically calculates a completely new range based on the quarter that just finished.
This keeps historical structure clean and makes it easy to study how each quarter behaved relative to the one before it.
Customization
The indicator includes extensive visual customization.
Users can change:
- Previous Quarter High color
- Previous Quarter High thickness
- Previous Quarter High line style
- Previous Quarter Midpoint color
- Previous Quarter Midpoint thickness
- Previous Quarter Midpoint line style
- Previous Quarter Low color
- Previous Quarter Low thickness
- Previous Quarter Low line style
- Quarter divider color
- Quarter divider thickness
- Quarter divider style
- Fib target colors
- Fib target thickness
- Fib target line style
- Individual Fib numbers
- Which Fib targets are displayed
- Upside targets
- Downside targets
- Fib label visibility
- Fib label size
- Fib label placement
- Fib label spacing
Fib labels remain inside the quarter they belong to so the chart remains visually organized.
Best Use
The indicator is designed primarily for higher-timeframe analysis, especially the Daily chart.
It can be applied to many different markets, including:
- Stocks
- ETFs
- Futures
- Forex
- Indices
- Cryptocurrencies
Different markets have different volatility characteristics, so traders should test the concept independently on the instruments they trade.
The Thought Process Behind Quarterly Range Breakout
The indicator is intentionally simple.
It is built around one core principle:
The previous quarter defines the range.
The current quarter reveals the reaction.
The targets measure the expansion.
Rather than filling the chart with many indicators, Quarterly Range Breakout focuses on a small number of objective price levels.
Those levels provide the structure.
Price action provides the information.
The trader decides what to do with it.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.