OPEN-SOURCE SCRIPT

Cyclic Reversal Engine [AlgoPoint]

1 588
Overview

Most indicators focus on price and momentum, but they often ignore a critical third dimension: time. Markets move in rhythmic cycles of expansion and contraction, but these cycles are not fixed; they speed up in trending markets and slow down in choppy conditions.

The Cyclic Reversal Engine is an advanced analytical tool designed to decode this rhythm. Instead of relying on static, lagging formulas, this indicator learns from past market behavior to anticipate when the current trend is statistically likely to reach its exhaustion point, providing high-probability reversal signals.

It achieves this by combining a sophisticated time analysis with a robust price-action confirmation.


How It Works: The Core Logic

The indicator operates on a multi-stage process to identify potential turning points in the market.

1. Market Regime Analysis (The Brain): Before analyzing any cycles, the indicator first diagnoses the current "personality" of the market. Using a combination of the ADX, Choppiness Index, and RSI, it classifies the market into one of three primary regimes:
- Trending: Strong, directional movement.
- Ranging: Sideways, non-directional chop.
- Reversal: An over-extended state (overbought/oversold) where a turn is imminent.

2. Adaptive Cycle Learning (The "Machine Learning" Aspect): This is the indicator's smartest feature. It constantly analyzes past cycles by measuring the bar-count between significant swing highs and swing lows. Crucially, it learns the average cycle duration for each specific market regime. For example, it learns that "in a strong trending market, a new swing low tends to occur every 35 bars," while "in a ranging market, this extends to 60 bars."

3. The Countdown & Timing Signal: The indicator identifies the last major swing high or low and starts a bar-by-bar countdown. Based on the current market regime, it selects the appropriate learned cycle length from its memory. When the bar count approaches this adaptive target, the indicator determines that a reversal is "due" from a timing perspective.

4. Price Confirmation (The Trigger): A signal is never generated based on timing alone. Once the timing condition is met (the cycle is "due"), the indicator waits for a final price-action confirmation. The default confirmation is the RSI entering an extreme overbought or oversold zone, signaling momentum exhaustion. The signal is only triggered when Time + Price Confirmation align.


How to Use This Indicator

- The Dashboard: The panel in the bottom-right corner is your command center.
- Market Regime: Shows the current market personality analyzed by the engine.
- Adaptive Cycle / Bar Count: This is the core of the indicator. It shows the target cycle length for the current regime (e.g., 50) and the current bar count since the last swing point (e.g., 45). The background turns orange when the bar count enters the "due zone," indicating that you should be on high alert for a reversal.
- BUY/SELL Signals: A label appears on the chart only when the two primary conditions are met:

The timing is right (Bar Count has reached the Adaptive Cycle target).

The price confirms exhaustion (RSI is in an extreme zone).

A BUY signal suggests a downtrend cycle is likely complete, and a SELL signal suggests an uptrend cycle is likely complete.


Key Settings

- Pivot Lookback: Controls the sensitivity of the swing point detection. Higher values will identify more significant, longer-term cycles.
- Market Regime Engine: The ADX, Choppiness, and RSI settings can be fine-tuned to adjust how the indicator classifies the market's personality.
- Require Price Confirmation: You can toggle the RSI confirmation on or off. It is highly recommended to keep it enabled for higher-quality signals.

免責事項

これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。