OPEN-SOURCE SCRIPT
Trend Continuation [OmegaTools]

Trend Continuation [OmegaTools] is a trend-following and trend-continuation tool designed to highlight high-probability pullbacks within an existing directional bias. It helps discretionary and systematic traders visually isolate “continuation zones” where a retracement is more likely to resolve in favor of the prevailing trend rather than trigger a full reversal.
1. Concept and Objective
The indicator combines two key components:
1. A trend bias engine (based either on a Rolling VWAP regime or on swing market structure).
2. A pullback pressure model, which quantifies how deep and “aggressive” the recent retracement has been relative to the trend.
The goal is to identify moments where the market pulls back against the trend, builds enough “reversal pressure,” and then shows signs that the trend is likely to **continue** rather than flip. When specific conditions are met, the indicator highlights bars and plots reference levels that can be used as potential continuation zones, filters, or confluence areas in a broader trading plan.
2. Trend Bias Modes
The primary trend direction is defined through the `Trend Mode` input:
* **RVWAP Mode (default)**
The script computes two rolling volume-weighted average prices over different lengths:
* A **shorter-term rolling VWAP**
* A **longer-term rolling VWAP**
When the shorter RVWAP is above the longer one, the bias is set to **bullish (+1)**. When it is below, the bias is **bearish (-1)**.
This creates a smooth, volume-weighted trend definition that tends to adapt to shifting regimes and filters out minor noise.
* **Market Structure Mode**
In this mode, trend bias is derived from **pivot highs and lows**:
* When price breaks above a recent pivot high, the bias flips to **bullish (+1)**.
* When price breaks below a recent pivot low, the bias flips to **bearish (-1)**.
This approach is more structurally oriented and reacts to significant swing breaks rather than just moving-average style relationships.
If no clear condition is met, the internal bias can temporarily be neutral, though the main design assumes working with clearly bullish or bearish environments.
3. Pullback and Reversal Pressure Logic
Once the trend bias is defined, the indicator measures **pullback intensity** against that trend:
* A **lookback window (“Pullback Length”)** scans recent highs and lows:
* In an uptrend, it tracks the **highest high** over the window and measures how far the current low pulls back from that high.
* In a downtrend, it tracks the **lowest low** and measures how far the current high bounces up from that low.
* This distance is converted into a **“reversal pressure” value**:
* In a bullish bias, deeper pullbacks (lower lows relative to the recent high) indicate stronger counter-trend pressure.
* In a bearish bias, stronger rallies (higher highs relative to the recent low) indicate stronger counter-trend pressure.
The raw reversal pressure is then smoothed with a long-term moving average to separate normal retracements from **statistically significant extremes**.
4. Thresholds and Histogram Coloring
To avoid reacting to every minor pullback, the indicator builds a **dynamic threshold** using a combination of:
* Long-term averages of reversal pressure.
* Standard deviation of reversal pressure.
* High-percentile values of reversal behavior over different sample sizes.
From this, a **threshold line** is derived, and the script then compares the current reversal pressure to this adaptive level:
* The **Reversal Histogram** (column plot) represents the excess reversal pressure above its own long-term average.
* When:
* There is a valid bullish or bearish bias, and
* The histogram is above the dynamic threshold,
the bars of the histogram are **colored**:
* Blue (or a similar “positive” color) in bullish bias.
* Red/pink (or a similar “negative” color) in bearish bias.
* When reversal pressure is below threshold or bias is not relevant, the histogram remains **neutral gray**.
These colored histogram segments represent **“high-tension” pullback states**, where counter-trend pressure has reached an extreme that, historically, often resolves with the original trend continuing rather than fully reversing.
5. Continuation Level and Bar Coloring on Price Chart
To connect the oscillator logic back to the chart:
* A **continuation reference level** is computed on the price series:
* In an uptrend, this is derived by subtracting the threshold from recent highs.
* In a downtrend, it is derived by adding the threshold to recent lows.
* This level is plotted as a **line on the price chart** (only when the trend bias is stable), acting as a visual guide for:
* Potential continuation zones,
* Possible stop-placement or invalidation areas,
* Or filters for entries/exits.
The bars are then **colored** when price crosses or interacts with these levels in the direction of the trend:
* In a bullish bias, bars closing below the continuation level can be highlighted as potential **deep pullback/continuation opportunities** or as warning signals, depending on the user’s playbook.
* In a bearish bias, bars closing above the continuation level are similarly highlighted.
This makes it easy to see where the oscillator’s “extreme pullback” conditions align with structural movements on the actual price bars.
6. Embedded Win-Rate Estimation (WR Table)
The script also includes an internal **win-rate style metric (WR%)** displayed in a small table on the chart:
* It tracks occurrences where:
* A valid bullish or bearish bias is present, and
* The Reversal Histogram is **above the threshold** (i.e., histogram is colored).
* It then approximates the **probability that the trend bias does not change** following such high-pressure pullback events.
* The WR value is shown as a percentage and represents, in essence, the **historical trend-continuation rate** under these specific conditions over the most recent sample of events.
This is not a formal statistical test and does not guarantee future performance, but it provides a quick visual indication of how often these continuation setups have led to **trend persistence** in the recent past.
7. How to Use in Practice
Typical applications include:
Trend-following entries on pullbacks
Identify the main trend using either RVWAP or Market Structure mode.
Wait for a colored histogram bar (reversal pressure above threshold).
Use the continuation reference line and bar coloring on the price chart to refine entry zones or invalidation levels.
Filtering signals from other systems
Run the indicator in the background to confirm trend continuation conditions before taking signals from another strategy (e.g., breakouts or momentum entries).
Only act on long signals when the bias is bullish and a high-pressure pullback has recently occurred; similarly for short signals in bearish conditions.
Risk management and trend monitoring
Monitor when reversal pressure is building against your current position.
Use shifts in bias combined with high reversal pressure to re-evaluate or scale out of trend-following trades.
Recommended steps:
1. Choose your Trend Mode:
- RVWAP for smoother, regime-style trend detection.
- Market Structure for swing-based structural changes.
2. Adjust Trend Length and Pullback Length to match your timeframe (shorter for intraday, longer for swing/position trading).
3. Observe where histogram colors appear and how price reacts around the continuation line and highlighted bars.
4. Integrate these signals into a pre-defined trading plan with clear entry, exit, and risk rules.
8. Limitations and Disclaimer
* This tool is a **technical analysis aid**, not a complete trading system.
* Past behavior of trend continuation or reversal pressure does **not** guarantee future results.
* The embedded WR metric is a **descriptive statistic** based on recent historical conditions only; it is not a promise of performance or a robust statistical forecast.
* All parameters (lengths, thresholds, modes) are user-configurable and should be **tested and validated** on your own data, instruments, and timeframes before any live use.
Disclaimer
This indicator is provided for informational and educational purposes only and does not constitute financial, investment, or trading advice. Trading and investing in financial markets involve substantial risk, including the possible loss of all capital. You are solely responsible for your own trading decisions and for evaluating all information provided by this tool. OmegaTools and the author of this script expressly disclaim any liability for any direct or indirect loss resulting from the use of this indicator. Always consult with a qualified financial professional before making any investment decisions.
1. Concept and Objective
The indicator combines two key components:
1. A trend bias engine (based either on a Rolling VWAP regime or on swing market structure).
2. A pullback pressure model, which quantifies how deep and “aggressive” the recent retracement has been relative to the trend.
The goal is to identify moments where the market pulls back against the trend, builds enough “reversal pressure,” and then shows signs that the trend is likely to **continue** rather than flip. When specific conditions are met, the indicator highlights bars and plots reference levels that can be used as potential continuation zones, filters, or confluence areas in a broader trading plan.
2. Trend Bias Modes
The primary trend direction is defined through the `Trend Mode` input:
* **RVWAP Mode (default)**
The script computes two rolling volume-weighted average prices over different lengths:
* A **shorter-term rolling VWAP**
* A **longer-term rolling VWAP**
When the shorter RVWAP is above the longer one, the bias is set to **bullish (+1)**. When it is below, the bias is **bearish (-1)**.
This creates a smooth, volume-weighted trend definition that tends to adapt to shifting regimes and filters out minor noise.
* **Market Structure Mode**
In this mode, trend bias is derived from **pivot highs and lows**:
* When price breaks above a recent pivot high, the bias flips to **bullish (+1)**.
* When price breaks below a recent pivot low, the bias flips to **bearish (-1)**.
This approach is more structurally oriented and reacts to significant swing breaks rather than just moving-average style relationships.
If no clear condition is met, the internal bias can temporarily be neutral, though the main design assumes working with clearly bullish or bearish environments.
3. Pullback and Reversal Pressure Logic
Once the trend bias is defined, the indicator measures **pullback intensity** against that trend:
* A **lookback window (“Pullback Length”)** scans recent highs and lows:
* In an uptrend, it tracks the **highest high** over the window and measures how far the current low pulls back from that high.
* In a downtrend, it tracks the **lowest low** and measures how far the current high bounces up from that low.
* This distance is converted into a **“reversal pressure” value**:
* In a bullish bias, deeper pullbacks (lower lows relative to the recent high) indicate stronger counter-trend pressure.
* In a bearish bias, stronger rallies (higher highs relative to the recent low) indicate stronger counter-trend pressure.
The raw reversal pressure is then smoothed with a long-term moving average to separate normal retracements from **statistically significant extremes**.
4. Thresholds and Histogram Coloring
To avoid reacting to every minor pullback, the indicator builds a **dynamic threshold** using a combination of:
* Long-term averages of reversal pressure.
* Standard deviation of reversal pressure.
* High-percentile values of reversal behavior over different sample sizes.
From this, a **threshold line** is derived, and the script then compares the current reversal pressure to this adaptive level:
* The **Reversal Histogram** (column plot) represents the excess reversal pressure above its own long-term average.
* When:
* There is a valid bullish or bearish bias, and
* The histogram is above the dynamic threshold,
the bars of the histogram are **colored**:
* Blue (or a similar “positive” color) in bullish bias.
* Red/pink (or a similar “negative” color) in bearish bias.
* When reversal pressure is below threshold or bias is not relevant, the histogram remains **neutral gray**.
These colored histogram segments represent **“high-tension” pullback states**, where counter-trend pressure has reached an extreme that, historically, often resolves with the original trend continuing rather than fully reversing.
5. Continuation Level and Bar Coloring on Price Chart
To connect the oscillator logic back to the chart:
* A **continuation reference level** is computed on the price series:
* In an uptrend, this is derived by subtracting the threshold from recent highs.
* In a downtrend, it is derived by adding the threshold to recent lows.
* This level is plotted as a **line on the price chart** (only when the trend bias is stable), acting as a visual guide for:
* Potential continuation zones,
* Possible stop-placement or invalidation areas,
* Or filters for entries/exits.
The bars are then **colored** when price crosses or interacts with these levels in the direction of the trend:
* In a bullish bias, bars closing below the continuation level can be highlighted as potential **deep pullback/continuation opportunities** or as warning signals, depending on the user’s playbook.
* In a bearish bias, bars closing above the continuation level are similarly highlighted.
This makes it easy to see where the oscillator’s “extreme pullback” conditions align with structural movements on the actual price bars.
6. Embedded Win-Rate Estimation (WR Table)
The script also includes an internal **win-rate style metric (WR%)** displayed in a small table on the chart:
* It tracks occurrences where:
* A valid bullish or bearish bias is present, and
* The Reversal Histogram is **above the threshold** (i.e., histogram is colored).
* It then approximates the **probability that the trend bias does not change** following such high-pressure pullback events.
* The WR value is shown as a percentage and represents, in essence, the **historical trend-continuation rate** under these specific conditions over the most recent sample of events.
This is not a formal statistical test and does not guarantee future performance, but it provides a quick visual indication of how often these continuation setups have led to **trend persistence** in the recent past.
7. How to Use in Practice
Typical applications include:
Trend-following entries on pullbacks
Identify the main trend using either RVWAP or Market Structure mode.
Wait for a colored histogram bar (reversal pressure above threshold).
Use the continuation reference line and bar coloring on the price chart to refine entry zones or invalidation levels.
Filtering signals from other systems
Run the indicator in the background to confirm trend continuation conditions before taking signals from another strategy (e.g., breakouts or momentum entries).
Only act on long signals when the bias is bullish and a high-pressure pullback has recently occurred; similarly for short signals in bearish conditions.
Risk management and trend monitoring
Monitor when reversal pressure is building against your current position.
Use shifts in bias combined with high reversal pressure to re-evaluate or scale out of trend-following trades.
Recommended steps:
1. Choose your Trend Mode:
- RVWAP for smoother, regime-style trend detection.
- Market Structure for swing-based structural changes.
2. Adjust Trend Length and Pullback Length to match your timeframe (shorter for intraday, longer for swing/position trading).
3. Observe where histogram colors appear and how price reacts around the continuation line and highlighted bars.
4. Integrate these signals into a pre-defined trading plan with clear entry, exit, and risk rules.
8. Limitations and Disclaimer
* This tool is a **technical analysis aid**, not a complete trading system.
* Past behavior of trend continuation or reversal pressure does **not** guarantee future results.
* The embedded WR metric is a **descriptive statistic** based on recent historical conditions only; it is not a promise of performance or a robust statistical forecast.
* All parameters (lengths, thresholds, modes) are user-configurable and should be **tested and validated** on your own data, instruments, and timeframes before any live use.
Disclaimer
This indicator is provided for informational and educational purposes only and does not constitute financial, investment, or trading advice. Trading and investing in financial markets involve substantial risk, including the possible loss of all capital. You are solely responsible for your own trading decisions and for evaluating all information provided by this tool. OmegaTools and the author of this script expressly disclaim any liability for any direct or indirect loss resulting from the use of this indicator. Always consult with a qualified financial professional before making any investment decisions.
Script de código abierto
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Exención de responsabilidad
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.
Script de código abierto
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Exención de responsabilidad
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.