OPEN-SOURCE SCRIPT
Dual-Phase Trend Regime Strategy [Zeiierman X PineIndicators]

This strategy is based on the Dual-Phase Trend Regime Indicator by Zeiierman.
Full credit for the original concept and logic goes to Zeiierman.
This non-repainting strategy dynamically switches between fast and slow oscillators based on market volatility, providing adaptive entries and exits with high clarity and reliability.
Core Concepts
1. Adaptive Dual Oscillator Logic
The system uses two oscillators:
The system automatically selects the appropriate oscillator depending on the market's volatility regime.
2. Volatility Regime Detection
Volatility is calculated using the standard deviation of returns. A median-split algorithm clusters volatility into:
The current volatility is then compared to these clusters to determine whether the regime is low or high volatility.
3. Trend Regime Identification
Based on the active oscillator:
The strategy reacts to changes in this trend regime.
4. Signal Source Options
You can choose between:
Trade Logic
Trade Direction Options
Entry Conditions
Exit Conditions
The strategy closes opposing positions before opening new ones.
Visual Features
Inputs & Customization
Use Cases
Conclusion
The Dual-Phase Trend Regime Strategy is a smart, adaptive, non-repainting system that:
This strategy is ideal for traders seeking a volatility-aware, trend-sensitive tool across any market or timeframe.
Full credit to Zeiierman.
Full credit for the original concept and logic goes to Zeiierman.
This non-repainting strategy dynamically switches between fast and slow oscillators based on market volatility, providing adaptive entries and exits with high clarity and reliability.
Core Concepts
1. Adaptive Dual Oscillator Logic
The system uses two oscillators:
- Fast Oscillator: Activated in high-volatility phases for quick reaction.
- Slow Oscillator: Used during low-volatility phases to reduce noise.
The system automatically selects the appropriate oscillator depending on the market's volatility regime.
2. Volatility Regime Detection
Volatility is calculated using the standard deviation of returns. A median-split algorithm clusters volatility into:
- Low Volatility Cluster
- High Volatility Cluster
The current volatility is then compared to these clusters to determine whether the regime is low or high volatility.
3. Trend Regime Identification
Based on the active oscillator:
- Bullish Trend: Oscillator > 0.5
- Bearish Trend: Oscillator < 0.5
- Neutral Trend: Oscillator = 0.5
The strategy reacts to changes in this trend regime.
4. Signal Source Options
You can choose between:
- Regime Shift (Arrows): Trade based on oscillator value changes (from bullish to bearish and vice versa).
- Oscillator Cross: Trade based on crossovers between the fast and slow oscillators.
Trade Logic
Trade Direction Options
- Long Only
- Short Only
- Long & Short
Entry Conditions
- Long Entry: Triggered on bullish regime shift or fast crossing above slow.
- Short Entry: Triggered on bearish regime shift or fast crossing below slow.
Exit Conditions
- Long Exit: Triggered on bearish shift or fast crossing below slow.
- Short Exit: Triggered on bullish shift or fast crossing above slow.
The strategy closes opposing positions before opening new ones.
Visual Features
- Oscillator Bands: Plots fast and slow oscillators, colored by trend.
- Background Highlight: Indicates current trend regime.
- Signal Markers: Triangle shapes show bullish/bearish shifts.
- Dashboard Table: Displays live trend status ("Bullish", "Bearish", "Neutral") in the chart’s corner.
Inputs & Customization
- Oscillator Periods – Fast and slow lengths.
- Refit Interval – How often volatility clusters update.
- Volatility Lookback & Smoothing
- Color Settings – Choose your own bullish/bearish colors.
- Signal Mode – Regime shift or oscillator crossover.
- Trade Direction Mode
Use Cases
- Swing Trading: Take entries based on adaptive regime shifts.
- Trend Following: Follow the active trend using filtered oscillator logic.
- Volatility-Responsive Systems: Adjust your trade behavior depending on market volatility.
- Clean Exit Management: Automatically closes positions on opposite signal.
Conclusion
The Dual-Phase Trend Regime Strategy is a smart, adaptive, non-repainting system that:
- Automatically switches between fast and slow trend logic.
- Responds dynamically to changes in volatility.
- Provides clean and visual entry/exit signals.
- Supports both momentum and reversal trading logic.
This strategy is ideal for traders seeking a volatility-aware, trend-sensitive tool across any market or timeframe.
Full credit to Zeiierman.
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。