OPEN-SOURCE SCRIPT
Hawkes Branching [N4]

hawkes branching [n4] — the math under crashes.
every crash has the same internal shape. each large move increases the chance of the next, the kernel sustains itself, then it does not. this indicator plots the line.
what it does
λ_t is the asset's own self-exciting intensity, recursive and bounded. when the kernel α·exp(-β·t) sustains itself, the branching ratio η = α/β crosses 1 — the regime moves from stable to explosive. plotted as a histogram + threshold band at η = 1 (the bifurcation line, dashed white).
multi-timeframe coupling on D / W / M, with the canonical non-repaint idiom (request.security on [1] offset, lookahead_on). most TV Hawkes scripts repaint the realtime higher-TF bar; this one does not.
regime states
inputs
reference
Bacry, Mastromatteo, Muzy 2015 — "Hawkes processes in finance" (Market Microstructure & Liquidity vol. 1).
open source. educational. NFA. the code does not solve the risk, it names it.
every crash has the same internal shape. each large move increases the chance of the next, the kernel sustains itself, then it does not. this indicator plots the line.
what it does
λ_t is the asset's own self-exciting intensity, recursive and bounded. when the kernel α·exp(-β·t) sustains itself, the branching ratio η = α/β crosses 1 — the regime moves from stable to explosive. plotted as a histogram + threshold band at η = 1 (the bifurcation line, dashed white).
multi-timeframe coupling on D / W / M, with the canonical non-repaint idiom (request.security on [1] offset, lookahead_on). most TV Hawkes scripts repaint the realtime higher-TF bar; this one does not.
regime states
- ESPERAR / wait — η stable, λ low (secondary color)
- ATENCION / attention — λ rising, η near 1 (primary lighter)
- REGIMEN / regime — λ explosive OR η > 1 (primary intense)
inputs
- α (jump magnitude): default 0.6, sensible range 0.3 to 1.0
- β (decay rate): default 1.2, sensible range 0.5 to 3.0
- exceedance percentile: default 90, can tune to 95 for quieter assets
- lookback: 252 trading days
- idioma / language: es | en (deck labels toggle)
reference
Bacry, Mastromatteo, Muzy 2015 — "Hawkes processes in finance" (Market Microstructure & Liquidity vol. 1).
open source. educational. NFA. the code does not solve the risk, it names it.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.