30, 50, 100 and 200 Day Simple Moving Averages
Apr 18, 2018

The 30, 50, 100 and 200 Day Simple Moving Averages indicator plots four customizable trend lines on the chart to assist traders in identifying market direction, momentum shifts, and potential areas of dynamic support and resistance.
Usage
The Usage section describes how the script can be used to interpret market trends and price action. By utilizing four distinct moving averages, traders can analyze different time horizons simultaneously to determine the strength and sustainability of a trend.
Trend Identification
The primary use of this tool is to visualize the relationship between price and historical averages. When the price is consistently trading above the SMA lines, the market is generally considered to be in an uptrend. Conversely, if the price remains below the lines, a downtrend is indicated. The script features a color-coded system where each SMA turns green when the price is above it and red when the price is below it, providing immediate visual feedback on market sentiment.
Dynamic Support and Resistance
Institutional traders often monitor the 50, 100, and 200-day averages as key pivot points. These levels frequently act as dynamic support during pullbacks in an uptrend or dynamic resistance during rallies in a downtrend.
Crossover Alerts
The indicator includes built-in alert functionality for price crossovers. These alerts trigger when the closing price crosses above or below any of the four SMA lines, notifying the trader of potential trend reversals or breakout opportunities.
Details
This script is constructed using the standard Simple Moving Average (SMA) calculation, which takes the arithmetic mean of a given set of prices over a specific number of periods. While the title focuses on the 30, 50, 100, and 200-day periods—common benchmarks for equity and forex traders—the script is fully adjustable to any length. The logic is refactored from original concepts by FX_TraderUK to include visual enhancements and optimized alert conditions.
Settings
- SMA #1-4 Length: These settings allow users to define the lookback period for each of the four moving averages.
- SMA Source #1-4: Specifies the price data used for the calculation (default is set to "Close").
FAQ
What is the difference between these SMAs? Each SMA represents a different timeframe; shorter lengths (like the 20 or 30) react faster to price changes, while longer lengths (like the 200) reflect long-term market cycles.
How do the alerts work? Alerts are programmed to trigger once per bar close when the price crosses over or under any of the four active moving average lines.
How can I access this 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.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.