Documentation Index
Fetch the complete documentation index at: https://mintlify.com/theonetrade/backtest-kit/llms.txt
Use this file to discover all available pages before exploring further.
setConfig lets you override any subset of Backtest Kit’s global execution parameters before starting backtests or live sessions. All parameters have validated defaults; calling setConfig with a partial object merges your overrides into the current configuration without resetting unspecified fields.
setConfig
Partial configuration object. Only the keys you provide are updated; all other settings remain unchanged.
Skip configuration validation checks. Intended for internal testing and testbed environments only.
getConfig
Returns a shallow copy of the current global configuration. Use for inspection without risking accidental mutations.getDefaultConfig
Returns a read-only reference to the original default configuration. Use to reset a specific field or compare current values against defaults.Configuration Options
Percentage slippage applied once on entry and once on exit (two transactions total). Simulates market impact and order book depth.
0.1 = 0.1% per transaction.Exchange fee percentage per transaction. Applied twice for entry + exit.
0.1 = 0.1% per transaction (0.2% round-trip).Maximum minutes a scheduled signal waits for price to reach
priceOpen before being auto-cancelled with reason: "timeout". Set to Infinity to disable timeouts.Number of 1-minute candles used to compute VWAP in
getAveragePrice. Higher values produce smoother prices but add latency to the price signal.Window size in minutes for order book time-range alignment. Controls how
from and to are computed for getOrderBook requests.Default number of price levels requested from each side (bids and asks) when
depth is not explicitly passed to getOrderBook.Maximum minutes per aggregated trades window. Dictates the
[from, to] span for getAggregatedTrades and each pagination chunk. Required by exchanges like Binance that cap the time range per request.Minimum distance between
priceOpen and priceTakeProfit as a percentage. Must exceed total round-trip costs (slippage + fees) to ensure profitable trades. The framework rejects signals that fail this check.Minimum distance between
priceOpen and priceStopLoss. Prevents signals from being stopped out immediately by normal market noise.Maximum stop-loss distance. Prevents catastrophically wide SL levels that would expose the full position to excessive loss.
Default dollar cost for each position entry (
ISignalDto.cost default and each DCA entry via commitAverageBuy).When
true, commitAverageBuy is accepted even if currentPrice is not a new all-time low entry price — only requires price to be below priceOpen. Allows averaging even after price has rebounded.Additional profit buffer required beyond round-trip costs before breakeven can be set. Adds a safety margin:
threshold = (CC_PERCENT_SLIPPAGE + CC_PERCENT_FEE) * 2 + CC_BREAKEVEN_THRESHOLD.Example
Call
setConfig before registering any schemas (addExchangeSchema, addStrategySchema) for the configuration to take effect for all framework services.