Position Sizing & Risk Management
Learn how to configure stop-loss, take-profit, and position sizing in Backtrex for realistic and risk-controlled backtests.
Why Risk Management Matters
A profitable entry strategy means nothing without proper risk management. Backtests without stop-loss or position sizing often show unrealistic results that would lead to account blowup in live trading.
Backtrex provides built-in risk management blocks to ensure your backtests reflect real-world conditions.
Stop-Loss Configuration
A stop-loss automatically closes your position when the price moves against you by a specified amount.
Fixed Percentage Stop-Loss
Set a percentage distance from your entry price:
- Example: 2% stop-loss on a buy at $100 triggers at $98
- Good for most strategies, simple to understand
- Configure in the Risk Management section of the canvas
ATR-Based Dynamic Stop-Loss
Uses the Average True Range to set a volatility-adjusted stop:
- Example: 2x ATR(14) stop-loss adapts to current market volatility
- Wider stops in volatile markets, tighter in calm markets
- Better for strategies that trade across different market conditions
Port-Based Stop-Loss
Set the stop-loss as a percentage of your total portfolio (not just the trade):
- Example: 1% portfolio risk means losing at most 1% of total equity per trade
- The position size is automatically calculated to match this risk level
- Recommended for professional risk management
Take-Profit Configuration
A take-profit automatically closes your position when the price reaches a specified profit target.
Fixed Percentage Take-Profit
- Example: 4% take-profit on a buy at $100 triggers at $104
- Often set as a multiple of the stop-loss (e.g., 2:1 reward-to-risk ratio)
ATR-Based Dynamic Take-Profit
- Example: 3x ATR(14) take-profit adapts to volatility
- Automatically captures more in volatile markets
Position Sizing
Position sizing determines how much capital to allocate per trade.
Fixed Percentage of Equity
Allocate a fixed percentage of your current equity to each trade:
- Conservative: 1-2% per trade
- Moderate: 3-5% per trade
- Aggressive: 5-10% per trade
Smaller position sizes mean slower growth but significantly lower drawdown risk.
Risk-Based Sizing
When using a port-based stop-loss, the position size is automatically calculated:
Formula: Position Size = (Account Risk %) / (Stop-Loss Distance %)
Example: If you risk 1% of a $10,000 account with a 2% stop-loss:
- Risk amount = $100
- Position size = $100 / 0.02 = $5,000 (50% of equity)
Risk Limit Block
The Risk Limit block sets account-level loss thresholds that override individual trade rules:
- Max daily loss: Stop trading after losing X% in a day
- Max total drawdown: Stop trading if total drawdown exceeds X%
This prevents catastrophic losses even if your strategy enters a losing streak.
Best Practices
- Never risk more than 1-2% per trade: This is the most important rule in trading
- Use a minimum 1:2 risk-to-reward ratio: Your take-profit should be at least 2x your stop-loss
- Enable the Risk Limit block: Set a max drawdown threshold to protect your capital
- Test with realistic position sizes: Do not backtest with 100% of equity per trade
- Compare with and without risk management: See how much stops and sizing affect your results
Interpreting Risk in Backtest Results
After running a backtest with risk management enabled, pay attention to:
- Max Drawdown: Should stay within your risk tolerance (ideally under 20%)
- Profit Factor: Should remain above 1.5 even with stops
- Average Win vs. Average Loss: Average win should be larger than average loss when using proper R:R ratios
- Number of trades stopped out: If most trades hit stop-loss, your entry logic may need adjustment