Class AuthenticatedClient
Created by QTSurfer.authenticate(String) (or the
overload that accepts an AuthOptions). Wraps the underlying
api-client, owns a JWT (in memory by default, or in the provided
TokenStore), and transparently re-exchanges the API key for a
fresh JWT when a call returns 401.
Exposes the same workflow surface as QTSurfer: compile,
validateStrategy, strategyState, listStrategies,
deleteStrategy, getStrategyCode, dataset management, backtest,
backtestResult, sweep, exchanges,
instruments, tickers, klines.
Method semantics are unchanged — only the bearer token management differs.
Refresh policy: every call first checks the cached token's known
expires_in window and proactively re-exchanges it (same
POST /v1/auth/token call) a short margin before it would expire —
a session left idle past an hour mints a new token on the next call
instead of sending one already stale. That covers TTL expiry, but not a
token invalidated some other way; for that, a 401 from any call routed
through the generated api-client (prepare, execute, result polling and
standalone result reads, strategy validation and lookup, exchanges,
instruments, tickers, klines) and compile (which talks to
its endpoint directly but carries the same ApiException cause on
a 401) triggers one more POST /v1/auth/token exchange, then the
original call is retried once; a second 401 is surfaced to the caller.
-
Method Summary
Modifier and TypeMethodDescriptionstatic AuthenticatedClientEquivalent toauthenticate(String, AuthOptions)with anullapikey (resolved fromQTSURFER_APIKEY) andAuthOptions.defaults().static AuthenticatedClientauthenticate(String apikey) Equivalent toauthenticate(String, AuthOptions)withAuthOptions.defaults().static AuthenticatedClientauthenticate(String apikey, AuthOptions opts) Mint a fresh session from the given API key.CompletableFuture<com.qtsurfer.api.client.model.ResultMap>backtest(BacktestRequest request) Deprecated.CompletableFuture<com.qtsurfer.api.client.model.ResultMap>backtest(BacktestRequest request, BacktestOptions opts) Deprecated.backtestResult(String exchangeId, String jobId) Deprecated.voidclear()Drop the cached token (in memory and in the store).compile(BacktestRequest request) Convenience overload that compilesBacktestRequest.strategy()withBacktestOptions.defaults(), ignoring every other field of the request.compile(BacktestRequest request, BacktestOptions opts) Convenience overload that compilesBacktestRequest.strategy()with the given options, ignoring every other field of the request.Equivalent tocompile(String, BacktestOptions)withBacktestOptions.defaults().compile(String source, BacktestOptions opts) Compile strategy source into a reusableStrategyhandle.com.qtsurfer.api.client.model.DatasetCreatedcreateDataset(com.qtsurfer.api.client.model.CreateDatasetRequest request) Create a dataset and its first presigned upload session.com.qtsurfer.api.client.model.DatasetWithLinksDeprecated.UsegetDataset(String).com.qtsurfer.api.client.model.DatasetUploadStatedatasetUpload(String datasetId, String uploadId) Deprecated.voiddeleteDataset(String datasetId) Soft-delete a dataset.voiddeleteStrategy(String strategyId) Release a registered strategy: removes it from bothstrategyState(String)andlistStrategies().downloadKlines(String exchangeId, String base, String quote, String hour) Equivalent toklines(String, String, String, String, DownloadFormat)withDownloadFormat.LASTRA.downloadKlines(String exchangeId, String base, String quote, String hour, DownloadFormat format) Download one hour of klines for an instrument as a streamingInputStream.downloadTickers(String exchangeId, String base, String quote, String hour) Equivalent totickers(String, String, String, String, DownloadFormat)withDownloadFormat.LASTRA.downloadTickers(String exchangeId, String base, String quote, String hour, DownloadFormat format) Download one hour of raw tickers for an instrument as a streamingInputStream.com.qtsurfer.api.client.model.AuthTokenResponseReturn the cached token, seeding from theTokenStoreon first use, minting a new one if neither cache nor store hold one, and proactively re-minting one this session already minted once itsexpires_inwindow (minusREFRESH_SKEW) has elapsed — so a session idle past that window mints on the next call instead of sending a token the platform will reject.List<com.qtsurfer.api.client.model.Exchange>Deprecated.UsegetExchanges().CompletableFuture<com.qtsurfer.api.client.model.ResultMap>executeBacktest(BacktestRequest request) Equivalent tobacktest(BacktestRequest, BacktestOptions)withBacktestOptions.defaults().CompletableFuture<com.qtsurfer.api.client.model.ResultMap>executeBacktest(BacktestRequest request, BacktestOptions opts) Run the full compile → prepare → execute pipeline and resolve once the run reaches a terminal state (completed, failed, or canceled).com.qtsurfer.api.client.model.FinalizeDatasetUpload202ResponsefinalizeDatasetUpload(String datasetId, String uploadId) Mark a completed presigned upload ready for ingestion and return its ingest job id.com.qtsurfer.api.client.model.AccountRead the authenticated account's tier and limits.com.qtsurfer.api.client.model.AccountUsageRead current account storage consumption, including retained signals.getBacktestResult(String exchangeId, String jobId) Read what the platform holds for a backtest run, addressed by the exchange it ran on and the id of its execute job.getBoundedSweepRunEquityCurve(String exchangeId, String requestId, String sweepId, int runIx, Integer maxResample) Read a retained sweep curve as normalized absolute points with a bounded server request.com.qtsurfer.api.client.model.DatasetWithLinksgetDataset(String datasetId) Read one dataset and its self link.com.qtsurfer.api.client.model.DatasetImportStategetDatasetImport(String datasetId, String importId) Read the fetch and ingest state for one external-history import.List<com.qtsurfer.api.client.model.Dataset>List the caller's non-deleted datasets, newest first.com.qtsurfer.api.client.model.DatasetUploadStategetDatasetUpload(String datasetId, String uploadId) Read an upload's ingest state after it has been finalized.List<com.qtsurfer.api.client.model.Exchange>List available exchanges on the platform.List<com.qtsurfer.api.client.model.InstrumentDetail>getInstruments(String exchangeId) List instruments available on the given exchange, including per-data-type coverage and market info.List<com.qtsurfer.api.client.model.InstrumentDetail>getInstruments(String exchangeId, String segment) List the instruments of one market segment of the given exchange, including per-data-type coverage and market info.com.qtsurfer.api.client.model.LiveRunRead a strategy's active or most recent live run.com.qtsurfer.api.client.model.LiveSignalPageRead one oldest-first page of retained signals.Optional<com.qtsurfer.api.client.model.LiveSignalPage>getNextLiveSignals(String runId, com.qtsurfer.api.client.model.LiveSignalPage page) Read the next page using its server-provided continuation link.List<com.qtsurfer.api.client.model.StrategySummary>List every strategy registered under this account and not since deleted, most recently compiled first.getStrategyCode(String strategyId) Fetch the exact source last submitted for a registered strategy id — the same textcompile(String)derivedstrategyIdfrom, whitespace and comments included.com.qtsurfer.api.client.model.StrategyStategetStrategyState(String strategyId) Fetch what the platform knows about a registered strategy: that it compiled, what market data the compiled class needs, and what validating it found.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's equity curve with one refresh-on-401 retry.com.qtsurfer.api.client.model.DatasetImportCreatedimportDataset(com.qtsurfer.api.client.model.DatasetImportRequest request) Start an external-history import into a new dataset.List<com.qtsurfer.api.client.model.InstrumentDetail>instruments(String exchangeId) Deprecated.List<com.qtsurfer.api.client.model.InstrumentDetail>instruments(String exchangeId, String segment) Deprecated.Deprecated.Deprecated.List<com.qtsurfer.api.client.model.Dataset>Deprecated.UsegetDatasets().com.qtsurfer.api.client.model.LiveListResponseList the authenticated account's live runs, newest first.com.qtsurfer.api.client.model.PublicLiveListResponselistPublicLive(String cursor, Integer limit) List public live runs, newest first.List<com.qtsurfer.api.client.model.StrategySummary>Deprecated.UsegetStrategies().com.qtsurfer.api.client.model.DatasetUploadSessionopenDatasetUpload(String datasetId) Open or recover the pending upload session for an existing dataset.options()Configuration in use by this session.com.qtsurfer.api.client.model.AuthTokenResponserefresh()Force a fresh JWT exchange viaPOST /v1/auth/token.com.qtsurfer.api.client.model.LiveRunStart a compiled strategy's live run.com.qtsurfer.api.client.model.LiveRunRequest that a strategy's live run stop.com.qtsurfer.api.client.model.StrategyStatestrategyState(String strategyId) Deprecated.sweep(SweepRequest request) Equivalent tosweep(SweepRequest, SweepOptions)withSweepOptions.defaults().sweep(SweepRequest request, SweepOptions opts) Run the full compile → prepare → executeSweep pipeline and resolve once the platform has accepted the sweep, handing back aSweepthat keeps polling the leaderboard in the background.Deprecated.Deprecated.com.qtsurfer.api.client.model.AuthTokenResponsetoken()Most recently minted token, ornullif no exchange has happened yet.com.qtsurfer.api.client.model.LiveRunCompactupdateLive(String runId, com.qtsurfer.api.client.model.UpdateLiveRequest request) Update mutable metadata for a live run.com.qtsurfer.api.client.model.LiveParamsUpdateResultupdateLiveParams(String runId, com.qtsurfer.api.client.model.UpdateLiveParamsRequest request) Update live strategy parameters through a typed request.com.qtsurfer.api.client.model.LiveParamsUpdateResultupdateLiveParams(String runId, UpdateLiveParamsRequestBuilder request) Update live strategy parameters using the SDK's fluent request builder.voiduploadDatasetFile(com.qtsurfer.api.client.model.DatasetCreated created, Path file) Stream a local file to the initial presigned target without attaching API credentials.voiduploadDatasetFile(com.qtsurfer.api.client.model.DatasetUploadSession session, Path file) Stream a local file to a reopened presigned target without attaching API credentials.validateStrategy(String strategyId) Ask the platform to check that a registered strategy can actually run.
-
Method Details
-
options
Configuration in use by this session. -
token
public com.qtsurfer.api.client.model.AuthTokenResponse token()Most recently minted token, ornullif no exchange has happened yet. -
refresh
public com.qtsurfer.api.client.model.AuthTokenResponse refresh()Force a fresh JWT exchange viaPOST /v1/auth/token. Bypasses the cache; the returned token is also written to the configuredTokenStore. -
ensureToken
public com.qtsurfer.api.client.model.AuthTokenResponse ensureToken()Return the cached token, seeding from theTokenStoreon first use, minting a new one if neither cache nor store hold one, and proactively re-minting one this session already minted once itsexpires_inwindow (minusREFRESH_SKEW) has elapsed — so a session idle past that window mints on the next call instead of sending a token the platform will reject. -
clear
public void clear()Drop the cached token (in memory and in the store). -
compile
Equivalent tocompile(String, BacktestOptions)withBacktestOptions.defaults(). -
compile
Compile strategy source into a reusableStrategyhandle.Issues a single synchronous HTTP request; the compile endpoint returns the
strategyIddirectly, so a failing compile surfaces immediately asQTSStrategyCompileErrorrather than on a later poll. A429means the platform was holding too many compilations and the source was never judged, so it is safe to retry; any other error status reflects a judgment on the submitted code and will not succeed by retrying alone. Onlyopts.onProgress()is used; polling and timeout settings do not apply to this stage.Participates in the session's refresh-on-401 policy the same as every other call — both the proactive TTL check before the request is sent and one retry after a reactive refresh if the platform still returns
401(the compile endpoint is called directly rather than through the generated client, but its401carries the sameApiExceptioncause so this session recognizes it). One behavior this session normally guarantees does not apply here: token resolution happens synchronously before the request is sent — on a session with no cached or stored token, this call blocks to mint one and throwsQTSAuthErrordirectly rather than through the returned future. -
compile
Convenience overload that compilesBacktestRequest.strategy()withBacktestOptions.defaults(), ignoring every other field of the request. Seecompile(String, BacktestOptions). -
compile
Convenience overload that compilesBacktestRequest.strategy()with the given options, ignoring every other field of the request. Seecompile(String, BacktestOptions). -
validateStrategy
Ask the platform to check that a registered strategy can actually run. The compiled class is instantiated and driven through a bounded synthetic series, so a wiring fault surfaces here instead of at the first backtest. Synchronous — blocks the calling thread for the HTTP round trip. Participates in the session's refresh-on-401 policy: an unauthorized response triggers one token refresh and one retry of this call. Because the call is idempotent, that retry queues nothing extra.Did this call start work, and is there a verdict? Two questions, two answers. The call is idempotent: it either queues a check, or queues nothing because the current compilation is already accounted for. The returned
ValidationOutcomesays which —ValidationOutcome.Queuedfor the first,ValidationOutcome.NotQueuedfor the second.NotQueueddoes not mean a verdict exists. TheStrategyStateit carries can itself bepending— a check queued by an earlier call, possibly from another process, that has not answered yet. So a caller that wants a verdict has to read one either way:ValidationOutcome.queued()— did this call start a check?StrategyState.getValidation()— is there a verdict right now?passedorfailedis terminal;pendingis not, so pollstrategyState(String)until it leavespending.
Polling needs its own deadline. A queued check can go unreported for far longer than one takes — the platform reports that as
StrategyState.getValidationStalled()— sopendingis not guaranteed to resolve, and a caller that waits without a timeout can wait indefinitely. A stall disproves nothing about the strategy; the check simply has not run. This SDK ships no polling helper.passeddoes not mean the strategy is correct. It means the class loaded and survived the first event of a short synthetic run — a floor, not a guarantee, and not a statement that the strategy is safe to run. WhenStrategyState.getDryRunIncomplete()is true the check did not even finish its budget, so the floor is lower still and an emptyStrategyState.getNotices()list is not a clean bill of health.- Parameters:
strategyId- id of a registered strategy, as returned bycompile(String)- Returns:
- whether this call queued a check, and — when it did not — the state the platform holds
- Throws:
QTSError- on HTTP 4xx/5xx (including404when no such strategy is registered for this caller) or transport failure
-
getStrategyState
Fetch what the platform knows about a registered strategy: that it compiled, what market data the compiled class needs, and what validating it found. Synchronous — blocks the calling thread for the HTTP round trip. Participates in the session's refresh-on-401 policy: an unauthorized response triggers one token refresh and one retry of this call.Resolves to the api-client's
StrategyStaterecord — the platform's view of the strategy — not to the SDK'sStrategyhandle thatcompile(String)produces.This is the endpoint to poll while a check is outstanding, whether
validateStrategy(String)queued it or reported that one was already accounted for. See that method for what a verdict does and does not mean, and for why a polling loop needs its own deadline.A verdict describes the bytecode that produced it, and recompiling supersedes it: when
StrategyState.getCompiledAt()is later thanStrategyState.getValidatedAt(), the recorded verdict was reached against a compilation that is no longer what would run, andvalidateStrategy(String)can be called again to refresh it.A
404means exactly one thing — no such registered strategy for this caller. It is never a stale or expired answer; registration and verdict are stored durably, not cached.- Parameters:
strategyId- id of a registered strategy, as returned bycompile(String)- Returns:
- the platform's record of the strategy
- Throws:
QTSError- on HTTP 4xx/5xx or transport failure
-
strategyState
@Deprecated(forRemoval=false) public com.qtsurfer.api.client.model.StrategyState strategyState(String strategyId) Deprecated. -
getStrategies
List every strategy registered under this account and not since deleted, most recently compiled first. Synchronous — blocks the calling thread for the HTTP round trip. Participates in the session's refresh-on-401 policy: an unauthorized response triggers one token refresh and one retry of this call.Deliberately cheaper than reading each strategy individually: each entry carries the same
compiledAt/requiredSourcesprovenancestrategyState(String)does, but not validation state, so listing stays cheap no matter how many strategies exist. Check a specific strategy's validation withstrategyState(String).Never fails with a
404— an empty list means the caller has no registered strategies, not that the resource is missing.- Returns:
- the caller's registered strategies
- Throws:
QTSError- on HTTP 4xx/5xx or transport failure
-
listStrategies
@Deprecated(forRemoval=false) public List<com.qtsurfer.api.client.model.StrategySummary> listStrategies()Deprecated.UsegetStrategies(). -
deleteStrategy
Release a registered strategy: removes it from bothstrategyState(String)andlistStrategies(). Synchronous — blocks the calling thread for the HTTP round trip. Participates in the session's refresh-on-401 policy: an unauthorized response triggers one token refresh and one retry of this call.Not undone by recompiling the same source. Submitting identical source to
compile(String)afterward registers a brand-new strategy with a brand-new id — it does not "undelete" this one.History is untouched. Backtests already run against this strategy are completely unaffected by deleting it. Deletion only stops the strategy counting against the account and stops future validation or re-run under this id.
Scoped to the caller's own registration. If this id was copied from someone else's strategy (a shared/marketplace listing), deleting it here never affects their copy, or anyone else's copy of the same source.
- Parameters:
strategyId- id of a registered strategy, as returned bycompile(String)- Throws:
QTSError- on HTTP 4xx/5xx (including404when no such strategy is registered for this caller) or transport failure
-
getStrategyCode
Fetch the exact source last submitted for a registered strategy id — the same textcompile(String)derivedstrategyIdfrom, whitespace and comments included. Synchronous — blocks the calling thread for the HTTP round trip. Participates in the session's refresh-on-401 policy: an unauthorized response triggers one token refresh and one retry of this call.A
404here covers two different situations, and deliberately does not distinguish them: the id was never registered by this caller, or it resolves only through a shared/marketplace reference that carries no source of its own. Both mean the same thing from this call's point of view — nothing to return — so both raise the same way.- Parameters:
strategyId- id of a registered strategy, as returned bycompile(String)- Returns:
- the raw strategy source last registered for this id
- Throws:
QTSError- on HTTP 4xx/5xx (including the404above) or transport failure
-
executeBacktest
public CompletableFuture<com.qtsurfer.api.client.model.ResultMap> executeBacktest(BacktestRequest request) Equivalent tobacktest(BacktestRequest, BacktestOptions)withBacktestOptions.defaults(). -
executeBacktest
public CompletableFuture<com.qtsurfer.api.client.model.ResultMap> executeBacktest(BacktestRequest request, BacktestOptions opts) Run the full compile → prepare → execute pipeline and resolve once the run reaches a terminal state (completed, failed, or canceled). The returned future completes exceptionally withQTSStrategyCompileErrorif compilation fails,QTSPreparationErrorif data preparation fails,QTSExecutionErrorif execution fails, orQTSTimeoutErrorif a stage exceeds its configured timeout.A
401at any stage — including compile, seecompile(String, BacktestOptions)— triggers one token refresh and then restarts the entire pipeline from compile, not just the stage that failed.This call resolves the session's token synchronously before scheduling any async work: on a session with no cached or stored token, it blocks to mint one and throws
QTSAuthErrordirectly (not through the returned future) if that mint fails.- Parameters:
opts- tuning knobs (poll interval, timeout, progress callback) applied to every stage of the pipeline
-
backtest
@Deprecated(forRemoval=false) public CompletableFuture<com.qtsurfer.api.client.model.ResultMap> backtest(BacktestRequest request) Deprecated. -
backtest
@Deprecated(forRemoval=false) public CompletableFuture<com.qtsurfer.api.client.model.ResultMap> backtest(BacktestRequest request, BacktestOptions opts) Deprecated. -
getBacktestResult
Read what the platform holds for a backtest run, addressed by the exchange it ran on and the id of its execute job. Synchronous — blocks the calling thread for the HTTP round trip. Participates in the session's refresh-on-401 policy: an unauthorized response triggers one token refresh and one retry of this call. The call only reads, so that retry starts nothing extra.The run does not have to be one this session started. Every other route to a run's numbers in this SDK goes through the handle
backtest(BacktestRequest)orStrategy.backtest(BacktestRequest)hands back, and that handle only exists in the process that submitted the run. A job id that arrived from anywhere else — another client, another session, this one before a restart — has no handle behind it, and this is how to ask the platform about it directly. It compiles nothing, prepares nothing, submits nothing, and starts no second run.A run that ended badly is an answer, not a failure of this call. The
BacktestOutcomehanded back says which of four things the platform is reporting — the run finished, it failed, it was cancelled, or it is still going and has nothing final to say yet. Only a job the platform does not recognise for this caller raises, as a404. That is a deliberate departure fromBacktest.await(), which completes exceptionally on a failed or aborted run: a caller waiting for a result it asked for is not getting one, whereas a caller asking what happened to a job is.Waiting for a run to finish remains
Backtest.await()'s job, on the process that started it. This does not poll — it is a snapshot, andBacktestOutcome.InProgressmeans ask again later.exchangeIdis required and cannot be guessed. A run's result is addressed under the exchange it was submitted against, so a job id on its own does not identify the resource and there is nothing sensible to default the exchange to. An id carried to the wrong exchange does not name the same run.- Parameters:
exchangeId- exchange the run was submitted against (e.g."binance")jobId- id of the execute job, as carried byBacktest.id()on the process that submitted it- Throws:
QTSError- on HTTP 4xx/5xx (including the404above) or transport failure
-
backtestResult
@Deprecated(forRemoval=false) public BacktestOutcome backtestResult(String exchangeId, String jobId) Deprecated. -
sweep
Equivalent tosweep(SweepRequest, SweepOptions)withSweepOptions.defaults().- Parameters:
request- the grid, the instrument, and the window- Returns:
- the handle, once the platform has accepted the sweep
-
sweep
Run the full compile → prepare → executeSweep pipeline and resolve once the platform has accepted the sweep, handing back aSweepthat keeps polling the leaderboard in the background. SeeQTSurfer.sweep(SweepRequest, SweepOptions)for why the sweep is one call rather than composable stages, andSweep.await()for how to read what it found.A
401during compile (seecompile(String, BacktestOptions)), prepare, or submission triggers one token refresh and then restarts the entire pipeline from compile — not just the stage that failed. One limit is worth knowing: this does not cover the background leaderboard poll, which starts after this future has already resolved and surfaces onSweep.await()instead. The handle-scopedSweep.sensitivity()andSweep.cancel()sit outside the policy for the same reason.This call resolves the session's token synchronously before scheduling any async work: on a session with no cached or stored token, it blocks to mint one and throws
QTSAuthErrordirectly (not through the returned future) if that mint fails.- Parameters:
request- the grid, the instrument, and the windowopts- tuning knobs (poll interval, timeout, progress callback, leaderboard ordering) applied to every stage of the pipeline- Returns:
- the handle, once the platform has accepted the sweep
-
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's equity curve with one refresh-on-401 retry.Pass
nullfor a transform argument to inherit that sweep's submission default. The returnedmetasays whether points useARRAYorSHORToutput; do not infer that from the requested mode.- Parameters:
exchangeId- exchange that owns the sweeprequestId- prepared-dataset identifier fromSweep.requestId()sweepId- sweep identifier fromSweep.id()runIx- trial index to readoutMode- requested point representation, ornullfor the sweep defaultresample- maximum point count, ornullfor the sweep defaultdifferential- whether to delta-encode points, ornullfor the sweep default- Returns:
- the retained curve with authoritative response metadata
- Throws:
QTSError- if the sweep/trial is unknown, its curve was not retained, or the request fails
-
getBoundedSweepRunEquityCurve
public BoundedEquityCurve getBoundedSweepRunEquityCurve(String exchangeId, String requestId, String sweepId, int runIx, Integer maxResample) Read a retained sweep curve as normalized absolute points with a bounded server request. -
createDataset
public com.qtsurfer.api.client.model.DatasetCreated createDataset(com.qtsurfer.api.client.model.CreateDatasetRequest request) Create a dataset and its first presigned upload session. -
importDataset
public com.qtsurfer.api.client.model.DatasetImportCreated importDataset(com.qtsurfer.api.client.model.DatasetImportRequest request) Start an external-history import into a new dataset. -
getDatasetImport
public com.qtsurfer.api.client.model.DatasetImportState getDatasetImport(String datasetId, String importId) Read the fetch and ingest state for one external-history import. -
getDatasets
List the caller's non-deleted datasets, newest first. -
listDatasets
Deprecated.UsegetDatasets(). -
getDataset
Read one dataset and its self link. -
dataset
@Deprecated(forRemoval=false) public com.qtsurfer.api.client.model.DatasetWithLinks dataset(String datasetId) Deprecated.UsegetDataset(String). -
deleteDataset
Soft-delete a dataset. Existing runs against it are unaffected. -
finalizeDatasetUpload
public com.qtsurfer.api.client.model.FinalizeDatasetUpload202Response finalizeDatasetUpload(String datasetId, String uploadId) Mark a completed presigned upload ready for ingestion and return its ingest job id. -
getDatasetUpload
public com.qtsurfer.api.client.model.DatasetUploadState getDatasetUpload(String datasetId, String uploadId) Read an upload's ingest state after it has been finalized. -
datasetUpload
@Deprecated(forRemoval=false) public com.qtsurfer.api.client.model.DatasetUploadState datasetUpload(String datasetId, String uploadId) Deprecated. -
openDatasetUpload
Open or recover the pending upload session for an existing dataset.- Parameters:
datasetId- dataset that will receive the next version- Returns:
- presigned upload session to pass to
uploadDatasetFile(DatasetUploadSession, Path) - Throws:
QTSError- on HTTP 4xx/5xx or transport failure
-
getAccount
public com.qtsurfer.api.client.model.Account getAccount()Read the authenticated account's tier and limits. -
getAccountUsage
public com.qtsurfer.api.client.model.AccountUsage getAccountUsage()Read current account storage consumption, including retained signals. -
startLive
public com.qtsurfer.api.client.model.LiveRun startLive(String strategyId, com.qtsurfer.api.client.model.StartLiveRequest request) Start a compiled strategy's live run. -
getLive
Read a strategy's active or most recent live run. -
stopLive
Request that a strategy's live run stop. -
listLive
List the authenticated account's live runs, newest first. -
listPublicLive
public com.qtsurfer.api.client.model.PublicLiveListResponse listPublicLive(String cursor, Integer limit) List public live runs, newest first. -
updateLive
public com.qtsurfer.api.client.model.LiveRunCompact updateLive(String runId, com.qtsurfer.api.client.model.UpdateLiveRequest request) Update mutable metadata for a live run. -
updateLiveParams
public com.qtsurfer.api.client.model.LiveParamsUpdateResult updateLiveParams(String runId, com.qtsurfer.api.client.model.UpdateLiveParamsRequest request) Update live strategy parameters through a typed request. -
updateLiveParams
public com.qtsurfer.api.client.model.LiveParamsUpdateResult updateLiveParams(String runId, UpdateLiveParamsRequestBuilder request) Update live strategy parameters using the SDK's fluent request builder. -
getLiveSignals
public com.qtsurfer.api.client.model.LiveSignalPage getLiveSignals(String runId, Long sinceMs, String instrument, String cursor, Integer limit) Read one oldest-first page of retained signals. -
getNextLiveSignals
public Optional<com.qtsurfer.api.client.model.LiveSignalPage> getNextLiveSignals(String runId, com.qtsurfer.api.client.model.LiveSignalPage page) Read the next page using its server-provided continuation link. -
uploadDatasetFile
Stream a local file to the initial presigned target without attaching API credentials.- Parameters:
created- result returned bycreateDataset(CreateDatasetRequest)file- readable regular file to upload- Throws:
QTSUploadError- when the transfer fails
-
uploadDatasetFile
public void uploadDatasetFile(com.qtsurfer.api.client.model.DatasetUploadSession session, Path file) Stream a local file to a reopened presigned target without attaching API credentials.- Parameters:
session- session returned byopenDatasetUpload(String)file- readable regular file to upload- Throws:
QTSUploadError- when the transfer fails
-
getExchanges
List available exchanges on the platform. Synchronous — blocks the calling thread for the HTTP round trip. Participates in the session's refresh-on-401 policy: an unauthorized response triggers one token refresh and one retry of this call.- Throws:
QTSError- on HTTP 4xx/5xx or transport failure
-
exchanges
Deprecated.UsegetExchanges(). -
getInstruments
List instruments available on the given exchange, including per-data-type coverage and market info. Synchronous — blocks the calling thread for the HTTP round trip. Participates in the session's refresh-on-401 policy: an unauthorized response triggers one token refresh and one retry of this call.- Parameters:
exchangeId- exchange identifier (e.g."binance")- Throws:
QTSError- on HTTP 4xx/5xx or transport failure
-
instruments
@Deprecated(forRemoval=false) public List<com.qtsurfer.api.client.model.InstrumentDetail> instruments(String exchangeId) Deprecated. -
getInstruments
public List<com.qtsurfer.api.client.model.InstrumentDetail> getInstruments(String exchangeId, String segment) List the instruments of one market segment of the given exchange, including per-data-type coverage and market info. Synchronous — blocks the calling thread for the HTTP round trip. Participates in the session's refresh-on-401 policy: an unauthorized response triggers one token refresh and one retry of this call.Unwraps the same
InstrumentListResponseHAL envelope asinstruments(String)and returns just the instrument list. The single-argument overload is the default-segment shortcut and lists thespotsegment.- Parameters:
exchangeId- exchange identifier (e.g."binance")segment- market segment to list:"spot"or"futures"- Returns:
- the instruments of that segment
- Throws:
QTSError- on HTTP 4xx/5xx or transport failure
-
instruments
@Deprecated(forRemoval=false) public List<com.qtsurfer.api.client.model.InstrumentDetail> instruments(String exchangeId, String segment) Deprecated. -
downloadTickers
Equivalent totickers(String, String, String, String, DownloadFormat)withDownloadFormat.LASTRA. -
downloadTickers
public InputStream downloadTickers(String exchangeId, String base, String quote, String hour, DownloadFormat format) Download one hour of raw tickers for an instrument as a streamingInputStream. Synchronous; the caller is responsible for closing the returned stream. Participates in the session's refresh-on-401 policy: an unauthorized response triggers one token refresh and one retry of this call.- Throws:
QTSDownloadError- on HTTP 4xx/5xx or transport failure
-
tickers
@Deprecated(forRemoval=false) public InputStream tickers(String exchangeId, String base, String quote, String hour) Deprecated. -
tickers
@Deprecated(forRemoval=false) public InputStream tickers(String exchangeId, String base, String quote, String hour, DownloadFormat format) Deprecated. -
downloadKlines
Equivalent toklines(String, String, String, String, DownloadFormat)withDownloadFormat.LASTRA. -
downloadKlines
public InputStream downloadKlines(String exchangeId, String base, String quote, String hour, DownloadFormat format) Download one hour of klines for an instrument as a streamingInputStream. Seetickers(String, String, String, String, DownloadFormat)for blocking, closing, and refresh semantics.- Throws:
QTSDownloadError- on HTTP 4xx/5xx or transport failure
-
klines
@Deprecated(forRemoval=false) public InputStream klines(String exchangeId, String base, String quote, String hour) Deprecated. -
klines
@Deprecated(forRemoval=false) public InputStream klines(String exchangeId, String base, String quote, String hour, DownloadFormat format) Deprecated. -
authenticate
Mint a fresh session from the given API key.If
apikeyisnullor blank, the value is read from theQTSURFER_APIKEYenvironment variable. AQTSAuthErroris raised when neither source yields a usable API key, or when the initial JWT exchange fails. -
authenticate
Equivalent toauthenticate(String, AuthOptions)withAuthOptions.defaults(). -
authenticate
Equivalent toauthenticate(String, AuthOptions)with anullapikey (resolved fromQTSURFER_APIKEY) andAuthOptions.defaults().
-
executeBacktest(BacktestRequest).