All indicators

Mean Reversion with Incremental Entry

Dec 29, 2023

Static chart image
SignalsMoving Averages

The Mean Reversion with Incremental Entry indicator focuses on identifying price deviations from a moving average to execute systematic entries and exits based on mean-reverting behavior. This tool is designed for traders seeking to scale into positions as price moves further away from the mean, aiming to capture reversals back toward the average.

Usage

The indicator can be used to automate or identify trade entries when price significantly deviates from a Simple Moving Average (SMA).

  • Initial Entry: A trade is triggered when the price deviates from the SMA by a user-defined "Initial Percent." For example, if price falls below the SMA by 5%, a long position is initiated.
  • Incremental Entries: If the price continues to move against the position, additional entries are triggered at fixed "Percent Step" intervals. This allows the trader to average their entry price during periods of high volatility.
  • Exit Logic: Positions are automatically closed when the price returns to and touches the SMA, which serves as the target mean.

Details

The script utilizes a Simple Moving Average (SMA) as the central baseline for value. The logic is predicated on the statistical tendency for price to return to its average over time.

By using the calc_on_every_tick parameter, the strategy evaluates entry conditions in real-time, allowing for precise execution when the percentage thresholds are breached. The incremental system effectively builds a position size that scales with the magnitude of the deviation, which can be particularly useful in swing trading scenarios where price "overshoots" common support or resistance levels.

Settings

  • MA Length: Sets the lookback period for the Simple Moving Average. A higher length results in a slower, more stable mean.
  • Initial Percent for First Order: Determines the minimum percentage distance the price must be from the MA to trigger the first entry.
  • Percent Step for Additional Orders: Defines the percentage distance required between the last entry price and the current price to trigger subsequent incremental orders.

FAQ

How do I access Mean Reversion with Incremental Entry?

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

Can I change the type of Moving Average used?

The current version uses a Simple Moving Average (SMA). To use a different type, such as an EMA, the underlying Pine Script source code would need to be modified.

Does this script include a Stop Loss?

The standard version of this script relies on mean reversion to the SMA for exits. Users should manually manage risk or add additional stop-loss logic within the strategy settings if a hard exit is required.

Free indicator

Get free access to this indicator on the platforms below.

TradingView
NinjaTrader
MetaTrader 4/5

Unlock the entire LuxAlgo Library

Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.