ETF 3-Day Reversion Strategy

Introduction: This strategy is a modification of the “3-day Mean Reversion Strategy” from the book "High Probability ETF Trading" by Larry Connors and Cesar Alvarez. In the book, the authors discuss a high-probability ETF mean reversion strategy for a 1-day time-frame with these simple rules:

  • The price must be above the 200 day SMA and below the 5 day SMA .
  • The low of today must be lower than the low of yesterday (must be true for 3 consecutive days)
  • The high of today must be lower than the high of yesterday (must be true for 3 consecutive days)
  • If the 3 rules above are true, then buy on the close of the current day.
  • Exit when the closing price crosses above the 5 day SMA .
In practice and in backtesting, I’ve found that the strategy consistently works better when using an EMA for the trend-line instead of an SMA . So, this script uses an EMA for the trend-line. I’ve also made the length of the exit EMA adjustable.

How it works:
The Strategy will buy when the buy conditions above are true. The strategy will sell when the closing price crosses over the Exit Moving Average

Green line = Exit Moving Average (Default 5 Day EMA )
Blue line = 5 Day EMA (Used as Entry Criteria)

Disclaimer: Open-source scripts I publish in the community are largely meant to spark ideas that can be used as building blocks for part of a more robust trade management strategy. If you would like to implement a version of any script, I would recommend making significant additions/modifications to the strategy & risk management functions. If you don’t know how to program in Pine, then hire a Pine-coder. We can help!
Notas de prensa: This strategy is up nearly 10% YTD going long on QQQ and SPY. The original version was hard coded to only trade when the market is above the 200 day EMA. While backtesting index ETFs, I've found multiple instances where someone might not want to have trades filtered out below that trend. So, this new version adds an input that allows the user to select whether or not to enter trades when the market is below the 200 day EMA. The change improved backtest and YTD performance on SPY and QQQ. Cheers!

Want to build custom alerts and custom strategies? Interested in automated trading?

Hire me to code or automate your trading strategy, or schedule a free consultation at:
Script de código abierto

Siguiendo el verdadero espíritu de TradingView, el autor de este script lo ha publicado en código abierto, para que los traders puedan entenderlo y verificarlo. ¡Un hurra por el autor! Puede utilizarlo de forma gratuita, aunque si vuelve a utilizar este código en una publicación, debe cumplir con lo establecido en las Normas internas. Puede añadir este script a sus favoritos y usarlo en un gráfico.

Exención de responsabilidad

La información y las publicaciones que ofrecemos, no implican ni constituyen un asesoramiento financiero, ni de inversión, trading o cualquier otro tipo de consejo o recomendación emitida o respaldada por TradingView. Puede obtener información adicional en las Condiciones de uso.

¿Quiere utilizar este script en un gráfico?