Class SweepWorkflow

java.lang.Object
com.qtsurfer.api.sdk.workflows.SweepWorkflow

public final class SweepWorkflow extends Object
Orchestrates compile → prepare → executeSweep over com.qtsurfer:api-client, and polls the leaderboard until the sweep stops advancing. Sibling of BacktestWorkflow, sharing its prepare stage and its polling loop.

One call, not composable stages, and deliberately so. The execute-sweep endpoint is addressed by the id of an already-prepared dataset, so a stage-level API would hand dataset lifecycle to the caller for no gain. Preparing is idempotent — the same instrument and window always resolve to the same job — so preparing on every sweep duplicates no work.

  • Constructor Details

    • SweepWorkflow

      public SweepWorkflow(StrategyCompileClient strategyClient, com.qtsurfer.api.client.api.BacktestingApi backtestingApi, Executor executor)
      Parameters:
      strategyClient - compiles strategy source
      backtestingApi - the generated backtesting api
      executor - runs the submission and the background poll
  • Method Details

    • submit

      public CompletableFuture<Sweep> submit(SweepRequest req, SweepOptions opts)
      Compile, prepare, and submit the sweep. Resolves with a Sweep once the platform has accepted it; the leaderboard keeps being polled in the background to feed progress events and resolve Sweep.await().
      Parameters:
      req - the grid, the instrument, and the window
      opts - tuning knobs; null takes SweepOptions.defaults()
      Returns:
      the handle, once accepted