OPEN-SOURCE SCRIPT
Trend Survival Matrix

Most trend tools tell you which way the trend is going, but not how late you are in it. The Trend Survival Matrix answers that directly. It tracks the live trend across three timescales (short, medium, and long EMA regimes) and measures each one's age — the number of bars since it last flipped. Then, from every completed trend in the chart's history, it builds an empirical run-length distribution and estimates a conditional survival probability: the odds the current trend lasts at least 5, 10, or 20 more bars given how long it has already run. Crucially, those odds are conditioned on the volatility regime each historical run was born in (low / normal / high ATR-percentile buckets), so a long, calm trend isn't judged against runs that formed in chaotic conditions.
The panel reads left to right: direction, current age, the typical (median) run length for that regime, survival odds at each horizon, and a maturity state — FRESH, HEALTHY, MATURING, EXTENDED, or EXHAUSTION — driven by an overextension z-score (how many standard deviations the current age sits above the historical mean). On the chart, a ribbon between the primary EMA pair tints by direction and fades as survival decays, so a durable trend looks solid while a fragile, overextended one visibly thins out. Markers flag new trends, and a once-per-run label warns when survival drops below your threshold — useful for deciding whether to add, tighten stops, or prepare to fade.
Everything is empirical and inspectable — the survival figures come straight from the instrument's own history, not a black box or preset numbers. The engine is fully non-repainting (state advances only on confirmed bars, with no higher-timeframe requests), so the readings stay stable when you switch chart timeframes. Where there aren't enough historical samples to condition on, the panel honestly reports LOW DATA and a confidence flag rather than showing a made-up probability. Works on any symbol and timeframe; tune the EMA lengths, horizons, and volatility buckets to your market.
The panel reads left to right: direction, current age, the typical (median) run length for that regime, survival odds at each horizon, and a maturity state — FRESH, HEALTHY, MATURING, EXTENDED, or EXHAUSTION — driven by an overextension z-score (how many standard deviations the current age sits above the historical mean). On the chart, a ribbon between the primary EMA pair tints by direction and fades as survival decays, so a durable trend looks solid while a fragile, overextended one visibly thins out. Markers flag new trends, and a once-per-run label warns when survival drops below your threshold — useful for deciding whether to add, tighten stops, or prepare to fade.
Everything is empirical and inspectable — the survival figures come straight from the instrument's own history, not a black box or preset numbers. The engine is fully non-repainting (state advances only on confirmed bars, with no higher-timeframe requests), so the readings stay stable when you switch chart timeframes. Where there aren't enough historical samples to condition on, the panel honestly reports LOW DATA and a confidence flag rather than showing a made-up probability. Works on any symbol and timeframe; tune the EMA lengths, horizons, and volatility buckets to your market.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
Institutional-desk · 10+ yrs building trading algos
Syndicate Ultimate · 4 systems · 1 bundle
· 1 payment · lifetime access
Gold · FX · NQ/ES · private systems
syndicate001.com
TG channel
t.me/aisyndicate001
Syndicate Ultimate · 4 systems · 1 bundle
· 1 payment · lifetime access
Gold · FX · NQ/ES · private systems
syndicate001.com
TG channel
t.me/aisyndicate001
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
Institutional-desk · 10+ yrs building trading algos
Syndicate Ultimate · 4 systems · 1 bundle
· 1 payment · lifetime access
Gold · FX · NQ/ES · private systems
syndicate001.com
TG channel
t.me/aisyndicate001
Syndicate Ultimate · 4 systems · 1 bundle
· 1 payment · lifetime access
Gold · FX · NQ/ES · private systems
syndicate001.com
TG channel
t.me/aisyndicate001
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.