Moving Average With Risk:Reward

Jul 11, 2023

Static chart image
Signals
Drawing Tool
Moving Averages
Volatility

The Moving Average With Risk:Reward indicator streamlines trend-following strategies by combining dual moving average crossovers with automated, volatility-based trade execution levels.

Usage

The Usage section describes how the script can be used to identify market momentum and manage trade exits. The indicator generates actionable signals based on the interaction between two distinct moving average types:

  • Bullish Signals: Occur when the shorter-term Exponential Moving Average (EMA) crosses above the longer-term Simple Moving Average (SMA), suggesting upward momentum.
  • Bearish Signals: Occur when the EMA crosses below the SMA, suggesting downward momentum.

Upon a crossover event, the tool automatically plots three horizontal lines:

  1. Entry Level: The closing price at the time of the signal.
  2. Stop Loss (SL): A defensive exit level calculated using the Average True Range (ATR).
  3. Take Profit (TP): A target exit level also derived from market volatility.

Whenever a new signal is generated, the previous lines and labels are removed to ensure the chart remains focused on the most current trade setup.

Details

The script utilizes a 21-period SMA for stable trend identification and a 9-period EMA for increased sensitivity to recent price action. The core logic relies on the "golden cross" and "death cross" principles applied to these specific lengths.

To account for market volatility, the script incorporates the Average True Range (ATR) with a 14-period lookback. This ensures that the Risk:Reward levels are not static; in high-volatility environments, the Stop Loss and Take Profit levels will widen, while in low-volatility environments, they will tighten. This adaptive approach helps in setting realistic targets and protection based on the current market state.

Settings

  • SMA Length: Sets the period for the Simple Moving Average (default 21).
  • EMA Length: Sets the period for the Exponential Moving Average (default 9).
  • ATR Multiplier for Stop Loss: Determines how many multiples of the ATR are used to set the Stop Loss distance from the entry.
  • ATR Multiplier for Take Profit: Determines how many multiples of the ATR are used to set the Take Profit distance from the entry.
  • Color for Stop Loss Line: Customizes the visual color of the SL horizontal line.
  • Color for Take Profit Line: Customizes the visual color of the TP horizontal line.
  • Color for Entry Line: Customizes the visual color of the entry price line.

FAQ

How do I adjust the Risk:Reward ratio? You can modify the ratio by changing the "ATR Multiplier for Stop Loss" and "ATR Multiplier for Take Profit" in the settings. For example, setting the TP multiplier to double the SL multiplier creates a 1:2 Risk:Reward setup.

Does this indicator work on all timeframes? Yes, the moving average and ATR calculations adapt to whichever timeframe is currently active on your chart, though settings may need to be optimized for different asset classes.

How can I get access to the Moving Average With Risk:Reward indicator? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.

Free access on the following platforms
tradingviewSymbolTradingView
ninjatraderNinjaTrader
metatrader4MetaTrader 4/5
thinkorswimThinkorswim

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.