OPEN-SOURCE SCRIPT

Multiple Moving Average Touch Alert

Updated
Multiple Moving Average Touch Alert Indicator

This versatile indicator helps traders identify when price interacts with multiple moving averages, featuring customizable settings and visual alerts. It overlays four different moving averages on your chart and signals when price touches any of them.

Key Features:

  • Four independent moving averages with full customization
  • Visual background highlighting when price touches any MA
  • Flexible timeframe settings for each moving average
  • Multiple MA type options (SMA, EMA, WMA, VWMA)
  • Built-in alert conditions for each MA touch
  • Adjustable color and transparency settings
  • Toggle visibility for each moving average


Default Settings:

  • MA1: 15-period SMA (Light Blue)
  • MA2: 30-period SMA (Magenta)
  • MA3: 60-period SMA (Blue)
  • MA4: 240-period SMA (Red)


How It Works

The indicator monitors price action around each moving average and triggers both visual and optional alerts when the price touches any of the MAs. A "touch" is defined as when either the high or low of the candle crosses through the moving average line. When a touch occurs, the background changes color to match the corresponding MA (with adjusted transparency).

Customization Options

Each moving average can be independently configured with:
  • Period length
  • MA type (Simple, Exponential, Weighted, or Volume-Weighted)
  • Custom timeframe
  • Color and transparency
  • Show/hide toggle


Use Cases

  • Identify potential support and resistance levels
  • Spot price interaction with key moving averages
  • Multi-timeframe analysis
  • Trade entry and exit points
  • Trend following strategies
  • Dynamic support/resistance zones


Alert System

Built-in alert conditions for each moving average make it easy to set up notifications when price touches any of your selected MAs. Perfect for traders who want to stay informed of important price-MA interactions without constantly watching the charts.
This indicator is ideal for both novice and experienced traders who use moving averages in their trading strategy and want to automate the detection of price-MA interactions.

Tags: Moving Average, Multi-MA, Technical Analysis, Price Action, Support Resistance, Alerts, Trend Following
Release Notes
Adding Short Title
Release Notes
Update Chart
Moving AveragesmultitimeframeTrend Analysis

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

Disclaimer