OPEN-SOURCE SCRIPT

TGFA Flexible Alerts Multi-MA Crossovers

108
TGFA Flexible Alerts, Multi-MA Crossovers

Description
Flexible MA crossovers with BUY/SELL alerts, customizable candle colors, and an info box for ATR/volatility insights. Supports EMA/SMA/HMA/VWAP on any chart.

Overview
TGFA Flexible Alerts is a versatile Pine Script indicator for traders seeking customizable moving average (MA) crossovers, visual signals, and quick-reference metrics. It overlays crossover lines (e.g., fast EMA over slow SMA), generates BUY/SELL labels and alerts, colors candles based on themes, and includes an optional info box with ATR bands, support/resistance, and trend projections. Built for any symbol and timeframe (optimized for 1H intraday), it auto-detects Heikin Ashi charts and handles mixed MA types like responsive HMA with lagging EMAs. All logic uses built-in TA functions for reliability—no repainting on confirmed bars.

Key Features

  • MA Crossover Engine: Configurable lines (EMA, SMA, HMA, VWAP) with dynamic colors (HMA tints green/red based on slope). Enable/disable via inputs.
  • Invert Signals Toggle: Flips BUY/SELL logic for mixed MA setups (e.g., HMA as fast line over EMA).
  • Reasoning: Traditional crossovers assume a fast line (low lag) crossing above a slow line (high lag) for buys. HMA's hull design makes it ultra-responsive, so it may "lead" too aggressively—causing premature signals. Inverting aligns it with user intuition (e.g., HMA dipping below then recovering signals strength), reducing false positives in trending markets. Test on your pairs!
  • Visual Alerts: BUY/SELL labels at crossover price (with optional price display and offset adjustment).
  • Single MA Overlays: Independent plots for EMA/SMA/HMA/VWAP (length 0 to hide).
  • Info Box: Real-time table with current price, ±1/2 ATR bands, median price (over lookback), trend (SMA50 slope), volatility % (ATR normalized), support/resistance (recent highs/lows), and reversal projections (tied to SMA50 pivot for up/down bias).
  • Candle Coloring: 20+ themes (dark/light canvases) for bull/bear/reversal/low-volume bars—e.g., Emerald Blaze greens uptrends, dims on low vol. Toggle off for no changes.
  • Chart Source Flexibility: Auto-switches to Heikin Ashi if detected; manual override for Regular/HA.


Alerts fire on crossovers/crossunders (custom messages with ticker/interval). Open-source for forking.

How to Use

  • Add to Chart: Search in TradingView's public library, apply to any symbol (e.g., stocks, forex). Best on 1H for intraday, but works on daily/weekly too.
  • Setup Crossovers: Choose Line 1/2 types/lengths (e.g., HMA 9 over SMA 20). Enable "Invert Signals" if using HMA—prevents lag mismatches in volatile assets.
  • Alerts & Labels: Toggle labels for visuals; set TradingView alerts on "Buy"/"Sell" conditions. Use offset for crowded charts.
  • Info Box Insights: Enable for quick scans—e.g., enter long near support if trend is bullish and price > median. Adjust ATR length (default 14) for sensitivity.
  • Candle Themes: Pick a scheme (e.g., Neon Pulse for dark mode); it overrides bar colors without altering data.
  • Customization Tip: For HMA-heavy setups, invert + short lengths (5-9) catch turns early; pair with volume filter in alerts.


Limitations & Disclaimers - Designed for overlay on price charts; may overlap in tight ranges—adjust transparency via styles.
HMA can repaint intra-bar; signals confirm on close. Not back tested for all assets—validate with strategy tester.
Info box projections use SMA(50) as a trend pivot (same for up/down as reference); customize via code for advanced calcs. Candle colors are cosmetic only.
This is an analysis tool, not advice. Trading involves risk; combine with fundamentals/news. Past performance isn't indicative of future results. No liability for losses.

I'm still a newbie, so feedback encouraged!
Thank you!!

ThisGirl


Wyłączenie odpowiedzialności

Informacje i publikacje przygotowane przez TradingView lub jego użytkowników, prezentowane na tej stronie, nie stanowią rekomendacji ani porad handlowych, inwestycyjnych i finansowych i nie powinny być w ten sposób traktowane ani wykorzystywane. Więcej informacji na ten temat znajdziesz w naszym Regulaminie.