DocsBacktesting
Configuration
Every backtest runs with a set of configuration options that control portfolio sizing, fees, and risk behavior.
Portfolio Settings
| Setting | Default | Description |
|---|---|---|
| Portfolio Amount | 10,000 | Starting capital in quote currency |
| Portfolio Currency | Auto | Detected from the symbol (e.g., USDT for BTCUSDT) |
| Portfolio Type | USD | How capital is tracked — USD, ASSET, or MIXED |
Portfolio types:
- USD — Track everything in quote currency. Best for long-only strategies.
- ASSET — Track in base currency. Useful for accumulation strategies.
- MIXED — Track both. Required for short selling.
Trading Mode
| Mode | Description |
|---|---|
| Long Only | Buy low, sell high. The default for most strategies. |
| Short Only | Sell high, buy low. Automatically uses MIXED portfolio. |
| Bidirectional | Both long and short positions allowed. |
Fees and Slippage
| Setting | Default | Description |
|---|---|---|
| Trading Fee | 0.1% | Applied to each trade (entry and exit) |
| Slippage | 0% | Additional cost to simulate market impact |
Fees are critical to realistic results. A strategy that is profitable at 0% fees may be unprofitable at 0.1%.
Exit Management
Optional stop loss and take profit levels:
| Setting | Default | Description |
|---|---|---|
| Stop Loss | 0% (disabled) | Close position if loss exceeds this percentage |
| Take Profit | 0% (disabled) | Close position if profit exceeds this percentage |
| Trailing Stop | 0% (disabled) | Stop loss that follows the price as it moves in your favor |
These are applied at the engine level and override any exit logic in your strategy code.
Next Steps
- Reading Results — Interpreting your backtest output
- Trading Modes — Detailed guide to trading modes
configurationportfoliofeestrading modestop losstake profitslippage