OPEN-SOURCE SCRIPT
ที่อัปเดต:

Market Breadth - [JTCAPITAL]

150
Market Breadth - [JTCAPITAL] is a comprehensive crypto market strength and sentiment indicator designed to visualize the overall bullish or bearish alignment across 40 major cryptocurrencies. By combining multi-asset Exponential Moving Average (EMA) comparisons and smoothing techniques, it offers a clean, aggregated view of the broader market trend—helping traders quickly assess whether the market is dominated by bullish momentum or bearish pressure.

The indicator works by calculating in the following steps:

  1. Symbol Selection and Data Retrieval
    The script monitors 40 leading cryptocurrencies based on Market Cap. Each asset’s daily close price is requested using a 1D timeframe. This ensures that every data point reflects the same temporal resolution, allowing the indicator to evaluate global crypto strength rather than individual token volatility.

  2. EMA Comparison per Asset
    For each asset, two Exponential Moving Averages (EMAs) are calculated:

    A short-term EMA with period emalength (default 10).

    A long-term EMA with period emalength2 (default 20).

    Each coin receives a score of +1 when the short-term EMA is greater than the long-term EMA (indicating bullish structure), or -1 when it is below (indicating bearish structure). This binary scoring system effectively converts individual price action into a directional sentiment measure.

  3. Market Breadth Aggregation
    All 40 individual scores are summed into a single composite value called scores.

    If many assets have bullish EMA alignment, the total score becomes strongly positive.

    If the majority show bearish alignment, the total score turns negative.

    This step transforms scattered price data into one unified market breadth metric—quantifying how many assets participate in the same directional trend.

  4. Smoothing the Breadth Line
    To reduce short-term noise and isolate trend direction, the aggregated score is smoothed using an EMA of length = smoothlen (default 15). The resulting smoothed line helps identify sustained shifts in collective sentiment rather than temporary fluctuations.

  5. Visualization and Color Coding

    When scores > 0, the market breadth is bullish and the histogram is colored blue.

    When scores < 0, the breadth turns bearish and the histogram is purple.
    The same logic applies to the smoothed line and background color, offering an instant visual cue of market mood transitions.


Buy and Sell Conditions:
The indicator itself does not trigger direct buy/sell signals but rather acts as a market regime filter. Traders can use it as follows:

Buy Filter: When the smoothed value is above zero and rising, the majority of assets confirm an uptrend — this favors long setups or trend continuation entries.

Sell Filter: When the smoothed value is below zero and falling, bearish alignment dominates — ideal for short setups or defensive risk management.

Optional filters could include combining this with RSI or volume-weighted momentum indicators to confirm breadth-based reversals.

Features and Parameters:

emalength – Defines the short-term EMA length used for individual asset trend detection (default 10).

emalength2 – Defines the long-term EMA length (default 20).

smoothlen – Defines the smoothing EMA length for the total market breadth line (default 15).

40 asset inputs – User-editable symbols allow full customization of which cryptos are tracked.

Dynamic color backgrounds – Visual distinction between bullish and bearish phases.


Specifications:

Exponential Moving Average (EMA)
EMA is a type of moving average that places more weight on recent price data, responding faster to market changes compared to SMA. By comparing a short-term and long-term EMA, the indicator captures momentum shifts across each asset individually. The crossover logic (EMA10 > EMA20) signals bullish conditions, while the opposite indicates bearish momentum.

Market Breadth
Market Breadth quantifies how many assets are participating in a directional move. Instead of tracking a single coin’s trend, breadth analysis measures collective sentiment. When most coins’ short-term EMAs are above long-term EMAs, the market shows healthy bullish breadth. Conversely, when most are below, weakness dominates.

Smoothing (EMA on Scores)
After summing the breadth score, the result is smoothed with an additional EMA to mitigate the inherent volatility caused by individual coin reversals. This second-level smoothing transforms raw fluctuations into a readable, trend-consistent curve.

Color Visualization
Visual cues are integral for intuitive interpretation.

Blue Shades: Indicate bullish alignment and collective upward momentum.

Purple Shades: Indicate bearish conditions and potential risk-off phases.
The background tint reinforces visual clarity even when the indicator is overlaid on price charts.

Background Logic
By applying the same color logic to the chart’s background, users can instantly recognize the prevailing market phase.

Use Cases

As a trend confirmation filter for other indicators (e.g., trade only in the direction of positive breadth).

As a divergence tool: when price rises but breadth weakens, it may signal a topping market.

As a macro sentiment monitor: perfect for assessing when the crypto market as a whole transitions from bearish to bullish structure.

Summary
Market Breadth - [JTCAPITAL]” transforms the chaotic price movements of 40 cryptocurrencies into a single, powerful visual representation of overall market health. By merging EMA cross analysis with market-wide aggregation and smoothing, it provides traders with a deep understanding of when bullish or bearish forces dominate the ecosystem.

It’s a clean, data-driven approach to identifying shifts in crypto market sentiment — a perfect companion for trend-following, macro analysis, and timing portfolio exposure.

Enjoy!
เอกสารเผยแพร่
Changed: Overlay = False

คำจำกัดสิทธิ์ความรับผิดชอบ

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.