Package com.qtsurfer.api.sdk
Class Backtest
java.lang.Object
com.qtsurfer.api.sdk.Backtest
Handle for a running backtest execution. Returned by
Strategy.backtest(com.qtsurfer.api.sdk.BacktestRequest, com.qtsurfer.api.sdk.BacktestOptions)
once the execute request has been accepted by the backend.
await()resolves with the finalResultMapwhen polling completes.progress()streamsBacktestProgressevents through aFlow.Publisher.cancel()triggers a best-effort server-sidecancelExecution.state()returns a local snapshot of the lifecycle.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumExecution lifecycle as observed by the SDK. -
Constructor Summary
ConstructorsConstructorDescriptionBacktest(String id, Strategy strategy, CompletableFuture<com.qtsurfer.api.client.model.ResultMap> result, Flow.Publisher<BacktestProgress> progress, AtomicReference<Backtest.State> state, Runnable cancelHook) Internal constructor used by the SDK workflow; not part of the public contract. -
Method Summary
Modifier and TypeMethodDescriptionCompletableFuture<com.qtsurfer.api.client.model.ResultMap>await()Resolves with the final ResultMap.booleancancel()Request cancellation.id()Server-side execute jobId.progress()Reactive-streams feed of progress events; terminates when the job reaches a terminal state.state()Local snapshot of the execution lifecycle; does not itself contact the server.strategy()TheStrategythis backtest was run against.toString()Compact debug representation including the job id and current state.
-
Constructor Details
-
Backtest
public Backtest(String id, Strategy strategy, CompletableFuture<com.qtsurfer.api.client.model.ResultMap> result, Flow.Publisher<BacktestProgress> progress, AtomicReference<Backtest.State> state, Runnable cancelHook) Internal constructor used by the SDK workflow; not part of the public contract.
-
-
Method Details
-
id
Server-side execute jobId. -
strategy
TheStrategythis backtest was run against. -
state
Local snapshot of the execution lifecycle; does not itself contact the server. -
progress
Reactive-streams feed of progress events; terminates when the job reaches a terminal state. -
await
Resolves with the final ResultMap. Completes exceptionally on failure or cancellation. -
cancel
public boolean cancel()Request cancellation. Cancels the underlying polling future and best-effort callscancelExecutionserver-side.- Returns:
trueif the call caused a transition fromBacktest.State.EXECUTING
-
toString
Compact debug representation including the job id and current state.
-