OPEN-SOURCE SCRIPT
Jack and Jill

I. LIMITATIONS OF TRADITIONAL MOVING AVERAGES
Traditional moving averages (SMA, EMA, WMA) serve as foundational market tools, but they exhibit specific mathematical constraints when applied to highly volatile data:
Lag: By inherently averaging historical data, they naturally trail the current market state.
Aliasing (Cyclic Contamination): They often struggle to distinguish between underlying macro trends and temporary cyclical market waves, which can result in whipsaws and delayed signals.
To address these challenges and more accurately model continuous-time price movement, advanced Digital Signal Processing (DSP) can be deployed as an alternative framework.
II. THE DUAL-STATE SOLUTION
John Ehlers' "Jack and Jill" concept separates the market data into two distinct components. Instead of blending short-term fluctuations and long-term trends into a single average, they are isolated using specialized mathematical models:
► JACK: A fast, low-lag price tracker.
► JILL: A slower trend line, filtered to remove cyclical noise.
III. JACK: THE FAST PRICE TRACKER
The Mechanism: A 2nd-Order Infinite Impulse Response (IIR) SuperSmoother.
The Execution: Jack tracks short-term price movements. By applying a 2nd-order SuperSmoother, Jack efficiently filters out high-frequency noise and erratic intraday price spikes. It follows the price closely with minimal lag, providing a clearer view of the immediate trend direction.
IV. JILL: THE TREND DECYCLER$$
The Mechanism: A 2-Pole High-Pass Decycler coupled with smoothing.
The Execution: Instead of standard averaging, Jill uses a 2-Pole High-Pass filter to identify the market's dominant cycle and subtracts that cyclic data from the price to isolate the broader macroeconomic trend. A half-length SuperSmoother is then applied to stabilize the output, resulting in a smooth baseline that minimizes temporary cyclical fluctuations.
V. THE PHASE CONVERGENCE OSCILLATOR (PCO)
The Mechanism: Momentum Divergence.
The Execution: While Jack and Jill map the spatial topology on the primary chart, the Phase Convergence Oscillator (PCO) operates in a decoupled, isolated matrix. It measures the exact delta (Jack - Jill) and tracks its momentum.
Expanding Delta: The trend is structurally intact and accelerating.
Contracting Delta: Trend momentum is decelerating, which may serve as an early indication of exhaustion before Jack actually crosses Jill.
VI. TOPOLOGICAL GRADIENT RENDERING
The space between Jack and Jill represents the maturity of the trend. The visual matrix applies a 6-stage continuous opacity gradient—highly transparent at the edge of Jack (where price is volatile and untested) and reaching maximum density as it anchors onto Jill (the established structural core).
VII. CONCLUSION
The Jack and Jill indicator is designed as a continuous-time convergence engine rather than a conventional crossover tool. When the PCO accelerates and Jack crosses the structural decycler, a potential phase shift is identified.
This framework represents a rigorous application of signal processing techniques to financial trend analysis.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.