Record Class BacktestRequest

java.lang.Object
java.lang.Record
com.qtsurfer.api.sdk.BacktestRequest
Record Components:
strategy - strategy source code (Java)
exchangeId - exchange identifier, e.g. "binance", or the reserved value "user" for a dataset-backed request
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)
storeSignals - when Boolean.TRUE, the worker uploads emitted signals to object storage and the result includes signalsUrl / signalsId; null keeps the server default
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 - requested server-side transform for the inline result curve; null keeps the platform defaults
baseConfig - optional execution capital, fee, and position configuration; null keeps the platform defaults
params - scalar strategy properties for this run; an empty map keeps every declared property at its default

public record BacktestRequest(String strategy, String exchangeId, String instrument, String from, String to, Boolean storeSignals, String datasetId, String datasetVersionId, com.qtsurfer.api.client.model.EquityCurveOptions equityCurve, com.qtsurfer.api.client.model.SweepBaseConfig baseConfig, Map<String,Object> params) extends Record
A single-instrument backtest request.

Two mutually exclusive data sources. Against a managed exchange, set instrument and leave datasetId unset:


 BacktestRequest request = BacktestRequest.builder()
     .strategy(source)
     .exchangeId("binance")
     .instrument("BTC/USDT")
     .from("2026-01-01T00:00:00Z")
     .to("2026-02-01T00:00:00Z")
     .build();
 

Against a caller-uploaded dataset, set datasetId instead (and use the reserved exchangeId value "user"); instrument is left unset since it comes from the dataset itself. datasetVersionId is optional and pins a specific past version instead of the dataset's current one:


 BacktestRequest request = BacktestRequest.builder()
     .strategy(source)
     .exchangeId("user")
     .datasetId("ds_3f9a1c2e7b0d4a5f")
     .from("2026-01-01T00:00:00Z")
     .to("2026-02-01T00:00:00Z")
     .build();
 
  • Constructor Details

    • BacktestRequest

      public BacktestRequest(String strategy, String exchangeId, String instrument, String from, String to, Boolean storeSignals, String datasetId, String datasetVersionId)
    • BacktestRequest

      public BacktestRequest(String strategy, String exchangeId, String instrument, String from, String to, Boolean storeSignals, String datasetId, String datasetVersionId, com.qtsurfer.api.client.model.EquityCurveOptions equityCurve)
      Compatibility constructor for callers that set an equity-curve transform.
    • BacktestRequest

      public BacktestRequest(String strategy, String exchangeId, String instrument, String from, String to, Boolean storeSignals, String datasetId, String datasetVersionId, com.qtsurfer.api.client.model.EquityCurveOptions equityCurve, com.qtsurfer.api.client.model.SweepBaseConfig baseConfig, Map<String,Object> params)
      Creates an instance of a BacktestRequest record class.
      Parameters:
      strategy - the value for the strategy record component
      exchangeId - the value for the exchangeId record component
      instrument - the value for the instrument record component
      from - the value for the from record component
      to - the value for the to record component
      storeSignals - the value for the storeSignals record component
      datasetId - the value for the datasetId record component
      datasetVersionId - the value for the datasetVersionId record component
      equityCurve - the value for the equityCurve record component
      baseConfig - the value for the baseConfig record component
      params - the value for the params record component
  • Method Details

    • builder

      public static BacktestRequest.Builder 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
    • storeSignals

      public Boolean storeSignals()
      Returns the value of the storeSignals record component.
      Returns:
      the value of the storeSignals 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.EquityCurveOptions equityCurve()
      Returns the value of the equityCurve record component.
      Returns:
      the value of the equityCurve record component
    • baseConfig

      public com.qtsurfer.api.client.model.SweepBaseConfig baseConfig()
      Returns the value of the baseConfig record component.
      Returns:
      the value of the baseConfig record component
    • params

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