EMA 21 + MacD + RSI + Alma
Aug 13, 2022

The EMA 21 + MacD + RSI + Alma indicator provides a comprehensive trend-following framework by combining multiple momentum and trend filters to identify high-probability entry points and dynamic stop-loss levels.
Usage
The Usage section defines the specific conditions required for identifying potential market entries and managing risk using the integrated toolset.
Long Entry Conditions:
- Trend Context: The 9-period EMA is positioned below the 21-period EMA (often used as a mean-reversion or crossover baseline).
- Momentum: The RSI (10) crosses above the 50 level, ideally recovering from an oversold condition.
- Trend Confirmation: The MACD (5, 35, 5) histogram shows solid green momentum.
- Execution: A conditional buy limit order is placed at the top wick of the signal candle.
- Risk Management: The stop loss is placed at the ALMA line, targeting a 1:3 risk-to-reward ratio.
Short Entry Conditions:
- Trend Context: The 9-period EMA is positioned above the 21-period EMA.
- Momentum: The RSI (10) crosses below the 50 level, ideally recovering from an overbought condition.
- Trend Confirmation: The MACD (5, 35, 5) histogram shows solid red momentum.
- Execution: A conditional sell limit order is placed at the bottom wick of the signal candle.
- Risk Management: The stop loss is placed at the ALMA line, targeting a 1:3 risk-to-reward ratio.
Details
This script integrates several classic technical analysis concepts to reduce lag and filter out market noise.
- EMA Smoothing: The script calculates two Exponential Moving Averages (9 and 21) and provides an optional secondary smoothing layer using methods like SMA, SMMA, or VWMA to further refine trend signals.
- MACD Configuration: Unlike standard settings, this indicator utilizes a 5, 35, 5 configuration, making the histogram more sensitive to short-term momentum shifts.
- Arnaud Legoux Moving Average (ALMA): The ALMA is utilized as a superior trailing stop-loss mechanism compared to standard MAs. By applying a Gaussian distribution, it provides a balance between smoothness and responsiveness, minimizing the "sigma" or noise around the price action.
- Alert Integration: The script includes built-in alert functionality for EMA crossovers and price interactions with the ALMA line, allowing for automated monitoring.
Settings
- Length 1 & 2: Sets the periods for the two primary EMAs (default 9 and 21).
- Source 1 & 2: Determines the price data used for the EMA calculations (default Close).
- Smoothing Method: Allows users to choose between SMA, EMA, SMMA, WMA, or VWMA for the secondary smoothing lines.
- Smoothing Length: Sets the lookback period for the secondary smoothing.
- ALMA Window Size: Determines the lookback period for the Arnaud Legoux Moving Average (default 20).
- ALMA Offset: Controls the smoothness vs. lag of the ALMA (default 0.8).
- ALMA Sigma: Adjusts the width of the Gaussian filter applied to the ALMA (default 8).
FAQ
What are the primary indicators combined in this script? The script combines two Exponential Moving Averages (EMA), the Relative Strength Index (RSI), the Moving Average Convergence Divergence (MACD), and the Arnaud Legoux Moving Average (ALMA).
How is the ALMA used in this strategy? The ALMA serves as a dynamic support/resistance level and is primarily used as the reference point for placing stop-loss orders to protect capital during a trade.
How can I access the EMA 21 + MacD + RSI + Alma indicator? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
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.

