Package com.qtsurfer.api.sdk.workflows
Class BacktestWorkflow
java.lang.Object
com.qtsurfer.api.sdk.workflows.BacktestWorkflow
Orchestrates compile → prepare → execute over
com.qtsurfer:api-client.
Exposes the flow as three composable async primitives:
compile(java.lang.String, com.qtsurfer.api.sdk.BacktestOptions), submitExecution(com.qtsurfer.api.sdk.Strategy, com.qtsurfer.api.sdk.BacktestRequest, com.qtsurfer.api.sdk.BacktestOptions), and the shortcut runFull(com.qtsurfer.api.sdk.BacktestRequest, com.qtsurfer.api.sdk.BacktestOptions).-
Constructor Summary
ConstructorsConstructorDescriptionBacktestWorkflow(StrategyCompileClient strategyClient, com.qtsurfer.api.client.api.BacktestingApi backtestingApi, Executor executor) -
Method Summary
Modifier and TypeMethodDescriptioncompile(String source, BacktestOptions opts) Compile a strategy (synchronous on the wire) and return its handle.com.qtsurfer.api.client.model.EquityCurveResultgetSweepRunEquityCurve(String exchangeId, String requestId, String sweepId, int runIx, com.qtsurfer.api.client.model.EquityCurveOutMode outMode, Integer resample, Boolean differential) Read a retained sweep trial curve without starting or polling a sweep.readResult(String exchangeId, String jobId) Read an execute job's result as the platform holds it right now, without running or re-running anything.CompletableFuture<com.qtsurfer.api.client.model.ResultMap>runFull(BacktestRequest req, BacktestOptions opts) v0.1-compat shortcut: compile + prepare + execute + await, as a single future.submitExecution(Strategy strategy, BacktestRequest req, BacktestOptions opts) Prepare + submit execute for the given strategy.
-
Constructor Details
-
BacktestWorkflow
public BacktestWorkflow(StrategyCompileClient strategyClient, com.qtsurfer.api.client.api.BacktestingApi backtestingApi, Executor executor)
-
-
Method Details
-
compile
Compile a strategy (synchronous on the wire) and return its handle. -
submitExecution
public CompletableFuture<Backtest> submitExecution(Strategy strategy, BacktestRequest req, BacktestOptions opts) Prepare + submit execute for the given strategy. Returns aBacktestonce the execute request has been accepted; polling of the execution continues in the background to feed progress events and resolveBacktest.await(). -
runFull
public CompletableFuture<com.qtsurfer.api.client.model.ResultMap> runFull(BacktestRequest req, BacktestOptions opts) v0.1-compat shortcut: compile + prepare + execute + await, as a single future. -
readResult
Read an execute job's result as the platform holds it right now, without running or re-running anything.Classified through
BacktestOutcomes, which applies the sameStatusNormalizerrule this class's own poll stops on: the read and the poll agree on what a status means because they ask the same question of the same helper.Nothing here raises for a run that ended badly. The poll converts
FAILEDandABORTEDinto exceptions because abacktest(...)caller asked for a result and is not getting one; a caller who asked what happened to a job is getting an answer, so it travels in the return value.- Parameters:
exchangeId- the exchange the run was submitted againstjobId- the execute job id- Returns:
- what the platform has to say about the run
- Throws:
QTSError- on HTTP 4xx/5xx or transport failure — a plainQTSError, not theQTSExecutionErrorthe poll raises, because nothing this read can raise is about an execution any more
-
getSweepRunEquityCurve
public com.qtsurfer.api.client.model.EquityCurveResult getSweepRunEquityCurve(String exchangeId, String requestId, String sweepId, int runIx, com.qtsurfer.api.client.model.EquityCurveOutMode outMode, Integer resample, Boolean differential) Read a retained sweep trial curve without starting or polling a sweep.
-