Record Class SweepRequest

java.lang.Object
java.lang.Record
com.qtsurfer.api.sdk.SweepRequest
Record Components:
strategy - strategy source code (Java), compiled once and reused by every trial
exchangeId - exchange identifier, e.g. "binance", or the reserved value "user" for a dataset-backed sweep
instrument - instrument symbol, e.g. "BTC/USDT"; mutually exclusive with datasetId — exactly one of the two must be set
from - range start (ISO-8601, ISO DATE, or BASIC ISO DATE)
to - range end (same formats as from; must be > from)
params - the grid: one ParamAxis per strategy property to vary. At least one
sampler - how the grid becomes the list of vectors actually run; null keeps the platform default (the full cross product)
samples - how many vectors to draw for SweepSampler.RANDOM and SweepSampler.LHS; ignored by SweepSampler.GRID
seed - reproducibility seed. null lets the platform generate one and report it back on ExecuteSweepAccepted.getSeed(), so a randomly sampled sweep can be replayed exactly by submitting the same seed again
objective - the metric to optimize and rank by; null keeps the platform default. It is also what Sweep.sensitivity() aggregates unless told otherwise
walkForward - opt into walk-forward validation, which changes both what runs and the shape of the answer; null runs an ordinary sweep. See WalkForwardSpec
datasetId - id of a dataset created with QTSurfer.createDataset(com.qtsurfer.api.client.model.CreateDatasetRequest); mutually exclusive with instrument
datasetVersionId - pins a specific past version of datasetId instead of its current one; only valid alongside a non-null datasetId
equityCurve - which sweep trials retain curves and their default read transform; null keeps the platform defaults
storeSignals - when Boolean.TRUE, retain emitted signals for every trial; null keeps the platform default

public record SweepRequest(String strategy, String exchangeId, String instrument, String from, String to, Map<String,ParamAxis> params, SweepSampler sampler, Integer samples, Long seed, SweepObjective objective, WalkForwardSpec walkForward, String datasetId, String datasetVersionId, com.qtsurfer.api.client.model.EquityCurveRequest equityCurve, Boolean storeSignals) extends Record
A parameter sweep over one instrument and one window: the same strategy run once per parameter vector, scored and ranked against a single objective.

 SweepRequest request = SweepRequest.builder()
     .strategy(source)
     .exchangeId("binance")
     .instrument("BTC/USDT")
     .from("2026-01-01T00:00:00Z")
     .to("2026-02-01T00:00:00Z")
     .param("rsi.period", ParamAxis.range(7, 28, 1))
     .param("useTrendFilter", ParamAxis.of(true, false))
     .objective(SweepObjective.SHARPE)
     .build();
 

Against a caller-uploaded dataset, set datasetId instead of instrument (and use the reserved exchangeId value "user"); the two are mutually exclusive:


 SweepRequest request = SweepRequest.builder()
     .strategy(source)
     .exchangeId("user")
     .datasetId("ds_3f9a1c2e7b0d4a5f")
     .from("2026-01-01T00:00:00Z")
     .to("2026-02-01T00:00:00Z")
     .param("rsi.period", ParamAxis.range(7, 28, 1))
     .objective(SweepObjective.SHARPE)
     .build();
 
  • Constructor Details

  • Method Details

    • builder

      public static SweepRequest.Builder builder()
      Start building a request.
      Returns:
      a fresh builder
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • strategy

      public String strategy()
      Returns the value of the strategy record component.
      Returns:
      the value of the strategy record component
    • exchangeId

      public String exchangeId()
      Returns the value of the exchangeId record component.
      Returns:
      the value of the exchangeId record component
    • instrument

      public String instrument()
      Returns the value of the instrument record component.
      Returns:
      the value of the instrument record component
    • from

      public String from()
      Returns the value of the from record component.
      Returns:
      the value of the from record component
    • to

      public String to()
      Returns the value of the to record component.
      Returns:
      the value of the to record component
    • params

      public Map<String,ParamAxis> params()
      Returns the value of the params record component.
      Returns:
      the value of the params record component
    • sampler

      public SweepSampler sampler()
      Returns the value of the sampler record component.
      Returns:
      the value of the sampler record component
    • samples

      public Integer samples()
      Returns the value of the samples record component.
      Returns:
      the value of the samples record component
    • seed

      public Long seed()
      Returns the value of the seed record component.
      Returns:
      the value of the seed record component
    • objective

      public SweepObjective objective()
      Returns the value of the objective record component.
      Returns:
      the value of the objective record component
    • walkForward

      public WalkForwardSpec walkForward()
      Returns the value of the walkForward record component.
      Returns:
      the value of the walkForward record component
    • datasetId

      public String datasetId()
      Returns the value of the datasetId record component.
      Returns:
      the value of the datasetId record component
    • datasetVersionId

      public String datasetVersionId()
      Returns the value of the datasetVersionId record component.
      Returns:
      the value of the datasetVersionId record component
    • equityCurve

      public com.qtsurfer.api.client.model.EquityCurveRequest equityCurve()
      Returns the value of the equityCurve record component.
      Returns:
      the value of the equityCurve record component
    • storeSignals

      public Boolean storeSignals()
      Returns the value of the storeSignals record component.
      Returns:
      the value of the storeSignals record component