ETF 3-Day Reversion Strategy

TradeAutomation Premium Telah dikemaskini   
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!
Catatan Pelepasan: 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:
Skrip sumber terbuka

Dalam semangat TradingView yang sebenar, penulis skrip ini telah menerbitkannya dengan menggunakan sumber terbuka supaya pedagang-pedagang dapat memahami dan mengesahkannya. Sorakan kepada penulis! Anda dapat menggunakannya secara percuma tetapi penggunaan semula kod ini dalam penerbitan adalah dikawalselia oleh Peraturan Dalaman. Anda boleh menyukainya untuk menggunakannya pada carta.


Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.

Ingin menggunakan skrip ini pada carta?