OPEN-SOURCE SCRIPT

paigep.llc - SuperMA

102
SuperMA is a multi-layered moving-average and candle-coloring system that combines SMA, EMA, and optional HMA logic to help traders visualize trend shifts, pullbacks, and momentum changes in a clean, structured way.

The script includes multiple modules: trend-based moving averages, pullback signals, exit logic, and an optional HMA cross engine.

📌 Core Features

1. Full SMA + EMA Framework
The indicator plots multiple moving averages (8, 9, 13, 20, 50, 200) using both SMA and EMA calculations. Each line automatically colors bullish or bearish based on its relationship to the 200-period baseline.Users can toggle SMAs and EMAs independently for clearer chart control.

2. Main Trend Entry & Exit Logic (8×200 and 8×20)
Built-in crossover logic detects:
  • Main Entry: SMA 8 crossing above/below EMA 200
  • Main Exit: SMA 8 and SMA 20 cross (with an option to choose which SMA is treated as the “fast” leg)

A “first exit only” option allows the script to ignore additional exit signals until a new trend regime begins.

3. Pullback Module (20 SMA Interaction)
Pullback entries and exits occur when price crosses the 20 SMA during existing trend conditions.
  • This includes:
  • Pullback entries through the 20 SMA
  • Pullback exits back across the 20 SMA

Labels and candle colors are available for all pullback events.

4. Optional HMA Cross Module
A separate module allows traders to use two Hull Moving Averages (HMA) with customizable:
  • Lengths
  • Independent timeframes
  • Line colors
  • Cross-based entries and exits

This module has its own events, labels, and optional candle coloring.

5. Advanced Candle Coloring System
Candle coloring is layered in priority order, based on:
  • Main trend entries
  • Main exits
  • HMA entries
  • HMA exits
  • Pullback entries
  • Pullback exits
  • Trend-only candles (based on SMA 8 relative to EMA 200)

Users may also independently color wicks and borders.

6. Configurable Alerts (Fully Decoupled from Visuals)
Alerts are available for all major events, including:
  • Main Entries (8×200)
  • Main Exits (8×20)
  • Pullback Entries and Exits
  • HMA Entries and Exits
  • Bull or Bear Trend candles
  • Any colored candle event

Alerts can fire on bar close only or intrabar, depending on user preference.

📌 Use Cases

SuperMA helps traders visualize:
  • Trend direction using SMA/EMA structure
  • Momentum shifts through HMA crosses
  • Pullback zones around the 20 SMA
  • Early regime transitions based on the 8×200 relationship
  • Candle-level context through color-coded bars

The indicator works across all markets and timeframes.

⚠️ Note
This tool is for visual and analytical assistance only. It does not guarantee future performance and should be combined with additional analysis and risk management.

Penafian

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.