@qtsurfer/api-client 0.16.0 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -2
- package/dist/index.d.ts +742 -21
- package/dist/index.js +123 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/generated/schemas.gen.ts +578 -7
- package/src/generated/sdk.gen.ts +355 -8
- package/src/generated/types.gen.ts +648 -12
package/dist/index.d.ts
CHANGED
|
@@ -272,8 +272,17 @@ type Exchange = {
|
|
|
272
272
|
};
|
|
273
273
|
/**
|
|
274
274
|
* Managed exchange data sources available for backtesting.
|
|
275
|
+
*
|
|
276
|
+
* * `ticker` — trades. Can be prepared, executed and swept.
|
|
277
|
+
* * `kline` — aggregated bars (candlesticks). Can be prepared, executed and swept. A run reads
|
|
278
|
+
* bars of the `cadence` the data was prepared at: you choose the bar width when you prepare,
|
|
279
|
+
* and the strategy does not fix it. See `PrepareRequest.cadence` for the accepted values.
|
|
280
|
+
* * `funding` — funding rates. Can be **prepared but not executed or swept yet**: a `funding`
|
|
281
|
+
* request to `execute` or `executeSweep` is rejected with `400` before anything is queued,
|
|
282
|
+
* and the message names the sources that can be run.
|
|
283
|
+
*
|
|
275
284
|
*/
|
|
276
|
-
type DataSourceType = "ticker";
|
|
285
|
+
type DataSourceType = "ticker" | "kline" | "funding";
|
|
277
286
|
/**
|
|
278
287
|
* Two shapes, chosen by the `exchangeId` path segment. Against a managed exchange,
|
|
279
288
|
* `instrument` is required and `datasetId`/`datasetVersionId` are ignored. Against the
|
|
@@ -322,9 +331,14 @@ type PrepareRequest = {
|
|
|
322
331
|
* than the source, or not an exact multiple of it, returns `400`. What's accepted, and
|
|
323
332
|
* what omitting it means, depends on the source:
|
|
324
333
|
*
|
|
325
|
-
* * Managed exchange — one of `1s`, `5s`, `1m`, `3m`, `5m`, `15m`,
|
|
326
|
-
* `4h`, `8h`, `12h`, `1d`, `1w`, `1q`; any other label returns `400`.
|
|
327
|
-
* the publisher's native cadence.
|
|
334
|
+
* * Managed exchange, `ticker` or `funding` — one of `1s`, `5s`, `1m`, `3m`, `5m`, `15m`,
|
|
335
|
+
* `30m`, `1h`, `2h`, `4h`, `8h`, `12h`, `1d`, `1w`, `1q`; any other label returns `400`.
|
|
336
|
+
* Omitted = `1s`, the publisher's native cadence.
|
|
337
|
+
* * Managed exchange, `kline` — one of `1s`, `1m`, `5m`, `15m`, `30m`, `1h`, `4h`, `1d`;
|
|
338
|
+
* any other label, including `5s`, `3m` and `8h`, returns `400` and names the accepted
|
|
339
|
+
* ones. Omitted = `1s`. This is the width of the bars a run reads: it is chosen here,
|
|
340
|
+
* once, and the same strategy can be run at several cadences by preparing the range at
|
|
341
|
+
* each.
|
|
328
342
|
* * Dataset (`exchangeId: user`) — omitted = the dataset version's own discovered
|
|
329
343
|
* `cadence` (see `DatasetVersion.cadence`), served as-is. Any cadence equal to or
|
|
330
344
|
* coarser than it and an exact multiple of it is accepted, including ones outside the
|
|
@@ -1045,8 +1059,9 @@ type EquityCurveResult = {
|
|
|
1045
1059
|
};
|
|
1046
1060
|
/**
|
|
1047
1061
|
* Unique identifier for a compiled strategy, derived from the source itself: the same code
|
|
1048
|
-
* always yields the same id, for every caller
|
|
1049
|
-
* `POST /strategy` for exactly which rewrites preserve it and which do
|
|
1062
|
+
* always yields the same id, for every caller. How much formatting the id ignores depends on
|
|
1063
|
+
* the language — see `POST /strategy` for exactly which rewrites preserve it and which do
|
|
1064
|
+
* not.
|
|
1050
1065
|
*
|
|
1051
1066
|
*/
|
|
1052
1067
|
type StrategyId = string;
|
|
@@ -1663,6 +1678,277 @@ type AuthTokenError = {
|
|
|
1663
1678
|
*/
|
|
1664
1679
|
message: string;
|
|
1665
1680
|
};
|
|
1681
|
+
/**
|
|
1682
|
+
* One market feed a live run consumes. Exactly one entry per run today.
|
|
1683
|
+
*/
|
|
1684
|
+
type LiveSource = {
|
|
1685
|
+
/**
|
|
1686
|
+
* Venue category. `cx` (centralized exchange) is the only one live runs support today.
|
|
1687
|
+
*/
|
|
1688
|
+
venueType: string;
|
|
1689
|
+
exchange: string;
|
|
1690
|
+
segment: string;
|
|
1691
|
+
/**
|
|
1692
|
+
* Both `ticker` and `kline` connect to the lightest (fastest) cadence available for the exchange — today, 1 tick/second on every supported exchange. Choosing a specific cadence is not offered yet.
|
|
1693
|
+
*/
|
|
1694
|
+
type: "ticker" | "kline";
|
|
1695
|
+
/**
|
|
1696
|
+
* Instrument symbols, or `["*"]` for every instrument the exchange/segment offers (tier-gated).
|
|
1697
|
+
*/
|
|
1698
|
+
instruments: Array<string>;
|
|
1699
|
+
};
|
|
1700
|
+
type StartLiveRequest = {
|
|
1701
|
+
sources: [LiveSource];
|
|
1702
|
+
/**
|
|
1703
|
+
* Strategy parameters to start with. Opaque key/value pairs — see this strategy's own `declaredProperties` (from `POST /strategy`) for the keys it accepts.
|
|
1704
|
+
*/
|
|
1705
|
+
params?: {
|
|
1706
|
+
[key: string]: unknown;
|
|
1707
|
+
};
|
|
1708
|
+
/**
|
|
1709
|
+
* A `public` run appears in `GET /live/public` and its signal channel accepts subscriptions from anyone, not only you.
|
|
1710
|
+
*/
|
|
1711
|
+
visibility?: "private" | "public";
|
|
1712
|
+
/**
|
|
1713
|
+
* Request that this run's signals be relayed over its WebSocket channel once it reaches the `live` stage — see the "Live execution" guide. Has no effect while the run is still in the `sandbox` stage, regardless of this value.
|
|
1714
|
+
*/
|
|
1715
|
+
relay?: boolean;
|
|
1716
|
+
name?: string;
|
|
1717
|
+
description?: string;
|
|
1718
|
+
};
|
|
1719
|
+
type UpdateLiveRequest = {
|
|
1720
|
+
visibility?: "private" | "public";
|
|
1721
|
+
name?: string;
|
|
1722
|
+
description?: string;
|
|
1723
|
+
};
|
|
1724
|
+
type UpdateLiveParamsRequest = {
|
|
1725
|
+
/**
|
|
1726
|
+
* Must be non-empty; every key must be a property your strategy declares.
|
|
1727
|
+
*/
|
|
1728
|
+
params: {
|
|
1729
|
+
[key: string]: unknown;
|
|
1730
|
+
};
|
|
1731
|
+
};
|
|
1732
|
+
/**
|
|
1733
|
+
* A live run's full state, as returned by starting, reading, or stopping it through its strategy.
|
|
1734
|
+
*/
|
|
1735
|
+
type LiveRun = {
|
|
1736
|
+
strategyId: StrategyId;
|
|
1737
|
+
/**
|
|
1738
|
+
* This run's own id — its canonical identity for `PATCH`/`PUT .../params` and for `GET /live/public`.
|
|
1739
|
+
*/
|
|
1740
|
+
runId: string;
|
|
1741
|
+
name?: string;
|
|
1742
|
+
description?: string;
|
|
1743
|
+
visibility: "private" | "public";
|
|
1744
|
+
/**
|
|
1745
|
+
* A new run always starts `SANDBOX` — a trial run compared against a second execution for agreement — and moves to `LIVE` once it passes.
|
|
1746
|
+
*/
|
|
1747
|
+
stage: "SANDBOX" | "LIVE";
|
|
1748
|
+
/**
|
|
1749
|
+
* `STARTING` until first observed running; otherwise the runner's own reported state (e.g. `RUNNING`).
|
|
1750
|
+
*/
|
|
1751
|
+
state: string;
|
|
1752
|
+
/**
|
|
1753
|
+
* What you last asked for. `state` can lag this briefly after `DELETE`.
|
|
1754
|
+
*/
|
|
1755
|
+
desired: "RUNNING" | "STOPPED";
|
|
1756
|
+
/**
|
|
1757
|
+
* Present only when the run stopped because it exceeded its resource allowance.
|
|
1758
|
+
*/
|
|
1759
|
+
reason?: string;
|
|
1760
|
+
sources: Array<LiveSource>;
|
|
1761
|
+
params: {
|
|
1762
|
+
[key: string]: unknown;
|
|
1763
|
+
};
|
|
1764
|
+
/**
|
|
1765
|
+
* Increments on every accepted `PUT .../params` call, including one that resends the current values.
|
|
1766
|
+
*/
|
|
1767
|
+
paramsVersion: number;
|
|
1768
|
+
/**
|
|
1769
|
+
* Whether this run's signals are being relayed over the WebSocket channel described in the "Live execution" guide, right now. This is the effective value — `false` on a `sandbox` run regardless of what was requested at start; matches the requested value once `stage` reaches `live`.
|
|
1770
|
+
*/
|
|
1771
|
+
relay: boolean;
|
|
1772
|
+
/**
|
|
1773
|
+
* Epoch milliseconds.
|
|
1774
|
+
*/
|
|
1775
|
+
startedAtMs: number;
|
|
1776
|
+
/**
|
|
1777
|
+
* The sandbox trial's promotion verdict, once one exists. Shape is not yet stabilized as public API — treat as opaque diagnostics.
|
|
1778
|
+
*/
|
|
1779
|
+
gate?: {
|
|
1780
|
+
[key: string]: unknown;
|
|
1781
|
+
};
|
|
1782
|
+
};
|
|
1783
|
+
/**
|
|
1784
|
+
* A run's state as returned by `PATCH /live/{runId}` — narrower than `LiveRun` (no `strategyId`, `params`, or `desired`), since this endpoint is addressed by `runId` alone.
|
|
1785
|
+
*/
|
|
1786
|
+
type LiveRunCompact = {
|
|
1787
|
+
runId: string;
|
|
1788
|
+
name?: string;
|
|
1789
|
+
description?: string;
|
|
1790
|
+
visibility: "private" | "public";
|
|
1791
|
+
stage: "SANDBOX" | "LIVE";
|
|
1792
|
+
state: string;
|
|
1793
|
+
sources: Array<LiveSource>;
|
|
1794
|
+
};
|
|
1795
|
+
/**
|
|
1796
|
+
* A run as it appears in `GET /live` — one of your own, narrower than `LiveRun` (no `params`, `paramsVersion`, `relay`, or `gate`), since listing stays cheap regardless of how many runs you have. Check a specific run's full state with `GET /strategy/{strategyId}/live`.
|
|
1797
|
+
*/
|
|
1798
|
+
type LiveRunSummary = {
|
|
1799
|
+
strategyId: StrategyId;
|
|
1800
|
+
/**
|
|
1801
|
+
* This run's own id — its canonical identity for `PATCH`/`PUT .../params` and for `GET /live/public`.
|
|
1802
|
+
*/
|
|
1803
|
+
runId: string;
|
|
1804
|
+
name?: string;
|
|
1805
|
+
description?: string;
|
|
1806
|
+
visibility: "private" | "public";
|
|
1807
|
+
/**
|
|
1808
|
+
* A new run always starts `SANDBOX` — a trial run compared against a second execution for agreement — and moves to `LIVE` once it passes.
|
|
1809
|
+
*/
|
|
1810
|
+
stage: "SANDBOX" | "LIVE";
|
|
1811
|
+
/**
|
|
1812
|
+
* `STARTING` until first observed running; otherwise the runner's own reported state (e.g. `RUNNING`).
|
|
1813
|
+
*/
|
|
1814
|
+
state: string;
|
|
1815
|
+
/**
|
|
1816
|
+
* What you last asked for. `state` can lag this briefly after `DELETE`.
|
|
1817
|
+
*/
|
|
1818
|
+
desired: "RUNNING" | "STOPPED";
|
|
1819
|
+
sources: Array<LiveSource>;
|
|
1820
|
+
/**
|
|
1821
|
+
* Epoch milliseconds this run was started.
|
|
1822
|
+
*/
|
|
1823
|
+
createdAtMs: number;
|
|
1824
|
+
/**
|
|
1825
|
+
* Epoch milliseconds.
|
|
1826
|
+
*/
|
|
1827
|
+
startedAtMs: number;
|
|
1828
|
+
};
|
|
1829
|
+
type LiveListResponse = {
|
|
1830
|
+
runs: Array<LiveRunSummary>;
|
|
1831
|
+
_links?: PublicLiveListLinks;
|
|
1832
|
+
};
|
|
1833
|
+
/**
|
|
1834
|
+
* A run as it appears in `GET /live/public` — never reveals who owns it or which strategy it runs.
|
|
1835
|
+
*/
|
|
1836
|
+
type PublicLiveRun = {
|
|
1837
|
+
runId: string;
|
|
1838
|
+
name?: string;
|
|
1839
|
+
description?: string;
|
|
1840
|
+
sources: Array<LiveSource>;
|
|
1841
|
+
state: string;
|
|
1842
|
+
createdAtMs: number;
|
|
1843
|
+
};
|
|
1844
|
+
type PublicLiveListResponse = {
|
|
1845
|
+
runs: Array<PublicLiveRun>;
|
|
1846
|
+
_links?: PublicLiveListLinks;
|
|
1847
|
+
};
|
|
1848
|
+
/**
|
|
1849
|
+
* Present only when another page exists.
|
|
1850
|
+
*/
|
|
1851
|
+
type PublicLiveListLinks = {
|
|
1852
|
+
next?: PublicLiveNextLink;
|
|
1853
|
+
};
|
|
1854
|
+
type PublicLiveNextLink = {
|
|
1855
|
+
href?: string;
|
|
1856
|
+
};
|
|
1857
|
+
/**
|
|
1858
|
+
* One page of a run's recorded signals, oldest first.
|
|
1859
|
+
*/
|
|
1860
|
+
type LiveSignalPage = {
|
|
1861
|
+
signals: Array<LiveSignal>;
|
|
1862
|
+
/**
|
|
1863
|
+
* The oldest moment this run's signals can still be read from. Absent when the run has produced nothing yet. It moves forward over time as older signals are discarded, so a `sinceMs` earlier than this is served from here instead.
|
|
1864
|
+
*/
|
|
1865
|
+
availableSinceMs?: number;
|
|
1866
|
+
_links?: PublicLiveListLinks;
|
|
1867
|
+
};
|
|
1868
|
+
/**
|
|
1869
|
+
* One signal, in the same shape the real-time signal channel delivers.
|
|
1870
|
+
*/
|
|
1871
|
+
type LiveSignal = {
|
|
1872
|
+
/**
|
|
1873
|
+
* Envelope schema version.
|
|
1874
|
+
*/
|
|
1875
|
+
v: number;
|
|
1876
|
+
/**
|
|
1877
|
+
* Stable id for this exact signal — dedupe on it across reconnects or overlapping reads.
|
|
1878
|
+
*/
|
|
1879
|
+
signalId: string;
|
|
1880
|
+
runId: string;
|
|
1881
|
+
/**
|
|
1882
|
+
* The stage the run was in when this signal was produced.
|
|
1883
|
+
*/
|
|
1884
|
+
stage: "sandbox" | "live";
|
|
1885
|
+
/**
|
|
1886
|
+
* The parameter set in force when this signal was produced.
|
|
1887
|
+
*/
|
|
1888
|
+
paramsVersion?: number;
|
|
1889
|
+
type: "hint" | "info" | "marker" | "command";
|
|
1890
|
+
/**
|
|
1891
|
+
* `BUY`/`SELL` for a `hint`, the command name for a `command`, absent otherwise.
|
|
1892
|
+
*/
|
|
1893
|
+
kind?: string | null;
|
|
1894
|
+
/**
|
|
1895
|
+
* Market time the signal was produced.
|
|
1896
|
+
*/
|
|
1897
|
+
eventTsMs: number;
|
|
1898
|
+
/**
|
|
1899
|
+
* Time it was published — always at or after `eventTsMs`.
|
|
1900
|
+
*/
|
|
1901
|
+
emittedAtMs: number;
|
|
1902
|
+
instrument: LiveSignalInstrument;
|
|
1903
|
+
order?: LiveSignalOrder;
|
|
1904
|
+
/**
|
|
1905
|
+
* The signal's own free-form payload.
|
|
1906
|
+
*/
|
|
1907
|
+
data?: {
|
|
1908
|
+
[key: string]: unknown;
|
|
1909
|
+
};
|
|
1910
|
+
/**
|
|
1911
|
+
* `true` only for a signal republished to fill a gap in the record.
|
|
1912
|
+
*/
|
|
1913
|
+
regenerated?: boolean;
|
|
1914
|
+
/**
|
|
1915
|
+
* Content hash, for checking that two independent deliveries of the same signal agree.
|
|
1916
|
+
*/
|
|
1917
|
+
digest: string;
|
|
1918
|
+
};
|
|
1919
|
+
type LiveSignalInstrument = {
|
|
1920
|
+
exchange?: string;
|
|
1921
|
+
segment?: string;
|
|
1922
|
+
/**
|
|
1923
|
+
* Slashed form, e.g. `BTC/USDT`.
|
|
1924
|
+
*/
|
|
1925
|
+
symbol?: string;
|
|
1926
|
+
};
|
|
1927
|
+
/**
|
|
1928
|
+
* Present only for a `hint`.
|
|
1929
|
+
*/
|
|
1930
|
+
type LiveSignalOrder = {
|
|
1931
|
+
orderKind?: string;
|
|
1932
|
+
price?: string | null;
|
|
1933
|
+
amount?: string | null;
|
|
1934
|
+
stopPrice?: string | null;
|
|
1935
|
+
trailPct?: string | null;
|
|
1936
|
+
} | null;
|
|
1937
|
+
type LiveConnectionToken = {
|
|
1938
|
+
/**
|
|
1939
|
+
* Pass as the `token` field of the WebSocket `connect` command — see the "Live execution" guide.
|
|
1940
|
+
*/
|
|
1941
|
+
token: string;
|
|
1942
|
+
expiresAtMs: number;
|
|
1943
|
+
};
|
|
1944
|
+
type LiveParamsUpdateResult = {
|
|
1945
|
+
runId: string;
|
|
1946
|
+
paramsVersion: number;
|
|
1947
|
+
/**
|
|
1948
|
+
* Epoch milliseconds — the earliest moment the new values are guaranteed to be in effect.
|
|
1949
|
+
*/
|
|
1950
|
+
effectiveAtMs: number;
|
|
1951
|
+
};
|
|
1666
1952
|
type AuthenticateData = {
|
|
1667
1953
|
body?: never;
|
|
1668
1954
|
path?: never;
|
|
@@ -1914,7 +2200,7 @@ type ListStrategiesResponses = {
|
|
|
1914
2200
|
type ListStrategiesResponse = ListStrategiesResponses[keyof ListStrategiesResponses];
|
|
1915
2201
|
type CompileStrategyData = {
|
|
1916
2202
|
/**
|
|
1917
|
-
* Raw strategy Java
|
|
2203
|
+
* Raw strategy source code, Java or QTScript
|
|
1918
2204
|
*/
|
|
1919
2205
|
body: string;
|
|
1920
2206
|
path?: never;
|
|
@@ -1923,7 +2209,8 @@ type CompileStrategyData = {
|
|
|
1923
2209
|
};
|
|
1924
2210
|
type CompileStrategyErrors = {
|
|
1925
2211
|
/**
|
|
1926
|
-
* The source is not valid
|
|
2212
|
+
* The source is not valid; the message carries the diagnostics — the compiler's for Java,
|
|
2213
|
+
* and for QTScript `Line N, Column M:` entries against your own source. Nothing is
|
|
1927
2214
|
* registered, so there is no id to look up afterwards.
|
|
1928
2215
|
*
|
|
1929
2216
|
*/
|
|
@@ -2064,7 +2351,7 @@ type GetStrategyCodeResponses = {
|
|
|
2064
2351
|
200: {
|
|
2065
2352
|
strategyId: StrategyId;
|
|
2066
2353
|
/**
|
|
2067
|
-
* Raw strategy Java
|
|
2354
|
+
* Raw strategy source code (Java or QTScript), exactly as registered.
|
|
2068
2355
|
*/
|
|
2069
2356
|
code: string;
|
|
2070
2357
|
};
|
|
@@ -2093,7 +2380,9 @@ type PrepareBacktestData = {
|
|
|
2093
2380
|
type PrepareBacktestErrors = {
|
|
2094
2381
|
/**
|
|
2095
2382
|
* Invalid request or parameters. Also returned when `from` is older than the configured
|
|
2096
|
-
* lookback window or `to` is in the future
|
|
2383
|
+
* lookback window or `to` is in the future, or when `type` is `kline` and `cadence` is not
|
|
2384
|
+
* one of the cadences kline data is available at (the message lists them). For
|
|
2385
|
+
* `exchangeId: user`, also returned when
|
|
2097
2386
|
* the dataset's current upload has not finished ingesting, or `cadence` asks for a finer
|
|
2098
2387
|
* granularity than the dataset's own discovered cadence (or one that isn't an exact
|
|
2099
2388
|
* multiple of it), or the requested range exceeds your tier's range limit.
|
|
@@ -2176,7 +2465,9 @@ type ExecuteSweepData = {
|
|
|
2176
2465
|
};
|
|
2177
2466
|
type ExecuteSweepErrors = {
|
|
2178
2467
|
/**
|
|
2179
|
-
* Invalid sweep specification
|
|
2468
|
+
* Invalid sweep specification, a `type` that cannot be swept yet (`funding`), or the
|
|
2469
|
+
* expanded grid exceeds the server limit.
|
|
2470
|
+
*
|
|
2180
2471
|
*/
|
|
2181
2472
|
400: ResponseError;
|
|
2182
2473
|
/**
|
|
@@ -2410,7 +2701,9 @@ type ExecuteBacktestData = {
|
|
|
2410
2701
|
};
|
|
2411
2702
|
type ExecuteBacktestErrors = {
|
|
2412
2703
|
/**
|
|
2413
|
-
* Invalid request or parameters
|
|
2704
|
+
* Invalid request or parameters. Also returned for a `type` that cannot be executed yet
|
|
2705
|
+
* (`funding`); the message names the sources that can.
|
|
2706
|
+
*
|
|
2414
2707
|
*/
|
|
2415
2708
|
400: ResponseError;
|
|
2416
2709
|
/**
|
|
@@ -2795,6 +3088,281 @@ type GetDatasetImportResponses = {
|
|
|
2795
3088
|
200: DatasetImportState;
|
|
2796
3089
|
};
|
|
2797
3090
|
type GetDatasetImportResponse = GetDatasetImportResponses[keyof GetDatasetImportResponses];
|
|
3091
|
+
type StopLiveData = {
|
|
3092
|
+
body?: never;
|
|
3093
|
+
path: {
|
|
3094
|
+
/**
|
|
3095
|
+
* The id returned by `POST /strategy`
|
|
3096
|
+
*/
|
|
3097
|
+
strategyId: StrategyId;
|
|
3098
|
+
};
|
|
3099
|
+
query?: never;
|
|
3100
|
+
url: "/strategy/{strategyId}/live";
|
|
3101
|
+
};
|
|
3102
|
+
type StopLiveErrors = {
|
|
3103
|
+
/**
|
|
3104
|
+
* You have never started a live run for this strategy.
|
|
3105
|
+
*/
|
|
3106
|
+
404: ResponseError;
|
|
3107
|
+
};
|
|
3108
|
+
type StopLiveError = StopLiveErrors[keyof StopLiveErrors];
|
|
3109
|
+
type StopLiveResponses = {
|
|
3110
|
+
/**
|
|
3111
|
+
* Stop requested (or already stopped) — the run's current state
|
|
3112
|
+
*/
|
|
3113
|
+
200: LiveRun;
|
|
3114
|
+
};
|
|
3115
|
+
type StopLiveResponse = StopLiveResponses[keyof StopLiveResponses];
|
|
3116
|
+
type GetLiveData = {
|
|
3117
|
+
body?: never;
|
|
3118
|
+
path: {
|
|
3119
|
+
/**
|
|
3120
|
+
* The id returned by `POST /strategy`
|
|
3121
|
+
*/
|
|
3122
|
+
strategyId: StrategyId;
|
|
3123
|
+
};
|
|
3124
|
+
query?: never;
|
|
3125
|
+
url: "/strategy/{strategyId}/live";
|
|
3126
|
+
};
|
|
3127
|
+
type GetLiveErrors = {
|
|
3128
|
+
/**
|
|
3129
|
+
* You have never started a live run for this strategy.
|
|
3130
|
+
*/
|
|
3131
|
+
404: ResponseError;
|
|
3132
|
+
};
|
|
3133
|
+
type GetLiveError = GetLiveErrors[keyof GetLiveErrors];
|
|
3134
|
+
type GetLiveResponses = {
|
|
3135
|
+
/**
|
|
3136
|
+
* The run's current state
|
|
3137
|
+
*/
|
|
3138
|
+
200: LiveRun;
|
|
3139
|
+
};
|
|
3140
|
+
type GetLiveResponse = GetLiveResponses[keyof GetLiveResponses];
|
|
3141
|
+
type StartLiveData = {
|
|
3142
|
+
body: StartLiveRequest;
|
|
3143
|
+
path: {
|
|
3144
|
+
/**
|
|
3145
|
+
* The id returned by `POST /strategy`
|
|
3146
|
+
*/
|
|
3147
|
+
strategyId: StrategyId;
|
|
3148
|
+
};
|
|
3149
|
+
query?: never;
|
|
3150
|
+
url: "/strategy/{strategyId}/live";
|
|
3151
|
+
};
|
|
3152
|
+
type StartLiveErrors = {
|
|
3153
|
+
/**
|
|
3154
|
+
* Malformed `sources` (not exactly one entry, missing field, unsupported `type`), or an invalid `visibility`.
|
|
3155
|
+
*/
|
|
3156
|
+
400: ResponseError;
|
|
3157
|
+
/**
|
|
3158
|
+
* No such registered strategy for this user, or it has never been compiled.
|
|
3159
|
+
*/
|
|
3160
|
+
404: ResponseError;
|
|
3161
|
+
/**
|
|
3162
|
+
* A run for this strategy is already active. Stop it first.
|
|
3163
|
+
*/
|
|
3164
|
+
409: ResponseError;
|
|
3165
|
+
/**
|
|
3166
|
+
* Your plan does not include live runs, would exceed your concurrent-run or
|
|
3167
|
+
* instrument-count limit, or the platform is at capacity right now. Carries a
|
|
3168
|
+
* `Retry-After` header.
|
|
3169
|
+
*
|
|
3170
|
+
*/
|
|
3171
|
+
429: ResponseError;
|
|
3172
|
+
};
|
|
3173
|
+
type StartLiveError = StartLiveErrors[keyof StartLiveErrors];
|
|
3174
|
+
type StartLiveResponses = {
|
|
3175
|
+
/**
|
|
3176
|
+
* Started — the run's own state, in the sandbox stage
|
|
3177
|
+
*/
|
|
3178
|
+
201: LiveRun;
|
|
3179
|
+
};
|
|
3180
|
+
type StartLiveResponse = StartLiveResponses[keyof StartLiveResponses];
|
|
3181
|
+
type ListLiveData = {
|
|
3182
|
+
body?: never;
|
|
3183
|
+
path?: never;
|
|
3184
|
+
query?: {
|
|
3185
|
+
/**
|
|
3186
|
+
* The `runId` from a previous page's `_links.next.href`. Omit for the first page.
|
|
3187
|
+
*/
|
|
3188
|
+
cursor?: string;
|
|
3189
|
+
/**
|
|
3190
|
+
* Page size. Larger values are capped, not rejected.
|
|
3191
|
+
*/
|
|
3192
|
+
limit?: number;
|
|
3193
|
+
};
|
|
3194
|
+
url: "/live";
|
|
3195
|
+
};
|
|
3196
|
+
type ListLiveErrors = {
|
|
3197
|
+
/**
|
|
3198
|
+
* An invalid `cursor` or `limit`.
|
|
3199
|
+
*/
|
|
3200
|
+
400: ResponseError;
|
|
3201
|
+
};
|
|
3202
|
+
type ListLiveError = ListLiveErrors[keyof ListLiveErrors];
|
|
3203
|
+
type ListLiveResponses = {
|
|
3204
|
+
/**
|
|
3205
|
+
* A page of your own runs
|
|
3206
|
+
*/
|
|
3207
|
+
200: LiveListResponse;
|
|
3208
|
+
};
|
|
3209
|
+
type ListLiveResponse = ListLiveResponses[keyof ListLiveResponses];
|
|
3210
|
+
type ListPublicLiveData = {
|
|
3211
|
+
body?: never;
|
|
3212
|
+
path?: never;
|
|
3213
|
+
query?: {
|
|
3214
|
+
/**
|
|
3215
|
+
* The `runId` from a previous page's `_links.next.href`. Omit for the first page.
|
|
3216
|
+
*/
|
|
3217
|
+
cursor?: string;
|
|
3218
|
+
/**
|
|
3219
|
+
* Page size. Larger values are capped, not rejected.
|
|
3220
|
+
*/
|
|
3221
|
+
limit?: number;
|
|
3222
|
+
};
|
|
3223
|
+
url: "/live/public";
|
|
3224
|
+
};
|
|
3225
|
+
type ListPublicLiveErrors = {
|
|
3226
|
+
/**
|
|
3227
|
+
* An invalid `cursor` or `limit`.
|
|
3228
|
+
*/
|
|
3229
|
+
400: ResponseError;
|
|
3230
|
+
};
|
|
3231
|
+
type ListPublicLiveError = ListPublicLiveErrors[keyof ListPublicLiveErrors];
|
|
3232
|
+
type ListPublicLiveResponses = {
|
|
3233
|
+
/**
|
|
3234
|
+
* A page of public runs
|
|
3235
|
+
*/
|
|
3236
|
+
200: PublicLiveListResponse;
|
|
3237
|
+
};
|
|
3238
|
+
type ListPublicLiveResponse = ListPublicLiveResponses[keyof ListPublicLiveResponses];
|
|
3239
|
+
type UpdateLiveData = {
|
|
3240
|
+
body?: UpdateLiveRequest;
|
|
3241
|
+
path: {
|
|
3242
|
+
/**
|
|
3243
|
+
* The `runId` from `POST`/`GET`/`DELETE` `.../live` or from `GET /live/public`
|
|
3244
|
+
*/
|
|
3245
|
+
runId: string;
|
|
3246
|
+
};
|
|
3247
|
+
query?: never;
|
|
3248
|
+
url: "/live/{runId}";
|
|
3249
|
+
};
|
|
3250
|
+
type UpdateLiveErrors = {
|
|
3251
|
+
/**
|
|
3252
|
+
* `visibility` present but not `private`/`public`.
|
|
3253
|
+
*/
|
|
3254
|
+
400: ResponseError;
|
|
3255
|
+
/**
|
|
3256
|
+
* No such run, or you do not own it — the two look identical on purpose.
|
|
3257
|
+
*/
|
|
3258
|
+
404: ResponseError;
|
|
3259
|
+
};
|
|
3260
|
+
type UpdateLiveError = UpdateLiveErrors[keyof UpdateLiveErrors];
|
|
3261
|
+
type UpdateLiveResponses = {
|
|
3262
|
+
/**
|
|
3263
|
+
* Updated
|
|
3264
|
+
*/
|
|
3265
|
+
200: LiveRunCompact;
|
|
3266
|
+
};
|
|
3267
|
+
type UpdateLiveResponse = UpdateLiveResponses[keyof UpdateLiveResponses];
|
|
3268
|
+
type UpdateLiveParamsData = {
|
|
3269
|
+
body: UpdateLiveParamsRequest;
|
|
3270
|
+
path: {
|
|
3271
|
+
runId: string;
|
|
3272
|
+
};
|
|
3273
|
+
query?: never;
|
|
3274
|
+
url: "/live/{runId}/params";
|
|
3275
|
+
};
|
|
3276
|
+
type UpdateLiveParamsErrors = {
|
|
3277
|
+
/**
|
|
3278
|
+
* `params` missing, not an object, empty, or contains a key your strategy does not declare.
|
|
3279
|
+
*/
|
|
3280
|
+
400: ResponseError;
|
|
3281
|
+
/**
|
|
3282
|
+
* No such run, or you do not own it.
|
|
3283
|
+
*/
|
|
3284
|
+
404: ResponseError;
|
|
3285
|
+
/**
|
|
3286
|
+
* This run's compilation has no declared properties on record — recompile the strategy to enable runtime parameter updates.
|
|
3287
|
+
*/
|
|
3288
|
+
409: ResponseError;
|
|
3289
|
+
};
|
|
3290
|
+
type UpdateLiveParamsError = UpdateLiveParamsErrors[keyof UpdateLiveParamsErrors];
|
|
3291
|
+
type UpdateLiveParamsResponses = {
|
|
3292
|
+
/**
|
|
3293
|
+
* Accepted
|
|
3294
|
+
*/
|
|
3295
|
+
200: LiveParamsUpdateResult;
|
|
3296
|
+
};
|
|
3297
|
+
type UpdateLiveParamsResponse = UpdateLiveParamsResponses[keyof UpdateLiveParamsResponses];
|
|
3298
|
+
type GetLiveRunSignalsData = {
|
|
3299
|
+
body?: never;
|
|
3300
|
+
path: {
|
|
3301
|
+
/**
|
|
3302
|
+
* The run whose signals to read.
|
|
3303
|
+
*/
|
|
3304
|
+
runId: string;
|
|
3305
|
+
};
|
|
3306
|
+
query?: {
|
|
3307
|
+
/**
|
|
3308
|
+
* Start from this moment (epoch ms). Omitted, or older than the available window, starts at `availableSinceMs`. Ignored when `cursor` is given.
|
|
3309
|
+
*/
|
|
3310
|
+
sinceMs?: number;
|
|
3311
|
+
/**
|
|
3312
|
+
* Narrow to one or more instruments. Omitted, or `*`, returns every instrument the run
|
|
3313
|
+
* covers. Accepts a single pair (`BTC/USDT`), either half as a wildcard (`*USDT` for any
|
|
3314
|
+
* base against that quote, `BTC*` for that base against any quote), or a comma-separated
|
|
3315
|
+
* list of pairs (`BTC/USDT,ETH/EUR`). Symbols are matched exactly, case included — pass
|
|
3316
|
+
* them as this API reports them.
|
|
3317
|
+
*
|
|
3318
|
+
*/
|
|
3319
|
+
instrument?: string;
|
|
3320
|
+
/**
|
|
3321
|
+
* Continue from a previous page's `_links.next`. Takes precedence over `sinceMs`.
|
|
3322
|
+
*/
|
|
3323
|
+
cursor?: string;
|
|
3324
|
+
/**
|
|
3325
|
+
* Page size.
|
|
3326
|
+
*/
|
|
3327
|
+
limit?: number;
|
|
3328
|
+
};
|
|
3329
|
+
url: "/live/{runId}/signals";
|
|
3330
|
+
};
|
|
3331
|
+
type GetLiveRunSignalsErrors = {
|
|
3332
|
+
/**
|
|
3333
|
+
* `instrument`, `sinceMs`, `limit` or `cursor` is malformed.
|
|
3334
|
+
*/
|
|
3335
|
+
400: ResponseError;
|
|
3336
|
+
/**
|
|
3337
|
+
* No such run, or not one you may read.
|
|
3338
|
+
*/
|
|
3339
|
+
404: ResponseError;
|
|
3340
|
+
/**
|
|
3341
|
+
* The cursor's position is no longer available — restart from the `availableSinceMs` named in the message.
|
|
3342
|
+
*/
|
|
3343
|
+
410: ResponseError;
|
|
3344
|
+
};
|
|
3345
|
+
type GetLiveRunSignalsError = GetLiveRunSignalsErrors[keyof GetLiveRunSignalsErrors];
|
|
3346
|
+
type GetLiveRunSignalsResponses = {
|
|
3347
|
+
/**
|
|
3348
|
+
* One page of signals
|
|
3349
|
+
*/
|
|
3350
|
+
200: LiveSignalPage;
|
|
3351
|
+
};
|
|
3352
|
+
type GetLiveRunSignalsResponse = GetLiveRunSignalsResponses[keyof GetLiveRunSignalsResponses];
|
|
3353
|
+
type MintLiveConnectionTokenData = {
|
|
3354
|
+
body?: never;
|
|
3355
|
+
path?: never;
|
|
3356
|
+
query?: never;
|
|
3357
|
+
url: "/live/token";
|
|
3358
|
+
};
|
|
3359
|
+
type MintLiveConnectionTokenResponses = {
|
|
3360
|
+
/**
|
|
3361
|
+
* Token minted
|
|
3362
|
+
*/
|
|
3363
|
+
200: LiveConnectionToken;
|
|
3364
|
+
};
|
|
3365
|
+
type MintLiveConnectionTokenResponse = MintLiveConnectionTokenResponses[keyof MintLiveConnectionTokenResponses];
|
|
2798
3366
|
type ClientOptions = {
|
|
2799
3367
|
baseUrl: "https://api.qtsurfer.net/v1" | "https://api.qtsurfer.com/v1" | (string & {});
|
|
2800
3368
|
};
|
|
@@ -2928,22 +3496,35 @@ declare const listStrategies: <ThrowOnError extends boolean = false>(options?: O
|
|
|
2928
3496
|
* Compile and register a strategy
|
|
2929
3497
|
* Compiles raw strategy source and registers it, returning its `strategyId`.
|
|
2930
3498
|
*
|
|
2931
|
-
*
|
|
3499
|
+
* The source is either **Java** — a class extending a strategy base class — or **QTScript**
|
|
3500
|
+
* (beta), a compact strategy language whose braced bodies are plain Java. QTScript source
|
|
3501
|
+
* begins with the `strategy` keyword — whitespace and comments (`//` or `* *`) before it
|
|
3502
|
+
* are ignored — and that is how the two are told apart: there is no separate endpoint and
|
|
3503
|
+
* no header to set. Once registered, a strategy is used the same way
|
|
3504
|
+
* whichever language it was written in.
|
|
3505
|
+
*
|
|
3506
|
+
* **This answers one question: is the source valid.** It compiles, registers, and hands
|
|
2932
3507
|
* back the id — nothing more. Whether the class can actually run is
|
|
2933
3508
|
* `POST /strategy/{strategyId}/validate`, and everything known about a strategy, validation
|
|
2934
3509
|
* included, is read from `GET /strategy/{strategyId}`. One place to ask, so there is no second
|
|
2935
3510
|
* answer to keep in step.
|
|
2936
3511
|
*
|
|
2937
|
-
*
|
|
2938
|
-
* comment, inserting a blank line, re-indenting, reordering imports, or
|
|
2939
|
-
* all return the **same** id — you have not created a second strategy.
|
|
2940
|
-
* changing an identifier's case, reordering fields, or reordering
|
|
2941
|
-
* return a **different** one.
|
|
3512
|
+
* For **Java**, the `strategyId` is derived from what the code *means*, not from how it is
|
|
3513
|
+
* written. Adding a comment, inserting a blank line, re-indenting, reordering imports, or
|
|
3514
|
+
* moving a method around all return the **same** id — you have not created a second strategy.
|
|
3515
|
+
* Renaming a variable, changing an identifier's case, reordering fields, or reordering
|
|
3516
|
+
* statements inside a method return a **different** one.
|
|
3517
|
+
*
|
|
3518
|
+
* For **QTScript**, the id is derived from the text, because indentation is part of its
|
|
3519
|
+
* grammar. Only differences that cannot change the strategy are ignored: a byte-order mark, the
|
|
3520
|
+
* style of line endings, whitespace at the end of a line, and blank lines before the first and
|
|
3521
|
+
* after the last line. Anything else — a comment, the indentation, a blank line in between —
|
|
3522
|
+
* returns a **different** id.
|
|
2942
3523
|
*
|
|
2943
3524
|
* Two rules follow, and they are worth designing around:
|
|
2944
3525
|
*
|
|
2945
|
-
* - re-submitting a strategy you have only reformatted is free, and gives you back the id
|
|
2946
|
-
* already had, along with any validation already recorded against it;
|
|
3526
|
+
* - re-submitting a Java strategy you have only reformatted is free, and gives you back the id
|
|
3527
|
+
* you already had, along with any validation already recorded against it;
|
|
2947
3528
|
* - the id says nothing about *behaviour*. Two sources that compute the same thing by
|
|
2948
3529
|
* different means are two strategies, because deciding otherwise would mean deciding program
|
|
2949
3530
|
* equivalence.
|
|
@@ -3023,6 +3604,10 @@ declare const getStrategyCode: <ThrowOnError extends boolean = false>(options: O
|
|
|
3023
3604
|
* The same params always return the same `jobId` (idempotent). Repeated calls with identical
|
|
3024
3605
|
* params do not enqueue duplicate work — they reuse the existing job.
|
|
3025
3606
|
*
|
|
3607
|
+
* Every source in `DataSourceType` can be prepared, but not every one can then be run: `funding`
|
|
3608
|
+
* data can be prepared and is rejected by `execute` and `executeSweep`. A `kline` prepare takes
|
|
3609
|
+
* the bar width from `cadence` — see `PrepareRequest`.
|
|
3610
|
+
*
|
|
3026
3611
|
* **`exchangeId: user` is reserved for your own uploaded data.** Instead of a managed
|
|
3027
3612
|
* exchange, it prepares from a dataset you created via `POST /datasets` (see the **Dataset**
|
|
3028
3613
|
* endpoints) — send `datasetId` in place of `instrument`. See `PrepareRequest` below for the
|
|
@@ -3046,6 +3631,10 @@ declare const getPrepareStatus: <ThrowOnError extends boolean = false>(options:
|
|
|
3046
3631
|
* The backend expands and executes the matrix internally; clients poll the returned
|
|
3047
3632
|
* `sweepId` for incremental results.
|
|
3048
3633
|
*
|
|
3634
|
+
* `type` must be `ticker` or `kline`; a `kline` sweep, walk-forward included, runs over bars of
|
|
3635
|
+
* the cadence the request was prepared at. `funding` can be prepared but not swept yet: it is
|
|
3636
|
+
* rejected with `400` before anything is queued.
|
|
3637
|
+
*
|
|
3049
3638
|
* Supplying `walkForward` runs the sweep in a different mode entirely. Instead of scoring
|
|
3050
3639
|
* every parameter vector once over the whole range, the data is split into F sequential
|
|
3051
3640
|
* folds; each fold optimizes the full grid on its own window and then scores only its winner
|
|
@@ -3152,6 +3741,11 @@ declare const getSweepRunEquityCurve: <ThrowOnError extends boolean = false>(opt
|
|
|
3152
3741
|
* Returns immediately with a `jobId`; poll `GET /backtest/{exchangeId}/{type}/execute/{jobId}`
|
|
3153
3742
|
* for the result.
|
|
3154
3743
|
*
|
|
3744
|
+
* `type` must be a source that can be executed: `ticker` or `kline`. A `kline` strategy is fed
|
|
3745
|
+
* bars of the cadence its `prepareJobId` was prepared at — chosen by you when preparing, not by
|
|
3746
|
+
* the strategy. `funding` can be prepared but not executed yet: it is rejected with `400`
|
|
3747
|
+
* before anything is queued.
|
|
3748
|
+
*
|
|
3155
3749
|
* Optionally takes `params`: strategy properties for this one run, applied without
|
|
3156
3750
|
* recompiling. This is how a sweep leaderboard winner gets re-run for its `equityCurve` —
|
|
3157
3751
|
* a sweep row carries the ten ranking metrics but never a curve, whatever its size. Compile
|
|
@@ -3337,7 +3931,134 @@ declare const importDataset: <ThrowOnError extends boolean = false>(options: Opt
|
|
|
3337
3931
|
*
|
|
3338
3932
|
*/
|
|
3339
3933
|
declare const getDatasetImport: <ThrowOnError extends boolean = false>(options: Options<GetDatasetImportData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<DatasetImportState, ResponseError, ThrowOnError>;
|
|
3934
|
+
/**
|
|
3935
|
+
* Stop this strategy's live run
|
|
3936
|
+
* Requests a stop. The run winds down at its own next check-in rather than instantly —
|
|
3937
|
+
* poll `GET`/`PATCH` `.../live` and expect `state` to remain `RUNNING` for a short window
|
|
3938
|
+
* after `desired` flips to `STOPPED`. Calling this again on an already-stopped run is not an
|
|
3939
|
+
* error; it returns the same (unchanged) state.
|
|
3940
|
+
*
|
|
3941
|
+
*/
|
|
3942
|
+
declare const stopLive: <ThrowOnError extends boolean = false>(options: Options<StopLiveData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<LiveRun, ResponseError, ThrowOnError>;
|
|
3943
|
+
/**
|
|
3944
|
+
* Get this strategy's current (or most recent) live run
|
|
3945
|
+
* The run you last started for this strategy — its most complete state, including `params`
|
|
3946
|
+
* and the promotion `gate` once the sandbox trial has one to report. Returns the run's last
|
|
3947
|
+
* known state even after it has stopped; this endpoint never disappears history.
|
|
3948
|
+
*
|
|
3949
|
+
*/
|
|
3950
|
+
declare const getLive: <ThrowOnError extends boolean = false>(options: Options<GetLiveData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<LiveRun, ResponseError, ThrowOnError>;
|
|
3951
|
+
/**
|
|
3952
|
+
* Start a strategy on a live market feed
|
|
3953
|
+
* Starts your strategy against a live market feed. A new run always begins in the **sandbox**
|
|
3954
|
+
* stage — a short trial that compares an independent second execution against the first for
|
|
3955
|
+
* agreement — before it is eligible for promotion to the live stage where it actually
|
|
3956
|
+
* publishes signals other systems can act on. Poll `GET /strategy/{strategyId}/live` (or
|
|
3957
|
+
* `PATCH`/`DELETE` `/live/{runId}` once you have the `runId`) to watch `stage` move from
|
|
3958
|
+
* `SANDBOX` to `LIVE`.
|
|
3959
|
+
*
|
|
3960
|
+
* Only one run per strategy at a time — starting again while one is already running is `409`;
|
|
3961
|
+
* stop the current one first.
|
|
3962
|
+
*
|
|
3963
|
+
* `sources` takes exactly one entry today (multi-source strategies are not supported yet).
|
|
3964
|
+
* `type` is `ticker` or `kline`; anything else is rejected. Both connect to the lightest
|
|
3965
|
+
* (fastest) cadence available for the exchange — today that is 1 tick/second on every
|
|
3966
|
+
* supported exchange; choosing among several cadences is not offered yet.
|
|
3967
|
+
*
|
|
3968
|
+
* `params` is passed straight through to the strategy at start — the same free-form object
|
|
3969
|
+
* `POST /strategy/{strategyId}/validate` and the backtest endpoints already accept. To change
|
|
3970
|
+
* a parameter **while the run is live**, use `PUT /live/{runId}/params` instead; this endpoint
|
|
3971
|
+
* only sets the values a run starts with.
|
|
3972
|
+
*
|
|
3973
|
+
* Consuming a run's own output — its signals, and updating its parameters over a live
|
|
3974
|
+
* connection instead of polling — is a WebSocket protocol on top of these REST endpoints; see
|
|
3975
|
+
* the "Live execution" guide linked from this tag's description for the full flow (minting a
|
|
3976
|
+
* connection token, the channel and RPC method).
|
|
3977
|
+
*
|
|
3978
|
+
*/
|
|
3979
|
+
declare const startLive: <ThrowOnError extends boolean = false>(options: Options<StartLiveData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<LiveRun, ResponseError, ThrowOnError>;
|
|
3980
|
+
/**
|
|
3981
|
+
* List your own live runs
|
|
3982
|
+
* Every run you have started, in any `stage`, `desired` state, or `visibility` — newest
|
|
3983
|
+
* first. Unlike `GET /live/public`, this is not filtered to `RUNNING` public runs: it is
|
|
3984
|
+
* the complete list of runs you own, including `sandbox` trials and stopped ones.
|
|
3985
|
+
*
|
|
3986
|
+
*/
|
|
3987
|
+
declare const listLive: <ThrowOnError extends boolean = false>(options?: Options<ListLiveData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<LiveListResponse, ResponseError, ThrowOnError>;
|
|
3988
|
+
/**
|
|
3989
|
+
* Browse public live runs
|
|
3990
|
+
* Every run whose owner marked it `public` and is currently live and running — anyone's,
|
|
3991
|
+
* yours included, and listed without revealing who owns it. Most recently started first.
|
|
3992
|
+
*
|
|
3993
|
+
* This is the only `Live Execution` endpoint that needs no `Authorization` header.
|
|
3994
|
+
*
|
|
3995
|
+
*/
|
|
3996
|
+
declare const listPublicLive: <ThrowOnError extends boolean = false>(options?: Options<ListPublicLiveData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<PublicLiveListResponse, ResponseError, ThrowOnError>;
|
|
3997
|
+
/**
|
|
3998
|
+
* Change a run's visibility, name, or description
|
|
3999
|
+
* Owner only, addressed by `runId` directly rather than through its strategy — this is a
|
|
4000
|
+
* run's own canonical identity, independent of which strategy started it.
|
|
4001
|
+
*
|
|
4002
|
+
* Setting `visibility` from `public` back to `private` also evicts anyone currently connected
|
|
4003
|
+
* to the run's live signal channel who is not its owner — best-effort; the change to this
|
|
4004
|
+
* record is not rolled back if that eviction fails.
|
|
4005
|
+
*
|
|
4006
|
+
*/
|
|
4007
|
+
declare const updateLive: <ThrowOnError extends boolean = false>(options: Options<UpdateLiveData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<LiveRunCompact, ResponseError, ThrowOnError>;
|
|
4008
|
+
/**
|
|
4009
|
+
* Change a running strategy's parameters
|
|
4010
|
+
* Updates one or more parameters of a run **while it stays live** — unlike `params` on
|
|
4011
|
+
* `POST /strategy/{strategyId}/live`, which only sets the starting values. Owner only.
|
|
4012
|
+
*
|
|
4013
|
+
* Every key in `params` must be one your strategy declares (see `declaredProperties` on
|
|
4014
|
+
* `POST /strategy`) as of the compilation this run is executing — recompiling the strategy
|
|
4015
|
+
* later never changes what an already-running instance accepts; start a new run for that.
|
|
4016
|
+
*
|
|
4017
|
+
* The change does not take effect the instant this call returns: `effectiveAtMs` is the
|
|
4018
|
+
* earliest moment it is guaranteed to apply, a few seconds out, so both the REST and
|
|
4019
|
+
* WebSocket paths to this same update (see the "Live execution" guide) land on the exact same
|
|
4020
|
+
* value at the exact same moment.
|
|
4021
|
+
*
|
|
4022
|
+
*/
|
|
4023
|
+
declare const updateLiveParams: <ThrowOnError extends boolean = false>(options: Options<UpdateLiveParamsData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<LiveParamsUpdateResult, ResponseError, ThrowOnError>;
|
|
4024
|
+
/**
|
|
4025
|
+
* Read a run's signals
|
|
4026
|
+
* Returns one page of the signals a run has already produced, newest-last, optionally from a
|
|
4027
|
+
* given time and narrowed to one or more instruments.
|
|
4028
|
+
*
|
|
4029
|
+
* This is the counterpart to the real-time WebSocket channel: that channel only carries what
|
|
4030
|
+
* happens while you are connected, and only for a run that asked for `relay`. A run's signals
|
|
4031
|
+
* are recorded either way, so this endpoint serves them whether or not `relay` was ever on,
|
|
4032
|
+
* in both the `sandbox` and `live` stages — use it to catch up after a disconnect, to read a
|
|
4033
|
+
* run you never relayed, or to page back over what has already happened.
|
|
4034
|
+
*
|
|
4035
|
+
* **The available window moves.** Signals are kept for a limited span, and the oldest are
|
|
4036
|
+
* continuously discarded as new ones arrive, so how far back you can read is not a fixed
|
|
4037
|
+
* number of hours: on a busy run it can be a good deal shorter. Every response carries
|
|
4038
|
+
* `availableSinceMs`, the oldest moment that can still be answered for. Asking for a
|
|
4039
|
+
* `sinceMs` older than that is not an error — you get everything from `availableSinceMs`
|
|
4040
|
+
* onwards, and that field tells you it happened.
|
|
4041
|
+
*
|
|
4042
|
+
* **A cursor can expire, and on a busy run it expires quickly.** If the position a cursor
|
|
4043
|
+
* points at has since been discarded, the next page answers `410` rather than silently
|
|
4044
|
+
* serving a shortened page that looks complete. Treat that as a normal outcome: read
|
|
4045
|
+
* `availableSinceMs` from the error and start again from there.
|
|
4046
|
+
*
|
|
4047
|
+
* Readable by the run's owner, and by anyone if the run is `public` — the same rule the
|
|
4048
|
+
* signal channel applies to a subscription.
|
|
4049
|
+
*
|
|
4050
|
+
*/
|
|
4051
|
+
declare const getLiveRunSignals: <ThrowOnError extends boolean = false>(options: Options<GetLiveRunSignalsData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<LiveSignalPage, ResponseError, ThrowOnError>;
|
|
4052
|
+
/**
|
|
4053
|
+
* Mint a WebSocket connection token
|
|
4054
|
+
* Mints a short-lived token for the WebSocket connection used to receive a run's signals in
|
|
4055
|
+
* real time and to call `live.params` (the WebSocket form of `PUT /live/{runId}/params`) —
|
|
4056
|
+
* see the "Live execution" guide linked from this tag's description for the full protocol.
|
|
4057
|
+
* Carries no request body.
|
|
4058
|
+
*
|
|
4059
|
+
*/
|
|
4060
|
+
declare const mintLiveConnectionToken: <ThrowOnError extends boolean = false>(options?: Options<MintLiveConnectionTokenData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<LiveConnectionToken, unknown, ThrowOnError>;
|
|
3340
4061
|
|
|
3341
4062
|
declare const client: _hey_api_client_fetch.Client;
|
|
3342
4063
|
|
|
3343
|
-
export { type AcceptedJob, type Account, type AccountLinks, type AccountUsage, type AccountUsageLinks, type AuthTokenError, type AuthTokenResponse, type AuthenticateData, type AuthenticateError, type AuthenticateErrors, type AuthenticateResponse, type AuthenticateResponses, type BacktestJobResult, type CancelBacktestData, type CancelBacktestError, type CancelBacktestErrors, type CancelBacktestResponse, type CancelBacktestResponses, type CancelSweepData, type CancelSweepError, type CancelSweepErrors, type CancelSweepResponse, type CancelSweepResponses, type ClientOptions, type CompileStrategyData, type CompileStrategyError, type CompileStrategyErrors, type CompileStrategyResponse, type CompileStrategyResponses, type CoverageWindow, type CreateDatasetData, type CreateDatasetError, type CreateDatasetErrors, type CreateDatasetResponse, type CreateDatasetResponses, type DataSourceType, type Dataset, type DatasetCreated, type DatasetImportCreated, type DatasetImportDexRequest, type DatasetImportRequest, type DatasetImportState, type DatasetUploadSession, type DatasetUploadState, type DatasetUploadTarget, type DatasetVersion, type DatasetWithLinks, type DeclaredProperty, type DeleteDatasetData, type DeleteDatasetError, type DeleteDatasetErrors, type DeleteDatasetResponse, type DeleteDatasetResponses, type DeleteStrategyData, type DeleteStrategyError, type DeleteStrategyErrors, type DeleteStrategyResponse, type DeleteStrategyResponses, type DownloadKlinesData, type DownloadKlinesError, type DownloadKlinesErrors, type DownloadKlinesResponse, type DownloadKlinesResponses, type DownloadTickersData, type DownloadTickersError, type DownloadTickersErrors, type DownloadTickersResponse, type DownloadTickersResponses, type EquityCurveMeta, type EquityCurveOptions, type EquityCurveOutMode, type EquityCurveRequest, type EquityCurveResult, type EquityPoint, type Exchange, type ExecuteBacktestData, type ExecuteBacktestError, type ExecuteBacktestErrors, type ExecuteBacktestResponse, type ExecuteBacktestResponses, type ExecuteSweepAccepted, type ExecuteSweepData, type ExecuteSweepError, type ExecuteSweepErrors, type ExecuteSweepRequest, type ExecuteSweepResponse, type ExecuteSweepResponses, type ExecuteSweepResult, type FinalizeDatasetUploadData, type FinalizeDatasetUploadError, type FinalizeDatasetUploadErrors, type FinalizeDatasetUploadResponse, type FinalizeDatasetUploadResponses, type GetAccountData, type GetAccountResponse, type GetAccountResponses, type GetAccountUsageData, type GetAccountUsageResponse, type GetAccountUsageResponses, type GetBacktestResultData, type GetBacktestResultError, type GetBacktestResultErrors, type GetBacktestResultResponse, type GetBacktestResultResponses, type GetDatasetData, type GetDatasetError, type GetDatasetErrors, type GetDatasetImportData, type GetDatasetImportError, type GetDatasetImportErrors, type GetDatasetImportResponse, type GetDatasetImportResponses, type GetDatasetResponse, type GetDatasetResponses, type GetDatasetUploadData, type GetDatasetUploadError, type GetDatasetUploadErrors, type GetDatasetUploadResponse, type GetDatasetUploadResponses, type GetPrepareStatusData, type GetPrepareStatusError, type GetPrepareStatusErrors, type GetPrepareStatusResponse, type GetPrepareStatusResponses, type GetStrategyCodeData, type GetStrategyCodeError, type GetStrategyCodeErrors, type GetStrategyCodeResponse, type GetStrategyCodeResponses, type GetStrategyData, type GetStrategyError, type GetStrategyErrors, type GetStrategyResponse, type GetStrategyResponses, type GetSweepResultData, type GetSweepResultError, type GetSweepResultErrors, type GetSweepResultResponse, type GetSweepResultResponses, type GetSweepRunEquityCurveData, type GetSweepRunEquityCurveError, type GetSweepRunEquityCurveErrors, type GetSweepRunEquityCurveResponse, type GetSweepRunEquityCurveResponses, type GetSweepSensitivityData, type GetSweepSensitivityError, type GetSweepSensitivityErrors, type GetSweepSensitivityResponse, type GetSweepSensitivityResponses, type HalLink, type ImportDatasetData, type ImportDatasetError, type ImportDatasetErrors, type ImportDatasetResponse, type ImportDatasetResponses, type Instrument, type InstrumentCoverage, type InstrumentDetail, type InstrumentLinks, type InstrumentListMeta, type InstrumentListResponse, type JobState, type ListDatasetsData, type ListDatasetsResponse, type ListDatasetsResponses, type ListExchangesData, type ListExchangesResponse, type ListExchangesResponses, type ListInstrumentsData, type ListInstrumentsError, type ListInstrumentsErrors, type ListInstrumentsResponse, type ListInstrumentsResponses, type ListSegmentInstrumentsData, type ListSegmentInstrumentsError, type ListSegmentInstrumentsErrors, type ListSegmentInstrumentsResponse, type ListSegmentInstrumentsResponses, type ListStrategiesData, type ListStrategiesResponse, type ListStrategiesResponses, type Notice, type OpenDatasetUploadData, type OpenDatasetUploadError, type OpenDatasetUploadErrors, type OpenDatasetUploadResponse, type OpenDatasetUploadResponses, type Options, type PrepareBacktestData, type PrepareBacktestError, type PrepareBacktestErrors, type PrepareBacktestResponse, type PrepareBacktestResponses, type PrepareJobState, type PrepareRequest, type ResponseError, type ResultMap, type ScalarStrategyParamValue, type StrategyId, type StrategyLinks, type StrategyState, type StrategySummary, type SweepAxis, type SweepBaseConfig, type SweepHeatmap, type SweepHeatmapCell, type SweepMarginal, type SweepMarginalPoint, type SweepProgress, type SweepRunRow, type SweepSensitivity, type SweepSpecRequest, type ValidateStrategyData, type ValidateStrategyError, type ValidateStrategyErrors, type ValidateStrategyResponse, type ValidateStrategyResponses, type WalkForwardAccepted, type WalkForwardFold, type WalkForwardRequest, type WalkForwardResult, authenticate, cancelBacktest, cancelSweep, client, compileStrategy, createDataset, deleteDataset, deleteStrategy, downloadKlines, downloadTickers, executeBacktest, executeSweep, finalizeDatasetUpload, getAccount, getAccountUsage, getBacktestResult, getDataset, getDatasetImport, getDatasetUpload, getPrepareStatus, getStrategy, getStrategyCode, getSweepResult, getSweepRunEquityCurve, getSweepSensitivity, importDataset, listDatasets, listExchanges, listInstruments, listSegmentInstruments, listStrategies, openDatasetUpload, prepareBacktest, validateStrategy };
|
|
4064
|
+
export { type AcceptedJob, type Account, type AccountLinks, type AccountUsage, type AccountUsageLinks, type AuthTokenError, type AuthTokenResponse, type AuthenticateData, type AuthenticateError, type AuthenticateErrors, type AuthenticateResponse, type AuthenticateResponses, type BacktestJobResult, type CancelBacktestData, type CancelBacktestError, type CancelBacktestErrors, type CancelBacktestResponse, type CancelBacktestResponses, type CancelSweepData, type CancelSweepError, type CancelSweepErrors, type CancelSweepResponse, type CancelSweepResponses, type ClientOptions, type CompileStrategyData, type CompileStrategyError, type CompileStrategyErrors, type CompileStrategyResponse, type CompileStrategyResponses, type CoverageWindow, type CreateDatasetData, type CreateDatasetError, type CreateDatasetErrors, type CreateDatasetResponse, type CreateDatasetResponses, type DataSourceType, type Dataset, type DatasetCreated, type DatasetImportCreated, type DatasetImportDexRequest, type DatasetImportRequest, type DatasetImportState, type DatasetUploadSession, type DatasetUploadState, type DatasetUploadTarget, type DatasetVersion, type DatasetWithLinks, type DeclaredProperty, type DeleteDatasetData, type DeleteDatasetError, type DeleteDatasetErrors, type DeleteDatasetResponse, type DeleteDatasetResponses, type DeleteStrategyData, type DeleteStrategyError, type DeleteStrategyErrors, type DeleteStrategyResponse, type DeleteStrategyResponses, type DownloadKlinesData, type DownloadKlinesError, type DownloadKlinesErrors, type DownloadKlinesResponse, type DownloadKlinesResponses, type DownloadTickersData, type DownloadTickersError, type DownloadTickersErrors, type DownloadTickersResponse, type DownloadTickersResponses, type EquityCurveMeta, type EquityCurveOptions, type EquityCurveOutMode, type EquityCurveRequest, type EquityCurveResult, type EquityPoint, type Exchange, type ExecuteBacktestData, type ExecuteBacktestError, type ExecuteBacktestErrors, type ExecuteBacktestResponse, type ExecuteBacktestResponses, type ExecuteSweepAccepted, type ExecuteSweepData, type ExecuteSweepError, type ExecuteSweepErrors, type ExecuteSweepRequest, type ExecuteSweepResponse, type ExecuteSweepResponses, type ExecuteSweepResult, type FinalizeDatasetUploadData, type FinalizeDatasetUploadError, type FinalizeDatasetUploadErrors, type FinalizeDatasetUploadResponse, type FinalizeDatasetUploadResponses, type GetAccountData, type GetAccountResponse, type GetAccountResponses, type GetAccountUsageData, type GetAccountUsageResponse, type GetAccountUsageResponses, type GetBacktestResultData, type GetBacktestResultError, type GetBacktestResultErrors, type GetBacktestResultResponse, type GetBacktestResultResponses, type GetDatasetData, type GetDatasetError, type GetDatasetErrors, type GetDatasetImportData, type GetDatasetImportError, type GetDatasetImportErrors, type GetDatasetImportResponse, type GetDatasetImportResponses, type GetDatasetResponse, type GetDatasetResponses, type GetDatasetUploadData, type GetDatasetUploadError, type GetDatasetUploadErrors, type GetDatasetUploadResponse, type GetDatasetUploadResponses, type GetLiveData, type GetLiveError, type GetLiveErrors, type GetLiveResponse, type GetLiveResponses, type GetLiveRunSignalsData, type GetLiveRunSignalsError, type GetLiveRunSignalsErrors, type GetLiveRunSignalsResponse, type GetLiveRunSignalsResponses, type GetPrepareStatusData, type GetPrepareStatusError, type GetPrepareStatusErrors, type GetPrepareStatusResponse, type GetPrepareStatusResponses, type GetStrategyCodeData, type GetStrategyCodeError, type GetStrategyCodeErrors, type GetStrategyCodeResponse, type GetStrategyCodeResponses, type GetStrategyData, type GetStrategyError, type GetStrategyErrors, type GetStrategyResponse, type GetStrategyResponses, type GetSweepResultData, type GetSweepResultError, type GetSweepResultErrors, type GetSweepResultResponse, type GetSweepResultResponses, type GetSweepRunEquityCurveData, type GetSweepRunEquityCurveError, type GetSweepRunEquityCurveErrors, type GetSweepRunEquityCurveResponse, type GetSweepRunEquityCurveResponses, type GetSweepSensitivityData, type GetSweepSensitivityError, type GetSweepSensitivityErrors, type GetSweepSensitivityResponse, type GetSweepSensitivityResponses, type HalLink, type ImportDatasetData, type ImportDatasetError, type ImportDatasetErrors, type ImportDatasetResponse, type ImportDatasetResponses, type Instrument, type InstrumentCoverage, type InstrumentDetail, type InstrumentLinks, type InstrumentListMeta, type InstrumentListResponse, type JobState, type ListDatasetsData, type ListDatasetsResponse, type ListDatasetsResponses, type ListExchangesData, type ListExchangesResponse, type ListExchangesResponses, type ListInstrumentsData, type ListInstrumentsError, type ListInstrumentsErrors, type ListInstrumentsResponse, type ListInstrumentsResponses, type ListLiveData, type ListLiveError, type ListLiveErrors, type ListLiveResponse, type ListLiveResponses, type ListPublicLiveData, type ListPublicLiveError, type ListPublicLiveErrors, type ListPublicLiveResponse, type ListPublicLiveResponses, type ListSegmentInstrumentsData, type ListSegmentInstrumentsError, type ListSegmentInstrumentsErrors, type ListSegmentInstrumentsResponse, type ListSegmentInstrumentsResponses, type ListStrategiesData, type ListStrategiesResponse, type ListStrategiesResponses, type LiveConnectionToken, type LiveListResponse, type LiveParamsUpdateResult, type LiveRun, type LiveRunCompact, type LiveRunSummary, type LiveSignal, type LiveSignalInstrument, type LiveSignalOrder, type LiveSignalPage, type LiveSource, type MintLiveConnectionTokenData, type MintLiveConnectionTokenResponse, type MintLiveConnectionTokenResponses, type Notice, type OpenDatasetUploadData, type OpenDatasetUploadError, type OpenDatasetUploadErrors, type OpenDatasetUploadResponse, type OpenDatasetUploadResponses, type Options, type PrepareBacktestData, type PrepareBacktestError, type PrepareBacktestErrors, type PrepareBacktestResponse, type PrepareBacktestResponses, type PrepareJobState, type PrepareRequest, type PublicLiveListLinks, type PublicLiveListResponse, type PublicLiveNextLink, type PublicLiveRun, type ResponseError, type ResultMap, type ScalarStrategyParamValue, type StartLiveData, type StartLiveError, type StartLiveErrors, type StartLiveRequest, type StartLiveResponse, type StartLiveResponses, type StopLiveData, type StopLiveError, type StopLiveErrors, type StopLiveResponse, type StopLiveResponses, type StrategyId, type StrategyLinks, type StrategyState, type StrategySummary, type SweepAxis, type SweepBaseConfig, type SweepHeatmap, type SweepHeatmapCell, type SweepMarginal, type SweepMarginalPoint, type SweepProgress, type SweepRunRow, type SweepSensitivity, type SweepSpecRequest, type UpdateLiveData, type UpdateLiveError, type UpdateLiveErrors, type UpdateLiveParamsData, type UpdateLiveParamsError, type UpdateLiveParamsErrors, type UpdateLiveParamsRequest, type UpdateLiveParamsResponse, type UpdateLiveParamsResponses, type UpdateLiveRequest, type UpdateLiveResponse, type UpdateLiveResponses, type ValidateStrategyData, type ValidateStrategyError, type ValidateStrategyErrors, type ValidateStrategyResponse, type ValidateStrategyResponses, type WalkForwardAccepted, type WalkForwardFold, type WalkForwardRequest, type WalkForwardResult, authenticate, cancelBacktest, cancelSweep, client, compileStrategy, createDataset, deleteDataset, deleteStrategy, downloadKlines, downloadTickers, executeBacktest, executeSweep, finalizeDatasetUpload, getAccount, getAccountUsage, getBacktestResult, getDataset, getDatasetImport, getDatasetUpload, getLive, getLiveRunSignals, getPrepareStatus, getStrategy, getStrategyCode, getSweepResult, getSweepRunEquityCurve, getSweepSensitivity, importDataset, listDatasets, listExchanges, listInstruments, listLive, listPublicLive, listSegmentInstruments, listStrategies, mintLiveConnectionToken, openDatasetUpload, prepareBacktest, startLive, stopLive, updateLive, updateLiveParams, validateStrategy };
|