All indicators

Simple Moving Averages (7, 30, 50, 100, 200)

Jun 4, 2018

Static chart image
Support and ResistanceSignalsMoving Averages

The Simple Moving Averages (7, 30, 50, 100, 200) indicator consolidates five distinct moving average periods into a single tool to help traders identify multi-timeframe trends and support/resistance levels while optimizing indicator slot usage.

Usage

The Usage section describes how the script can be used to analyze market trends and price action across different time horizons.

  • Trend Identification: Traders can use the alignment of the five SMA lines to determine trend strength. When the 7 SMA is above the 30, which is above the 50, and so on, it indicates a strong bullish trend. Conversely, a stacked order from 200 down to 7 indicates a strong bearish trend.
  • Support and Resistance: The 50, 100, and 200 SMAs are frequently used by institutional traders as dynamic support or resistance zones. Price reacting to these levels often signals potential reversals or trend continuations.
  • Crossover Strategies: The script includes alerts for price crossovers with the 7 SMA (short-term momentum) and the 200 SMA (long-term trend shifts). For example, price crossing above the 200 SMA may signal the beginning of a long-term bullish cycle.

Details

The script calculates five separate Simple Moving Averages (SMA) using the arithmetic mean of the closing price over the specified periods. By bundling these calculations into one script, it allows users on limited indicator plans to view a comprehensive trend profile without exceeding platform constraints.

The logic utilizes the ta.sma function for efficiency and includes built-in alert conditions for price interaction with the fastest and slowest moving averages. This ensures that users are notified of immediate momentum changes (7 SMA) and significant institutional trend changes (200 SMA) automatically.

Settings

  • SMA 1 Length: Sets the period for the first moving average (Default: 7).
  • SMA 2 Length: Sets the period for the second moving average (Default: 30).
  • SMA 3 Length: Sets the period for the third moving average (Default: 50).
  • SMA 4 Length: Sets the period for the fourth moving average (Default: 100).
  • SMA 5 Length: Sets the period for the fifth moving average (Default: 200).

FAQ

Can I change the colors and visibility of the individual lines? Yes, each SMA line can be toggled on or off and its color can be customized within the "Style" tab of the indicator settings.

Are the alerts configurable for other lengths? The default alerts are optimized for the 7 and 200 SMA lengths; however, you can modify the source code or set generic alerts on the other plot lines manually.

How do I access the Simple Moving Averages (7, 30, 50, 100, 200) indicator? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.

Free indicator

Get free access to this indicator on the platforms below.

TradingView
NinjaTrader
MetaTrader 4/5

Unlock the entire LuxAlgo Library

Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.