Four Simple Moving Averages
Jan 6, 2018

The Four Simple Moving Averages indicator plots up to four distinct SMA lines on a single chart to help traders identify trend direction and potential support or resistance levels without exceeding indicator limits.
Usage
The indicator is used to monitor multiple time-weighted average prices simultaneously to determine market momentum across various timeframes. By plotting four separate SMAs, users can observe how short-term price action interacts with long-term trends. For example, a common configuration involves setting the lengths to 21, 55, 100, and 200 to visualize the progression from short-term momentum to long-term institutional trend lines.
Trend and Crossover Analysis
Traders can use the relationship between the lines to identify trend strength. When the shorter-term SMAs are positioned above the longer-term SMAs, it typically indicates a bullish environment. The script includes built-in alert logic for:
- Price crossing the first SMA (MA 1).
- The first SMA crossing the second SMA (MA 1 vs MA 2).
These alerts help in identifying potential entry or exit points based on moving average crossovers.
Details
The script calculates Simple Moving Averages by taking the arithmetic mean of a selected price source over a specific number of periods. Unlike exponential moving averages, SMAs give equal weight to every data point in the lookback period, making them effective for identifying major structural support and resistance levels.
The implementation allows for independent "Source" inputs for each of the four averages, meaning a trader could compare an SMA based on "High" prices against one based on "Low" prices to create a custom channel. The toggle settings for the second, third, and fourth averages ensure that users can declutter their workspace by only displaying the lines relevant to their current strategy.
Settings
- Enable 2nd/3rd/4th MA: Boolean toggles that allow users to show or hide the secondary moving average lines on the chart.
- Length 1-4: Numerical inputs that define the lookback period (number of bars) for each specific SMA calculation.
- Source 1-4: Dropdown menus to select the price data used for each calculation (e.g., Close, Open, High, Low, HL2, etc.).
FAQ
Can I use this indicator for crossover strategies? Yes, the script is designed to highlight the relationship between different moving averages and includes specific alert triggers for crossovers between MA 1 and MA 2.
Does this indicator support different price sources? Yes, each of the four moving averages can be assigned a different source, such as the close, open, or high price, providing flexibility for various technical analysis techniques.
How do I access the Four Simple Moving Averages indicator? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Unlock Unlimited Access to the LuxAlgo Library
Upgrade your plan to get all indicators, strategies, charts, and full access to Quant, our AI agent.
Trading & investing are risky and many will lose money in connection with trading and investing activities. All content on this site is not intended to, and should not be, construed as financial advice. Decisions to buy, sell, hold or trade in securities, commodities and other investments involve risk and are best made based on the advice of qualified financial professionals. Past performance does not guarantee future results.
Hypothetical or Simulated performance results have certain limitations. Unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, including, but not limited to, lack of liquidity. Simulated trading programs in general are designed with the benefit of hindsight, and are based on historical information. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.
Testimonials appearing on this website may not be representative of other clients or customers and is not a guarantee of future performance or success.
As a provider of technical analysis tools and strategies, we do not have access to the personal trading accounts or brokerage statements of our customers. As a result, we have no reason to believe our customers perform better or worse than traders as a whole based on any content, tool, or platform feature we provide.
Charts used on this site are by TradingView in which the majority of our technical indicators are built on. TradingView® is a registered trademark of TradingView, Inc. www.TradingView.com TradingView® has no affiliation with the owner, developer, or provider of the Services described herein.
Market data is provided by CBOE, CME Group, BarChart, Massive, CoinAPI. Select U.S. equities data is provided through Massive. CBOE BZX real-time U.S. equities data is licensed from CBOE and provided through BarChart. Real-time futures data is licensed from CME Group and provided through BarChart. Select cryptocurrency data, including major coins, is provided through CoinAPI. All data is provided “as is” and should be verified independently for trading purposes.
This does not represent our full Disclaimer. Please read our full disclaimer.
© 2026 LuxAlgo Global, LLC.

