Strategy Design & Modeling
This document covers the principles and methodologies for designing, developing, and validating systematic trading strategies, from initial concept through backtesting to deployment.Trading Styles
| Style | Holding Period | Timeframe | Signals Per Day |
|---|---|---|---|
| Scalping | Seconds to minutes | 1m-5m | 50-200 |
| Day Trading | Minutes to hours | 5m-1h | 5-50 |
| Swing Trading | Days to weeks | 1h-1D | 0-5 |
| Position Trading | Weeks to months | 1D-1W | 0-1 |
Strategy Components
Every strategy in MangroveAI consists of:- Entry Rules — 1 TRIGGER signal + 1 FILTER signal
- Exit Rules — 1 TRIGGER signal + 0-1 FILTER signals
- Risk Management — Stop-loss, take-profit, position sizing via
execution_config - Asset Selection — Which instrument to trade
Backtesting Best Practices
- Out-of-sample testing — Never optimize on the same data you validate with
- Sufficient trade count — Need 30+ trades minimum for statistical significance
- Realistic assumptions — Account for slippage, commissions, and market impact
- Multiple market conditions — Test across trending, ranging, and volatile periods
- Walk-forward analysis — Periodically re-optimize on rolling windows
Common Pitfalls
- Overfitting — Too many parameters tuned to historical data
- Survivorship bias — Only testing on assets that still exist
- Look-ahead bias — Using future data in signal calculations
- Ignoring transaction costs — Profitable backtests can turn negative with realistic costs
- Curve fitting — Optimizing until backtest looks perfect (does not generalize)
For the complete Strategy Design reference, see
knowledge-base/04-strategy-design-modeling.md in the repository.