CCI+RSI+EMA Strategy with Percentage or ATR TP/SL

Jul 26, 2023

Static chart image
Signals
Oscillators
Moving Averages
Volatility

The CCI+RSI+EMA Strategy with Percentage or ATR TP/SL indicator is a momentum-based trading tool designed to identify reversal opportunities in overbought or oversold conditions while filtering for the prevailing trend. It combines the Commodity Channel Index (CCI) and Relative Strength Index (RSI) for entry signals, utilizing an Exponential Moving Average (EMA) to ensure trades align with the long-term market direction.

Usage

This strategy is used to capture mean-reversion moves or trend pullbacks. A long entry is triggered when the CCI crosses above the oversold level, provided the price is above the EMA (if enabled) and the RSI confirms the oversold state (if enabled). Conversely, a short entry occurs when the CCI crosses below the overbought level while the price remains below the EMA and RSI is in overbought territory.

The strategy includes flexible exit logic:

  • Dynamic Exits: Positions automatically close when the CCI reaches the opposite threshold (e.g., a long trade closes when CCI crosses the overbought level).
  • Risk Management: Users can toggle between percentage-based or ATR-based exit levels to manage profit targets and stop losses.

Details

The script integrates three primary technical concepts:

  • CCI: Measures the current price level relative to an average price level over a given period. High values indicate strength, while low values indicate weakness.
  • RSI: Acts as a secondary momentum filter to ensure the asset is sufficiently stretched before an entry is considered.
  • ATR: Used specifically for the volatility-adjusted TP/SL method, allowing the strategy to breathe during high volatility and tighten up during low volatility.

Settings

CCI

  • CCI Length: The lookback period for the Commodity Channel Index calculation.
  • Overbought: The level above which the asset is considered overextended to the upside.
  • Oversold: The level below which the asset is considered overextended to the downside.

RSI

  • Use RSI: Enables or disables the RSI filter for entries.
  • RSI Length: The lookback period for the Relative Strength Index.
  • RSI Overbought/Oversold: Thresholds required for RSI confirmation.

EMA

  • Use EMA: Enables the trend filter; long trades only above the EMA, short trades only below.
  • EMA Length: The period for the trend-detecting Exponential Moving Average.

TP/SL Method

  • Percentage TP/SL: Uses a fixed percentage of the entry price to set exit levels.
  • ATR TP/SL: Uses market volatility (ATR) multiplied by a factor to set the stop loss, with the take profit determined by a risk-reward ratio.
  • Take Profit (%) / Stop Loss (%): Specific values for the percentage-based exit method.
  • ATR SL Multiplier / Risk Reward Ratio: Specific values for the ATR-based exit method.

FAQ

How do I access this indicator?

You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.

Can I use this strategy without the EMA filter?

Yes, you can disable the "Use EMA" setting in the inputs menu to allow the strategy to take signals regardless of the long-term trend direction.

Does the strategy plot the EMA on the chart?

No, the script is designed as a non-overlay strategy to keep the CCI oscillator clear. If you wish to see the EMA, you should add a standard EMA indicator to your chart with the same length.

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.