DocsBacktesting

Configuration

Every backtest runs with a set of configuration options that control portfolio sizing, fees, and risk behavior.

Portfolio Settings

SettingDefaultDescription
Portfolio Amount10,000Starting capital in quote currency
Portfolio CurrencyAutoDetected from the symbol (e.g., USDT for BTCUSDT)
Portfolio TypeUSDHow 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

ModeDescription
Long OnlyBuy low, sell high. The default for most strategies.
Short OnlySell high, buy low. Automatically uses MIXED portfolio.
BidirectionalBoth long and short positions allowed.

Fees and Slippage

SettingDefaultDescription
Trading Fee0.1%Applied to each trade (entry and exit)
Slippage0%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:

SettingDefaultDescription
Stop Loss0% (disabled)Close position if loss exceeds this percentage
Take Profit0% (disabled)Close position if profit exceeds this percentage
Trailing Stop0% (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

configurationportfoliofeestrading modestop losstake profitslippage