PROTECTED SOURCE SCRIPT

Financial Earthquakes, LPPLS

139
Concept Overview

Sornette (ETH Zurich) pioneered the Log-Periodic Power Law Singularity (LPPLS) model, drawing a profound analogy between financial crashes and physical ruptures/earthquakes. In this framework, speculative bubbles exhibit super-exponential price growth (power-law acceleration toward a critical time tₚ) decorated by accelerating log-periodic oscillations — signatures of herding behavior and hierarchical feedback loops among investors. These "financial earthquakes" often end in regime changes: crashes (positive bubbles) or sharp rebounds (negative bubbles). This indicator provides a practical adaptation of Sornette's core ideas, without requiring complex nonlinear fitting on rolling windows.

Components

Multi-scale Local Hurst Exponent (m): Approximates the power-law exponent in the LPPLS model.
A rough local proxy for the exponent m is computed on five different lookback periods (default: 5, 14, 30, 70, 140 bars) using the relation:
local H ≈ (log(range) − log(ATR)) / log(period)
The average of these five values serves as a dynamic estimate of the bubble's "super-exponentiality" (persistent trending behavior when H > 0.5).
Log-Periodic Oscillation Term:
C1 × t^H × (1 + C2 × cos(ω × log(t) + φ))
where t is distance from an arbitrary recent reference point. This introduces the characteristic log-periodic "ripples" that accelerate as the hypothetical critical time approaches.
DSI Hurst (0–100 oscillator):
The raw LPPLS-inspired series is dynamically scaled over a 100-bar lookback into a bounded 0–100 range (similar to a stochastic or RSI).
≈ 50 → neutral / random-walk regime
87 → extreme super-exponential + log-periodic pressure (potential positive bubble / end-of-rally critical point)
< 13 → extreme anti-persistent pressure (potential negative bubble / end-of-bear critical point)

Visual Elements

Red line: DSI Hurst oscillator (0–100)
Horizontal lines at 13, 50, 87
Bar coloring: fuchsia when DSI > 87 (bubble warning), yellow when DSI ≈ 0 (extreme tightening)
Circle shapes at the top → potential critical point (DSI extreme + Hurst consistent across scales + ongoing log-periodic ripples) — analogous to Sornette's "financial earthquake" warning
Circle shapes at the bottom → potential critical pullback / regime shift in the opposite direction

Usage

High DSI Hurst (especially > 87) with confirming circle → increasing probability of an imminent regime change (often a crash after a bubble).
Low DSI Hurst (especially < 13) with confirming circle → potential sharp rebound after a negative bubble.
The indicator works on any timeframe and asset class (stocks, indices, crypto, forex) where herding and positive-feedback dynamics can appear.

*Default values (periods) optimized for SPX.

Notes

This is an interpretation of Sornette's LPPLS theory adapted for Pine Script limitations. It does not perform full nonlinear LPPLS calibration (which requires heavy optimization and is used in academic confidence/trust indicators). It captures the spirit: multi-scale persistence + log-periodic component → early warning of critical transitions.
Combine with price action, volume, fundamentals or any other form of analysis, and risk management.
No indicator predicts crashes with certainty — it only highlights periods where the market structure resembles the pre-crisis patterns repeatedly documented in Sornette's research (1987, 2000, 2008, 2015 China, Bitcoin, etc.).

Disclaimer

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.