@qtsurfer/api-client
    Preparing search index...

    Function executeBacktest

    • Execute a compiled strategy against a prepared dataset Enqueues an execute task that runs the strategy identified by strategyId over the data prepared by the prepare job identified by prepareJobId. The instrument and date range are recovered from the prepare job — they do not need to be sent again.

      Returns immediately with a jobId; poll GET /backtest/{exchangeId}/{type}/execute/{jobId} for the result.

      type must be a source that can be executed: ticker or kline. A kline strategy is fed bars of the cadence its prepareJobId was prepared at — chosen by you when preparing, not by the strategy. funding can be prepared but not executed yet: it is rejected with 400 before anything is queued.

      Optionally takes params: strategy properties for this one run, applied without recompiling. This is how a sweep leaderboard winner gets re-run for its equityCurve — a sweep row carries the ten ranking metrics but never a curve, whatever its size. Compile once, call this endpoint N times with different params, and each response is an ordinary backtest result with the curve included.

      The same request (same prepareJobId, strategyId, storeSignals, equityCurve, baseConfig, params) always returns the same jobId (idempotent) — a request that omits equityCurve, baseConfig or params dedupes exactly as it did before those fields existed. Two different params vectors over one prepare are two different jobs, and 9 and 9.0 are the same one.

      The re-run is an independent execution rather than a replay of the sweep trial — the two paths do not share a simulator — but they are pinned to agree: one vector run both ways matches on every leaderboard metric, asserted as a regression test. Treat a difference as a bug worth reporting, not as expected behaviour.

      Optionally takes baseConfig, the same SweepBaseConfig shape executeSweep accepts — initialFunding, feeRate, percentAmountToLock, etc. — so the same object can be reused against either endpoint. This endpoint has one effective fee rate rather than a sweep's independent buy/sell legs: a baseConfig that resolves to different buy/sell rates, or sets a non-default feeLeg, is rejected with 400 rather than silently collapsed to one side.

      Works unchanged for a dataset-backed prepare (exchangeId: user) — the request body is identical either way, since the instrument and range are recovered from prepareJobId.

      Type Parameters

      • ThrowOnError extends boolean = false

      Returns RequestResult<AcceptedJob, ResponseError, ThrowOnError>