OPEN-SOURCE SCRIPT
QSX Crypto Bottom & Top Risk Radar

QSX Crypto Bottom & Top Risk Radar
An open-source risk-state radar for crypto. It answers one question: is the crowd at an exhaustion extreme right now — near a washed-out bottom, or a crowded top? It is a market-context tool, not a trading system, and it does not size positions.
HOW IT WORKS
All logic is visible in the source. Three building blocks:
1. Crowd gauge (the core). Binance BTC perpetual Long/Short Ratio (accounts), pulled via TradingView's Request library, ranked as a percentile over the past 365 daily bars. The absolute ratio drifts across market regimes, so the radar always reads it relative to its own trailing year:
- below the 10th percentile — the long crowd is washed out (capitulation pressure, historically a bottoming condition);
- above the 80th percentile — longs are crowded;
- above the 90th percentile — crowding is extreme.
2. Chart context filter. A 0-100 trend/volatility gauge built from the SMA200 trend state (price above/below + slope) blended with a normalized ATR(14) volatility rank over the last 100 bars, smoothed over 5 days. Its 3-day direction decides whether conditions are improving or fading. Top-risk states additionally require ADX(14) >= 20, so the radar stays quiet in directionless chop instead of calling tops in flat markets.
3. States. Crowd extremes and chart context combine into: BOTTOM (crowd washed out, or washed out and already recovering), CALM (no extreme), TOP RISK (crowded longs plus fading trend), and HIGH RISK (extreme crowding plus fading trend and momentum). A marker cooldown collapses each episode into sparse markers so one episode prints one readable signal instead of a cluster.
DASHBOARD
The panel shows a 0-100 crowd-exhaustion score (distance from neutral positioning, direction-aware), the current state, a heat bar, a one-line conclusion, and the raw BTC crowd percentile so you can see how close conditions are to the thresholds before anything fires.
HISTORICAL CASE LABELS
"Bottom-to-high +X%" and "Risk-off case -X% DD" labels annotate what actually followed past radar states, measured to the best/worst extreme reached afterwards. They keep updating while an episode is running, so treat them as retrospective illustrations of past cases — not performance claims, probabilities, or expectations.
HOW TO USE IT
- Daily charts only; the radar checks the timeframe and asks you to switch if needed. States are confirmed at the daily close — set alerts to "Once Per Bar Close".
- The crowd gauge always comes from BTC perp Long/Short accounts, even on an altcoin chart; only the trend/volatility context comes from the chart symbol. Read states as BTC-market-wide conditions.
- Typical use: as a regime filter on top of your own process — e.g. tighten risk when TOP/HIGH RISK is active, and treat BOTTOM states as environments where capitulation is historically present, not as automatic buy signals.
LIMITATIONS
- Long/Short Ratio history starts around 2020 and the percentile needs about a year of warm-up, so states begin printing from roughly 2021.
- Bottom states can appear early in extended downtrends and persist while price keeps falling; crowd exhaustion marks conditions, not exact turning points.
- No position sizing, no portfolio advice, no guarantees. Educational information only, not financial advice. Crypto is volatile — never risk money you cannot afford to lose.
An open-source risk-state radar for crypto. It answers one question: is the crowd at an exhaustion extreme right now — near a washed-out bottom, or a crowded top? It is a market-context tool, not a trading system, and it does not size positions.
HOW IT WORKS
All logic is visible in the source. Three building blocks:
1. Crowd gauge (the core). Binance BTC perpetual Long/Short Ratio (accounts), pulled via TradingView's Request library, ranked as a percentile over the past 365 daily bars. The absolute ratio drifts across market regimes, so the radar always reads it relative to its own trailing year:
- below the 10th percentile — the long crowd is washed out (capitulation pressure, historically a bottoming condition);
- above the 80th percentile — longs are crowded;
- above the 90th percentile — crowding is extreme.
2. Chart context filter. A 0-100 trend/volatility gauge built from the SMA200 trend state (price above/below + slope) blended with a normalized ATR(14) volatility rank over the last 100 bars, smoothed over 5 days. Its 3-day direction decides whether conditions are improving or fading. Top-risk states additionally require ADX(14) >= 20, so the radar stays quiet in directionless chop instead of calling tops in flat markets.
3. States. Crowd extremes and chart context combine into: BOTTOM (crowd washed out, or washed out and already recovering), CALM (no extreme), TOP RISK (crowded longs plus fading trend), and HIGH RISK (extreme crowding plus fading trend and momentum). A marker cooldown collapses each episode into sparse markers so one episode prints one readable signal instead of a cluster.
DASHBOARD
The panel shows a 0-100 crowd-exhaustion score (distance from neutral positioning, direction-aware), the current state, a heat bar, a one-line conclusion, and the raw BTC crowd percentile so you can see how close conditions are to the thresholds before anything fires.
HISTORICAL CASE LABELS
"Bottom-to-high +X%" and "Risk-off case -X% DD" labels annotate what actually followed past radar states, measured to the best/worst extreme reached afterwards. They keep updating while an episode is running, so treat them as retrospective illustrations of past cases — not performance claims, probabilities, or expectations.
HOW TO USE IT
- Daily charts only; the radar checks the timeframe and asks you to switch if needed. States are confirmed at the daily close — set alerts to "Once Per Bar Close".
- The crowd gauge always comes from BTC perp Long/Short accounts, even on an altcoin chart; only the trend/volatility context comes from the chart symbol. Read states as BTC-market-wide conditions.
- Typical use: as a regime filter on top of your own process — e.g. tighten risk when TOP/HIGH RISK is active, and treat BOTTOM states as environments where capitulation is historically present, not as automatic buy signals.
LIMITATIONS
- Long/Short Ratio history starts around 2020 and the percentile needs about a year of warm-up, so states begin printing from roughly 2021.
- Bottom states can appear early in extended downtrends and persist while price keeps falling; crowd exhaustion marks conditions, not exact turning points.
- No position sizing, no portfolio advice, no guarantees. Educational information only, not financial advice. Crypto is volatile — never risk money you cannot afford to lose.
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.
📊 Crypto & Macro Quant Research
🛠️ Free Strategy Scorer: github.com/jianweiweng05/qsx-strategy-score
🌐 Advanced Overlays: quantscopex.com/tools
🔬 More Research: quantscopex.com/research
🛠️ Free Strategy Scorer: github.com/jianweiweng05/qsx-strategy-score
🌐 Advanced Overlays: quantscopex.com/tools
🔬 More Research: quantscopex.com/research
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.
📊 Crypto & Macro Quant Research
🛠️ Free Strategy Scorer: github.com/jianweiweng05/qsx-strategy-score
🌐 Advanced Overlays: quantscopex.com/tools
🔬 More Research: quantscopex.com/research
🛠️ Free Strategy Scorer: github.com/jianweiweng05/qsx-strategy-score
🌐 Advanced Overlays: quantscopex.com/tools
🔬 More Research: quantscopex.com/research
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.