OPEN-SOURCE SCRIPT

Specter Trend Cloud [ChartPrime]

2 574
⯁ OVERVIEW
Specter Trend Cloud [ChartPrime] is a flexible moving-average–based trend tool that builds a colored “cloud” around market direction and highlights key retest opportunities. Using two adaptive MAs (short vs. long), offset by ATR for volatility adjustment, it shades the background with a gradient cloud that switches color on trend flips. When price pulls back to retest the short MA during an active trend, the script plots diamond markers and extends dotted levels from that retest price. If price later breaks through that level, the extension is terminated—giving traders a clean visual of valid vs. invalid retests.

⯁ KEY FEATURES
  • Multi-MA Core Engine:
    Choose from SMA, EMA, SMMA (RMA), WMA, or VWMA as the base. The indicator tracks both a short-term MA (Length) and a longer twin (2 × Length).

  • Volatility-Adjusted Offset:
    Both MAs are shifted by ATR(200) depending on trend direction—pulling them down in uptrends, up in downtrends—so the cloud reflects realistic breathing room instead of razor-thin bands.

  • Gradient Trend Cloud:
    Between the two shifted MAs, the script fills a shaded region:
    Aqua cloud = bullish trend
    Orange cloud = bearish trend
    Gradient intensity increases toward the active edge, providing a visual sense of strength.

  • Trend Flip Logic:
    A flip occurs whenever the short MA crosses above or below the long MA. The cloud instantly changes color and begins tracking the new regime.
    Snapshot
  • Retest Detection:
    During an ongoing trend (no flip), if price retests the short MA within a 5-bar “cooldown,” the tool:
    • Marks the retest with diamond shapes below/above the bar.
    • Draws a dotted horizontal line from the retest price, extending into the future.
    Snapshot
  • Automatic Level Termination:
    If price later closes through that dotted level, the line disappears—keeping only active, respected retest levels on your chart.
    Snapshot


⯁ HOW IT WORKS (UNDER THE HOOD)
  • MA Calculations:
    ma1 = MA(src, Length), ma2 = MA(src, 2 × Length).
    Trend = ma1 > ma2 (bull) or ma1 < ma2 (bear).
    ATR shift offsets both ma1 and ma2 by ±ATR depending on trend.

  • Cloud Fill:
    Plots ma1 and ma2 (invisible for long MA). Uses fill() with semi-transparent aqua/orange gradient between the two.

  • Retest Logic:
    Bullish retest: ta.crossover(low, ma1) while trend = bull.
    Bearish retest: ta.crossunder(high, ma1) while trend = bear.
    Only valid if at least 5 bars have passed since last retest.
    When triggered, it stores bar index and price, draws diamonds, and extends a dotted line.

  • Level Clearing:
    If current high > retest upper line (bearish case) or low < retest lower line (bullish case), that line is deleted (stops extending).


⯁ USAGE
  • Use the cloud color as the higher-level trend bias (aqua = long, orange = short).
  • Look for diamonds + dotted lines as pullback/retest zones where trend continuation may launch.
  • If a retest level holds and price rebounds, it strengthens confidence in the trend.
  • If a retest level is broken, treat it as a warning of weakening trend or possible reversal.
  • Experiment with MA Type (SMA vs. EMA, etc.) to align sensitivity with your asset or timeframe.
  • Adjust Length for faster flips on low timeframes or smoother signals on higher ones.


⯁ CONCLUSION
Specter Trend Cloud combines trend detection, volatility-adjusted shading, and retest visualization into a single tool. The gradient cloud provides instant clarity on direction, while diamonds and dotted retest levels give you tactical entry/retest zones that self-clean when invalidated. It’s a versatile trend-following and confirmation layer, adaptable across multiple assets and styles.

Haftungsausschluss

Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.