PROTECTED SOURCE SCRIPT

Crypto Narratives Performance [SwissAlgo]

47
Crypto Narratives Performance Index [SwissAlgo]

--------------------------------------------------------
What this indicator is

This script displays a relative performance index that compares the market capitalization trends of various crypto categories (narratives) against a selected 'Base asset' (BTC, ETH, or SOL) over a configurable rolling time window (default: 14-day).

It’s designed to help users observe sector rotation dynamics across the crypto ecosystem — such as whether DeFi is outperforming ETH, or if AI coins are underperforming relative to BTC.

--------------------------------------------------------
What it does

This indicator measures the percentage change in total market cap of a selected crypto sector over a user-defined lookback period, and compares it to the percentage change in market cap of a chosen base asset over the same period. The result is expressed as a ratio and transformed into a z-score, normalized over the last 180 bars. This allows the user to easily identify whether the sector is outperforming or underperforming the base asset in relative terms.

It also includes a smoothed signal line, a performance table, and marked background zones (levels of standard deviations) to help interpret potential extremes in sector outperformance or underperformance.

--------------------------------------------------------
How it works

  1. It retrieves daily market capitalization data for both the selected base asset and sector from TradingView's CRYPTOCAP: data feed.
  2. It computes the percent change in $ market cap over one of the following selectable periods: 1, 3, 7, 14, 30, or 60 days (14-day is the default).
  3. The percentage change of the base is subtracted from the percentage change of the sector, producing a raw relative performance differential.
  4. This differential is then normalized into a Z-Score, using a 180-day rolling mean and standard deviation.
  5. The Z-Score is smoothed using an exponential moving average (EMA), and plotted against a secondary EMA signal line (to track potential performance trend changes).

A visual table compares the performance of all listed sectors against the selected base, ranked and annotated with basic symbols (stars for performance, alerts for underperformance vs. the selected 'Base Asset', i.e. BTC or ETH or SOL).

--------------------------------------------------------
Visual Features

* Color-coded plot line: Turns green, yellow, orange, or red based on zone and momentum.
* Signal line: Gray EMA of the z-score for trend comparison.
* Background fill zones:
  • ±3 = "Extreme" outperform/underperform
  • ±2 to ±3 = "Strong" zone
  • ±1 to ±2 = Mild over/underperformance
  • ±1 to -1 = Neutral performance range

* Dynamic Table:
  • Displays all sector vs. base performance differences.
  • Highlights the selected comparison sector.
  • Uses emojis (⭐/⚠️) for relative status at a glance.


--------------------------------------------------------
Who may benefit

This script may assist:
  • Crypto analysts tracking capital rotation across narratives.
  • Swing traders looking to spot momentum trends in crypto sectors.
  • Portfolio allocators observing which groups are leading or lagging relative to majors (BTC, ETH, SOL).
  • Developers or researchers evaluating sentiment shifts across categories (e.g., AI tokens rising vs. DeFi).

It is not a buy/sell signal tool — it's a sector/crypto narratives -relative monitor.

--------------------------------------------------------
Key Applications

  • Detect sector rotation (e.g., when Layer 1s start to outperform ETH, or BTC/SOL).
  • Monitor if certain categories are experiencing sustained interest or fading momentum.
  • Compare the strength of emerging narratives like DePIN, RWA, or World Liberty vs. majors.
  • Identify possible "mean-reversion" setups when a sector is excessively stretched relative to its historical norm.


--------------------------------------------------------
Limitations

  • Data dependency: All calculations rely on TradingView’s CRYPTOCAP: market cap feeds.
  • Normalization window: The z-score normalization is static at 180 bars; in choppy markets this may over-smooth or underreact.
  • Asset inclusion: The sectors reflect predefined index aggregates. Not all coins in a category may be equally weighted or relevant.
  • Lag: EMA smoothing introduces delay in reactive plotting.
  • No intra-day support: Works best on daily timeframes, as CRYPTOCAP: feeds are daily-only.
  • Not predictive: This script reflects past capital flows. It does not forecast future price moves.


--------------------------------------------------------
Customization

Users can adjust the following:
  • Base asset: BTC, ETH, SOL
  • Crypto sector (comparison): Choose from 11+ sectors, including DeFi, AI, Memes, Layer 1, etc.
  • Rolling performance period: Choose between 1–60 days.
  • Smoothing settings: Length of the EMA for the ratio and signal line.
  • Show/hide info table: Useful for screen space management.


Special Notes:
Please set the chart timeframe at 1-day in line with CRYPTOCAP data availability.
Please select the dark color scheme to view table and colors properly.

--------------------------------------------------------
Risk Disclaimer

This indicator is for informational and educational purposes only. It does not constitute financial advice, trading advice, or an invitation to engage in any financial strategy. Always conduct your own due diligence before making investment decisions. Use at your own risk.

Market conditions may shift rapidly, and past sector performance is not necessarily indicative of future outcomes. This tool is best used as part of a broader analytical framework, not in isolation.

Protected script: source code is hidden to preserve logic integrity and prevent tampering.

If you need clarification or encounter unexpected behavior with data feeds, please check the TradingView Help Center or post in the "Indicators and Strategies" section of the TradingView community.

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。