Type/to search

Mean Reversion Envelope Moving Average Strategy

Common strategy
Created: 2023-12-04 16:12:39
Last modified: 3 years ago
1
Follow
1802
Followers

img

Overview

The Mean Reversion Envelope Moving Average Strategy is a mean reversion trading strategy based on moving averages. It uses Double Exponential Moving Average (DEMA) as the base calculation and adds several envelopes above and below it. When the price touches the envelope bands, it opens long or short positions based on the direction. When the price regresses to the moving average, it closes all positions.

Strategy Logic

The strategy uses Double Exponential Moving Average (DEMA) as the base indicator, which is a moving average that is more sensitive to recent price changes. Above and below the DEMA, several price bands are added to form an envelope zone. The range of the envelope is set by the user, with a fixed percentage interval between each band.

When the price rises and approaches the upper envelope band, the strategy opens a short position. When the price falls and hits the lower envelope band, it opens a long position. It adds a new position each time when a new price band is touched. When the price regresses close to the moving average, all positions are closed.

Through capturing excessive price fluctuations with the envelope bands and profiting from reversals, the strategy aims to buy low and sell high. It fits market cycles with obvious mean reversion tendencies, such as cryptocurrencies like Bitcoin.

Advantages

  • Uses Double Exponential Moving Average, which is sensitive to short-term price changes for catching trend reversals.
  • The envelope bands around moving average can accurately capture price reversals.
  • Opens positions in batches, fully utilizing capital efficiency.
  • Quickly switch directions after profiting to adapt to market changes.
  • Parameters can be freely optimized.

Risks

  • Unable to profit from strongly trending markets.
  • Improper parameters may cause over-trading.
  • Needs relatively stable markets, not suitable for highly volatile environments.
  • Too narrow envelopes may prevent entering positions.

The risks can be reduced by appropriately expanding the envelope range to increase sensitivity and adjusting the moving average length to fit different market cycles.

Optimization Directions

The strategy can be optimized in the following aspects:

  1. Test different moving average algorithms.

  2. Adjust the moving average length parameter for better adapting to short-term fluctuations.

  3. Optimize the envelope parameters by testing different percentage settings.

  4. Add stop loss methods like trailing stop loss to limit single trade loss.

  5. Add filtering conditions with other indicators to avoid invalid entries in irrational markets.

Conclusion

The Mean Reversion Envelope Moving Average Strategy effectively captures mean reversion opportunities by building a price channel around the moving average. It can be flexibly adapted to different market environments through parameter adjustments. With relatively low transaction costs and high returns, this is a recommended quantitative trading strategy.

Source
Pine
/*backtest
start: 2022-11-27 00:00:00
end: 2023-12-03 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=5
strategy("Mean Reversion - Envelope Strategy", overlay=true )

// ----------------------- DESCRIPTION -----------------------
Strategy parameters
Strategy parameters
Moving Average
Moving Average Source
Moving Average Window
Moving Average Type
Envelope
Delta Per Enveloppe
Envelope count
Orders
Use Long Orders ?
Use Short Orders ?
Comment
All comments (0)
No data
No data
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)