OPEN-SOURCE SCRIPT

Universal Mean-Reverting Swing Strategy

This Universal Mean-Reverting Swing Trading Strategy is designed for all stocks on the 1D timeframe, making it highly adaptable across markets. It generates long/short signals based on key mean reversion indicators:

📌 Indicators Used:
✅ Bollinger Bands – Identifies overbought and oversold conditions.
✅ RSI (Relative Strength Index) – Confirms momentum shifts.
✅ Z-Score – Measures price deviations from the statistical mean.

🎯 Entry Conditions:
🔹 Long Signal 🟢 – Triggered when price is below the lower Bollinger Band, RSI is below 30, and Z-score is extremely negative.
🔹 Short Signal 🔴 – Triggered when price is above the upper Bollinger Band, RSI is above 70, and Z-score is extremely positive.

⚙️ Customizable Inputs:

Bollinger Band Length & Multiplier
RSI Length
Z-Score Sensitivity
This strategy does not execute buy/sell orders but instead provides long/short signals, allowing traders to manually manage risk and execution. Works best in range-bound markets where mean reversion is dominant.

🔹 Recommended Use: Combine with fundamental analysis or additional technical indicators for optimal results.

🚀 Try it out and let me know your feedback!

כתב ויתור