# Mean Reversion Strategy with Trend Confirmation (AMD & JNJ, 2019)
## Thesis Statement
This strategy combines trend-following and trend-reversing momentum signals using RSI, Bollinger Bands (BB), and SMA to trade AMD and JNJ from Jan 1, 2019 to Jan 1, 2020. By entering long positions when assets are oversold in uptrends and short positions when overbought in downtrends, the strategy aims to profit from mean reversion. Risk is controlled via position sizing, exposure balancing, and drawdown limits.
## Strategy Design
- **Asset:** AMD and JNJ
- **Capital:** $1 million
- **Indicators Used:**
- **RSI (14-day):** Measures momentum, identifies overbought (>70) and oversold (<30) signals.
- **Bollinger Bands (20-day, 2 std devs):** Detects extreme price deviations.
- **SMA (50-day):** Confirms trend direction to filter trade entries.
- Signal Rules:
- **Go long 50% when:** Price < Lower BB and RSI < 30 and Price > SMA (uptrend)
- **Go short 25% when:** Price > Upper BB and RSI > 70 and Price < SMA (downtrend)
- **Portfolio Constraint:** Both stocks must maintain ≥ 25% absolute exposure at all times.
- **Rebalancing**: Daily, 10 minutes after market open (9:40 AM every day)
## Assumptions
- Momentum reversals occur after extreme RSI and BB events.
- Trend filters reduce false breakouts (e.g., SMA helps avoid shorting strong uptrends).
- Portfolio is rebalanced daily to maintain exposure minimums.
- Market conditions in 2019 were mostly favorable for trend-based strategies (post-volatility regime).
### Trade Execution Logic
Each morning:
- Evaluate RSI, BB, and SMA for both stocks
- Only act if all signal conditions are aligned (RSI + BB + SMA)
- If long signal is triggered → allocate 50% of total capital to long.
- If short signal is triggered → allocate 25% of total capital to short.
- If weight of any stock drops below 25% due to price movement → rebalance to restore.
## Risk Management
- Hard cap on drawdown: <15%
- Target Sharpe Ratio: >1.0
- Avoid over-trading: only act on clear signals
## Rebalancing & Scheduling
- Daily check at 9:40 AM (10 minutes after open)
- Rebalance if weight < 25% or new trade signal emerges
- Log portfolio and signal metrics daily
## Backtest Result
### [Quantconnect Backtest Link](https://www.quantconnect.com/terminal/processCache/?request=embedded_backtest_3f4294f49032541a3700b7bee0a5317c.html)


Our strategy produced an annual return of 27.77% in 2019 using a momentum-based long/short system on AMD and JNJ. We maintained disciplined exposure and avoiding any margin calls.
Key Metrics:
- Sharpe Ratio: 1.477 — strong risk-adjusted return
- Max Drawdown: 6.3% — effective downside risk control
- Win Rate: 50% — balanced trade outcomes
- Profit-Loss Ratio: 0.02 — average losses were larger than wins
- Total Trades: 13 — low turnover helped minimize trading costs
- Total Fees: $122.43 — kept transaction costs minimal
Our strategy blended trend-following and reversal logic: buying oversold assets in uptrends and shorting overbought assets in downtrends. The 50-day SMA helped avoid trading against strong momentum, and the 25% minimum weight rule ensured portfolio diversification and reduced concentration risk.
## Future Improvements
1. Using EMA (Exponential Moving Average) or MACD could reduce false signals.
2. Reduce Loss Size: Our average loss (-1.13%) is much larger than our average win (0.03%). Adjusting stop-loss rules or reducing position size on high-risk trades would help.
3. Better Position Sizing: Instead of fixed 50% long, 25% short, we could dynamically adjust based on volatility or risk levels.
4. More Trades: more frequent trades using tighter RSI or Bollinger Bands thresholds would improve performance.