π‘οΈ Backtest Settings Guide
Master the configuration options that control your trading simulations and risk management
Backtest settings are the control panel for your trading simulations. They determine how much capital you start with, which stocks you trade, how long you test for, and most importantly, how risk is managed throughout the simulation. Think of backtesting as a flight simulator for tradingβ the settings you choose determine how realistic that simulation is.
Initial Equity
Your starting capitalβthe amount of money the simulation begins with. This is the foundation of your entire backtest.
Lower Equity ($1Kβ$10K)
Smaller position sizes, commissions have bigger impact, harder to diversify. More realistic for small personal accounts.
Higher Equity ($100K+)
Larger positions possible, better diversification, commissions matter less. Good for testing institutional-scale strategies.
Important: Initial equity affects absolute dollar profits/losses and position sizing calculations, but percentage returns remain the same regardless of starting amount.
Backtest Period
The time range your backtest runs overβwhen it starts and when it ends. This determines which market conditions your strategy will face.
Short (3β6 months)
- β’ Fast to run
- β’ May miss different market conditions
- β’ Good for quick iteration
Medium (1β2 years)
- β’ Captures some market cycles
- β’ Balances speed and validity
- β’ Good for most testing
Long (3+ years)
- β’ Captures multiple market regimes
- β’ More statistically significant
- β’ Best for final validation
Best Practices
Include at least one major market event in your test period:
Portfolio Symbols
The universe of stocks your strategies can trade. Think of this as your "shopping list" of available investments.
Warning: You must have market data downloaded for all symbols in your portfolio for the backtest period. If data is missing, the engine will skip those symbols, which can skew results.
Risk Settings
Risk settings are the safety controls for your backtest. They determine how much you can lose before stopping, when to take profits, and how large positions can be. These are the most impactful settings for protecting your simulated capital.
1. Configuration
Position sizing limitsβthe guardrails that prevent any single trade from blowing up your account
Max Position Size
Maximum % of portfolio in a single position
Max Symbol Exposure
Maximum total exposure to any single symbol
Max Drawdown
Maximum loss from peak before stopping
Risk Level Guidelines
2. Exit Rules
Automatic position closuresβyour safety net for when things go right or wrong
Stop Loss
Automatically exit when position loses this percentage
Take Profit
Automatically exit when position gains this percentage
Max Holding Period
Maximum days to hold regardless of performance
Min Holding Period
Minimum days before strategy exits allowed
Early Exit Threshold
Min profit % of take profit allowing early exit
3. Partial Profit Taking
Gradually close portions of winning positions at predetermined profit levels
Define profit thresholds where you close a percentage of the position. This captures profits along the way while maintaining exposure for further upside.
| Profit Level | Close % | Remaining | Result |
|---|---|---|---|
| +10% | 30% | 70% | Take some profit early |
| +20% | 30% | 40% | More profit locked in |
| +30% | 40% | 0% | Full exit at strong profit |
Benefits: Captures profits along the way, reduces risk as position grows, lets winners run with remaining position, smooths equity curve
4. Partial Stop Loss
Similar to partial profit taking, but for managing losing positions
Define loss thresholds where you close a percentage of the position, reducing exposure before the full stop loss hits.
| Loss Level | Close % | Remaining | Result |
|---|---|---|---|
| -5% | 25% | 75% | Trim position early |
| -10% | 35% | 40% | Further reduction |
| -15% | 40% | 0% | Full exit if keeps falling |
Pros: Smaller losses, smoother equity curve, reduces damage from bad positions
Cons: More complex, may exit prematurely on volatile stocks
5. Margin Trading
Use leverage to control larger positions than your cash balance allows
1.0x β 1.5x
Cash only or minimal leverage. Good for capital preservation.
1.5x β 2.5x
Standard leverage. Balances opportunity with risk.
2.5x+
High leverage. Amplifies both returns and risks.
How Position Sizing Works
- Calculate current leverage: Total exposure Γ· Equity
- Find available capacity: (Target Leverage β Current Leverage) Γ Equity
- Apply constraints: Take the smallest of leverage capacity, max position size, and max symbol exposure
- Size the position: Multiply by signal strength (0-1) to get final position size
Important Limitation
The backtest does not simulate margin interest costs. In real trading, you pay 5β7% annually on borrowed capital. Your actual returns will be lower than backtest results when using leverage.
Quick Reference Table
| Setting | Default | Range | Use When⦠|
|---|---|---|---|
| Initial Equity | $100,000 | $1,000+ | Testing realistic capital levels |
| Max Position Size | 20% | 1β100% | Bigger bets on high conviction |
| Max Symbol Exposure | 30% | 1β100% | Adding to winners over time |
| Max Drawdown | 20% | 1β100% | Trend strategies with natural drawdowns |
| Stop Loss | 10% | 0β100% | Volatile markets, capital preservation |
| Take Profit | 20% | 0β100% | Range-bound markets, consistent gains |
| Max Holding Days | 30 | 1β365 | Long-term trend following |
| Min Holding Days | 3 | 0β365 | Reducing over-trading |
| Early Exit Threshold | 0.8 | 0β1 | Capturing gains quickly |
| Max Leverage | 2.0x | 1β10x | Confident in strong trends |
Recommended Configurations by Strategy Type
Conservative Long-Term
Active Swing Trading
Aggressive Momentum
Final Tips
Start Conservative
Begin with tighter risk limits. Once you have a working strategy, gradually relax them to optimize.
Match to Strategy
Trend-following needs wider stops and longer holding periods than mean-reversion.
Test Sensitivity
Run the same strategy with different risk settings to see which ones actually improve results.
Keep Risk Management ON
Even in testing, you want to know if your strategy survives, not just if it makes money in perfect conditions.
Watch the Leverage
Remember the backtest doesn't charge margin interest. Subtract 5β7% annually from leveraged results for realism.
Happy backtesting! May your drawdowns be shallow and your trends be long.
