@tradejs/types 3.1.30-beta.315 → 3.1.30-beta.317
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/dist/index.d.mts +580 -549
- package/dist/index.d.ts +580 -549
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -70,6 +70,211 @@ interface ReferenceMarketsContext {
|
|
|
70
70
|
frames: Partial<Record<'m15' | 'h1' | 'h4', ReferenceMarketFrame>>;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
+
/** A frozen, simulation-only entry policy. Never valid in a live runtime. */
|
|
74
|
+
type ResearchEntryPredicate = {
|
|
75
|
+
path: string;
|
|
76
|
+
} & ({
|
|
77
|
+
op: '<=' | '>=';
|
|
78
|
+
value: number;
|
|
79
|
+
} | {
|
|
80
|
+
op: '==';
|
|
81
|
+
value: string | boolean;
|
|
82
|
+
});
|
|
83
|
+
type ResearchEntryPolicy = {
|
|
84
|
+
schema: 'tradejs-research-entry-policy/v1';
|
|
85
|
+
strategy: string;
|
|
86
|
+
mode: 'current-gate' | 'rules';
|
|
87
|
+
minQuality: number;
|
|
88
|
+
/** Absent preserves both sides; an empty list disables every entry. */
|
|
89
|
+
directions?: Array<'LONG' | 'SHORT'>;
|
|
90
|
+
/** null blocks a side; an empty conjunction explicitly passes that side. */
|
|
91
|
+
rules: Record<'LONG' | 'SHORT', ResearchEntryPredicate[] | null>;
|
|
92
|
+
};
|
|
93
|
+
type ResearchEntryDecision = {
|
|
94
|
+
mode: ResearchEntryPolicy['mode'];
|
|
95
|
+
allowed: boolean;
|
|
96
|
+
quality?: number | null;
|
|
97
|
+
reason: string;
|
|
98
|
+
predicates?: Array<{
|
|
99
|
+
path: string;
|
|
100
|
+
actual: number | string | boolean | null;
|
|
101
|
+
passed: boolean;
|
|
102
|
+
}>;
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
/** Explicitly opt in. R is frozen for the policy, not the sum of open risks. */
|
|
106
|
+
interface PortfolioPolicyConfig {
|
|
107
|
+
id: string;
|
|
108
|
+
scope: 'strategy' | 'account' | {
|
|
109
|
+
strategies: string[];
|
|
110
|
+
};
|
|
111
|
+
riskUnit: number;
|
|
112
|
+
observationIntervalMs: number;
|
|
113
|
+
maxPriceAgeMs: number;
|
|
114
|
+
maxPositions?: number;
|
|
115
|
+
profitExit?: {
|
|
116
|
+
scope: 'position' | 'basket';
|
|
117
|
+
multiple: number;
|
|
118
|
+
minPositions?: number;
|
|
119
|
+
};
|
|
120
|
+
closeOppositeOnFill?: boolean;
|
|
121
|
+
}
|
|
122
|
+
interface PortfolioPosition {
|
|
123
|
+
id: string;
|
|
124
|
+
strategy: string | null;
|
|
125
|
+
symbol: string;
|
|
126
|
+
direction: Direction;
|
|
127
|
+
qty: number;
|
|
128
|
+
entryPrice: number;
|
|
129
|
+
markPrice: number | null;
|
|
130
|
+
markedAt: number | null;
|
|
131
|
+
stopLossPrice?: number | null;
|
|
132
|
+
}
|
|
133
|
+
interface PortfolioOrderObservation {
|
|
134
|
+
id: string;
|
|
135
|
+
status: 'pending' | 'partial' | 'filled' | 'cancelled' | 'rejected';
|
|
136
|
+
filledQty: number;
|
|
137
|
+
/** Durable receipt: original order terminal and compensation confirmed flat. */
|
|
138
|
+
compensated?: boolean;
|
|
139
|
+
positionId?: string;
|
|
140
|
+
}
|
|
141
|
+
interface PortfolioObservation {
|
|
142
|
+
asOf: number;
|
|
143
|
+
positions: PortfolioPosition[];
|
|
144
|
+
orders: PortfolioOrderObservation[];
|
|
145
|
+
}
|
|
146
|
+
interface PortfolioReservation {
|
|
147
|
+
id: string;
|
|
148
|
+
signalId: string;
|
|
149
|
+
strategy: string;
|
|
150
|
+
symbol: string;
|
|
151
|
+
direction: Direction;
|
|
152
|
+
qty: number;
|
|
153
|
+
timestamp: number;
|
|
154
|
+
/** A reservation exists before any request can leave the process. */
|
|
155
|
+
submitted: boolean;
|
|
156
|
+
oppositeHandled: boolean;
|
|
157
|
+
}
|
|
158
|
+
interface PortfolioCloseIntent {
|
|
159
|
+
positionId: string;
|
|
160
|
+
position: PortfolioPosition;
|
|
161
|
+
reason: 'PORTFOLIO_PROFIT_POSITION' | 'PORTFOLIO_PROFIT_BASKET' | 'PORTFOLIO_OPPOSITE_FILL';
|
|
162
|
+
createdAt: number;
|
|
163
|
+
lastAttemptAt: number | null;
|
|
164
|
+
}
|
|
165
|
+
interface PortfolioState {
|
|
166
|
+
schema: 'tradejs-portfolio/v1';
|
|
167
|
+
revision: number;
|
|
168
|
+
fingerprint: string;
|
|
169
|
+
reservations: PortfolioReservation[];
|
|
170
|
+
closing: PortfolioCloseIntent[];
|
|
171
|
+
completedSignals: Record<string, number>;
|
|
172
|
+
observedAt: number;
|
|
173
|
+
evaluatedAt: number;
|
|
174
|
+
blockedThrough: number;
|
|
175
|
+
}
|
|
176
|
+
interface PortfolioContext {
|
|
177
|
+
schema: 'tradejs-portfolio-context/v1';
|
|
178
|
+
asOf: number;
|
|
179
|
+
policyId: string;
|
|
180
|
+
positionCount: number;
|
|
181
|
+
pendingEntryCount: number;
|
|
182
|
+
longCount: number;
|
|
183
|
+
shortCount: number;
|
|
184
|
+
grossUnrealizedPnlR: number | null;
|
|
185
|
+
openStopRiskR: number | null;
|
|
186
|
+
largestPositionShare: number | null;
|
|
187
|
+
pricesComplete: boolean;
|
|
188
|
+
unknownOwnershipCount: number;
|
|
189
|
+
}
|
|
190
|
+
interface PortfolioStateStore {
|
|
191
|
+
read(): Promise<PortfolioState | null>;
|
|
192
|
+
compare(expected: PortfolioState | null, next: PortfolioState): Promise<boolean>;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
interface PortfolioEntryCandidate {
|
|
196
|
+
id: string;
|
|
197
|
+
strategy: string;
|
|
198
|
+
symbol: string;
|
|
199
|
+
direction: Direction;
|
|
200
|
+
stop: number;
|
|
201
|
+
targets: readonly number[];
|
|
202
|
+
gate: {
|
|
203
|
+
approved: boolean;
|
|
204
|
+
reason: string | null;
|
|
205
|
+
rawQuality: number | null;
|
|
206
|
+
explicitHardBlock: boolean;
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
interface PortfolioEntryBatch {
|
|
210
|
+
closedAt: number;
|
|
211
|
+
candidates: readonly PortfolioEntryCandidate[];
|
|
212
|
+
market: {
|
|
213
|
+
candle(symbol: string, barsAgo: number): Candle | undefined;
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
interface PortfolioEntrySelection {
|
|
217
|
+
ranked: readonly string[];
|
|
218
|
+
pending: readonly {
|
|
219
|
+
candidateId: string;
|
|
220
|
+
confirmAt: number;
|
|
221
|
+
}[];
|
|
222
|
+
}
|
|
223
|
+
interface PortfolioReplayExecution {
|
|
224
|
+
maxPositions: number;
|
|
225
|
+
feeRate: number;
|
|
226
|
+
slippageBps: number;
|
|
227
|
+
}
|
|
228
|
+
interface PortfolioConfirmation {
|
|
229
|
+
candidate: PortfolioEntryCandidate;
|
|
230
|
+
candle: Candle;
|
|
231
|
+
openingPrice: number;
|
|
232
|
+
minNetRewardToRisk: number;
|
|
233
|
+
/** Effective config of the portfolio entry. Older hosts may omit it. */
|
|
234
|
+
config?: StrategyConfig;
|
|
235
|
+
}
|
|
236
|
+
interface PortfolioChildStrategy {
|
|
237
|
+
entry: StrategyRegistryEntry;
|
|
238
|
+
config: StrategyConfig;
|
|
239
|
+
}
|
|
240
|
+
interface PortfolioStrategyEntry<TConfig extends StrategyConfig = any> {
|
|
241
|
+
kind: 'portfolio';
|
|
242
|
+
manifest: StrategyManifest;
|
|
243
|
+
defaults: TConfig;
|
|
244
|
+
parseConfig(input: unknown): TConfig;
|
|
245
|
+
resolveChildren(config: TConfig): readonly PortfolioChildStrategy[];
|
|
246
|
+
selectEntries(batch: PortfolioEntryBatch): PortfolioEntrySelection;
|
|
247
|
+
confirmEntry(input: PortfolioConfirmation): {
|
|
248
|
+
qty: number;
|
|
249
|
+
risk: number;
|
|
250
|
+
} | null;
|
|
251
|
+
execution: PortfolioReplayExecution;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
type AiFeatureRole = 'input' | 'data-quality' | 'metadata' | 'outcome' | 'policy';
|
|
255
|
+
type AiFeaturePrimitive = number | string | boolean | null;
|
|
256
|
+
/** Explicit strategy extensions use paths in the untrimmed signal projection. */
|
|
257
|
+
interface AiFeatureDefinition {
|
|
258
|
+
id: string;
|
|
259
|
+
version: number;
|
|
260
|
+
path: string;
|
|
261
|
+
source?: 'signal' | 'payload';
|
|
262
|
+
stationary?: boolean;
|
|
263
|
+
role: AiFeatureRole;
|
|
264
|
+
scope: 'target' | 'benchmark' | 'global' | 'setup';
|
|
265
|
+
unit: string;
|
|
266
|
+
description: string;
|
|
267
|
+
/** Arrays require an explicit causal reduction, never implicit truncation. */
|
|
268
|
+
reduction?: 'last' | 'mean' | 'min' | 'max' | 'count';
|
|
269
|
+
/** Source field used for a ratio; division by zero or missing returns null. */
|
|
270
|
+
divideBy?: string;
|
|
271
|
+
}
|
|
272
|
+
interface AiFeatureSnapshot {
|
|
273
|
+
schema: 'tradejs-ai-features/v1';
|
|
274
|
+
definitions: readonly AiFeatureDefinition[];
|
|
275
|
+
values: Record<string, AiFeaturePrimitive>;
|
|
276
|
+
}
|
|
277
|
+
|
|
73
278
|
/** Closed hourly candles, trailing 30 calendar days, monthly UTC assignments. */
|
|
74
279
|
interface TickerProfile {
|
|
75
280
|
symbol: string;
|
|
@@ -1256,210 +1461,366 @@ interface CreateStrategyCoreParams<TConfig extends StrategyConfig, TIndicatorsSt
|
|
|
1256
1461
|
type StrategyCoreRunner = (candle: KlineChartItem, btcCandle: KlineChartItem) => Promise<StrategyDecision> | StrategyDecision;
|
|
1257
1462
|
type CreateStrategyCore<TConfig extends StrategyConfig, TSnapshot extends Record<string, any> | undefined = Record<string, any> | undefined, TNext = unknown> = (params: CreateStrategyCoreParams<TConfig, StrategyIndicatorsState<TNext, TSnapshot>>) => Promise<StrategyCoreRunner> | StrategyCoreRunner;
|
|
1258
1463
|
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
} | {
|
|
1266
|
-
op: '==';
|
|
1267
|
-
value: string | boolean;
|
|
1268
|
-
});
|
|
1269
|
-
type ResearchEntryPolicy = {
|
|
1270
|
-
schema: 'tradejs-research-entry-policy/v1';
|
|
1271
|
-
strategy: string;
|
|
1272
|
-
mode: 'current-gate' | 'rules';
|
|
1273
|
-
minQuality: number;
|
|
1274
|
-
/** Absent preserves both sides; an empty list disables every entry. */
|
|
1275
|
-
directions?: Array<'LONG' | 'SHORT'>;
|
|
1276
|
-
/** null blocks a side; an empty conjunction explicitly passes that side. */
|
|
1277
|
-
rules: Record<'LONG' | 'SHORT', ResearchEntryPredicate[] | null>;
|
|
1278
|
-
};
|
|
1279
|
-
type ResearchEntryDecision = {
|
|
1280
|
-
mode: ResearchEntryPolicy['mode'];
|
|
1281
|
-
allowed: boolean;
|
|
1282
|
-
quality?: number | null;
|
|
1283
|
-
reason: string;
|
|
1284
|
-
predicates?: Array<{
|
|
1285
|
-
path: string;
|
|
1286
|
-
actual: number | string | boolean | null;
|
|
1287
|
-
passed: boolean;
|
|
1288
|
-
}>;
|
|
1289
|
-
};
|
|
1290
|
-
|
|
1291
|
-
/** Explicitly opt in. R is frozen for the policy, not the sum of open risks. */
|
|
1292
|
-
interface PortfolioPolicyConfig {
|
|
1293
|
-
id: string;
|
|
1294
|
-
scope: 'strategy' | 'account' | {
|
|
1295
|
-
strategies: string[];
|
|
1296
|
-
};
|
|
1297
|
-
riskUnit: number;
|
|
1298
|
-
observationIntervalMs: number;
|
|
1299
|
-
maxPriceAgeMs: number;
|
|
1300
|
-
maxPositions?: number;
|
|
1301
|
-
profitExit?: {
|
|
1302
|
-
scope: 'position' | 'basket';
|
|
1303
|
-
multiple: number;
|
|
1304
|
-
minPositions?: number;
|
|
1305
|
-
};
|
|
1306
|
-
closeOppositeOnFill?: boolean;
|
|
1307
|
-
}
|
|
1308
|
-
interface PortfolioPosition {
|
|
1309
|
-
id: string;
|
|
1310
|
-
strategy: string | null;
|
|
1311
|
-
symbol: string;
|
|
1312
|
-
direction: Direction;
|
|
1313
|
-
qty: number;
|
|
1314
|
-
entryPrice: number;
|
|
1315
|
-
markPrice: number | null;
|
|
1316
|
-
markedAt: number | null;
|
|
1317
|
-
stopLossPrice?: number | null;
|
|
1318
|
-
}
|
|
1319
|
-
interface PortfolioOrderObservation {
|
|
1320
|
-
id: string;
|
|
1321
|
-
status: 'pending' | 'partial' | 'filled' | 'cancelled' | 'rejected';
|
|
1322
|
-
filledQty: number;
|
|
1323
|
-
/** Durable receipt: original order terminal and compensation confirmed flat. */
|
|
1324
|
-
compensated?: boolean;
|
|
1325
|
-
positionId?: string;
|
|
1326
|
-
}
|
|
1327
|
-
interface PortfolioObservation {
|
|
1328
|
-
asOf: number;
|
|
1329
|
-
positions: PortfolioPosition[];
|
|
1330
|
-
orders: PortfolioOrderObservation[];
|
|
1331
|
-
}
|
|
1332
|
-
interface PortfolioReservation {
|
|
1333
|
-
id: string;
|
|
1334
|
-
signalId: string;
|
|
1335
|
-
strategy: string;
|
|
1336
|
-
symbol: string;
|
|
1337
|
-
direction: Direction;
|
|
1338
|
-
qty: number;
|
|
1339
|
-
timestamp: number;
|
|
1340
|
-
/** A reservation exists before any request can leave the process. */
|
|
1341
|
-
submitted: boolean;
|
|
1342
|
-
oppositeHandled: boolean;
|
|
1464
|
+
interface IndicatorPluginComputeParams {
|
|
1465
|
+
candle: Candle;
|
|
1466
|
+
btcCandle?: Candle;
|
|
1467
|
+
data: Candle[];
|
|
1468
|
+
btcData: Candle[];
|
|
1469
|
+
baseResult: Partial<IndicatorSnapshot>;
|
|
1343
1470
|
}
|
|
1344
|
-
interface
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1471
|
+
interface IndicatorPluginFigureRenderer {
|
|
1472
|
+
key: string;
|
|
1473
|
+
title?: string;
|
|
1474
|
+
type?: 'line' | 'bar';
|
|
1475
|
+
color?: string;
|
|
1476
|
+
lineWidth?: number;
|
|
1477
|
+
dashed?: boolean;
|
|
1478
|
+
constant?: number;
|
|
1350
1479
|
}
|
|
1351
|
-
interface
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
completedSignals: Record<string, number>;
|
|
1358
|
-
observedAt: number;
|
|
1359
|
-
evaluatedAt: number;
|
|
1360
|
-
blockedThrough: number;
|
|
1480
|
+
interface IndicatorPluginRenderer {
|
|
1481
|
+
indicatorName?: string;
|
|
1482
|
+
shortName?: string;
|
|
1483
|
+
paneId?: string;
|
|
1484
|
+
minHeight?: number;
|
|
1485
|
+
figures: IndicatorPluginFigureRenderer[];
|
|
1361
1486
|
}
|
|
1362
|
-
interface
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
longCount: number;
|
|
1369
|
-
shortCount: number;
|
|
1370
|
-
grossUnrealizedPnlR: number | null;
|
|
1371
|
-
openStopRiskR: number | null;
|
|
1372
|
-
largestPositionShare: number | null;
|
|
1373
|
-
pricesComplete: boolean;
|
|
1374
|
-
unknownOwnershipCount: number;
|
|
1487
|
+
interface IndicatorPluginEntry {
|
|
1488
|
+
aiFeatures?: readonly AiFeatureDefinition[];
|
|
1489
|
+
indicator: Indicator;
|
|
1490
|
+
historyKey?: string;
|
|
1491
|
+
compute?: (params: IndicatorPluginComputeParams) => number | null | undefined;
|
|
1492
|
+
renderer?: IndicatorPluginRenderer;
|
|
1375
1493
|
}
|
|
1376
|
-
interface
|
|
1377
|
-
|
|
1378
|
-
compare(expected: PortfolioState | null, next: PortfolioState): Promise<boolean>;
|
|
1494
|
+
interface IndicatorPluginDefinition {
|
|
1495
|
+
indicatorEntries: IndicatorPluginEntry[];
|
|
1379
1496
|
}
|
|
1380
1497
|
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1498
|
+
interface AiPayload {
|
|
1499
|
+
featureSnapshot?: AiFeatureSnapshot;
|
|
1500
|
+
signal: {
|
|
1501
|
+
symbol: Signal['symbol'];
|
|
1502
|
+
signalId: Signal['signalId'];
|
|
1503
|
+
interval: Signal['interval'];
|
|
1504
|
+
direction: Signal['direction'];
|
|
1505
|
+
timestamp: Signal['timestamp'];
|
|
1506
|
+
strategy: Signal['strategy'];
|
|
1507
|
+
prices: {
|
|
1508
|
+
currentPrice: Signal['prices']['currentPrice'];
|
|
1509
|
+
takeProfitPrice: Signal['prices']['takeProfitPrice'];
|
|
1510
|
+
stopLossPrice: Signal['prices']['stopLossPrice'];
|
|
1511
|
+
};
|
|
1512
|
+
};
|
|
1513
|
+
figures: Record<string, unknown>;
|
|
1514
|
+
indicators: unknown;
|
|
1515
|
+
additionalIndicators: unknown;
|
|
1396
1516
|
}
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1517
|
+
interface StrategyAiAdapter {
|
|
1518
|
+
buildPayload?: (params: {
|
|
1519
|
+
signal: Signal;
|
|
1520
|
+
basePayload: AiPayload;
|
|
1521
|
+
}) => AiPayload;
|
|
1522
|
+
postProcessAnalysis?: (params: {
|
|
1523
|
+
signal: Signal;
|
|
1524
|
+
payload: AiPayload;
|
|
1525
|
+
analysis: Partial<SignalAnalysis>;
|
|
1526
|
+
}) => Partial<SignalAnalysis>;
|
|
1527
|
+
postProcessLocalAnalysis?: (params: {
|
|
1528
|
+
signal: Signal;
|
|
1529
|
+
payload: AiPayload;
|
|
1530
|
+
analysis: Partial<SignalAnalysis>;
|
|
1531
|
+
}) => Partial<SignalAnalysis>;
|
|
1532
|
+
buildSystemPromptAddon?: (params: {
|
|
1533
|
+
signal: Signal;
|
|
1534
|
+
}) => string;
|
|
1535
|
+
buildHumanPromptAddon?: (params: {
|
|
1536
|
+
signal: Signal;
|
|
1537
|
+
payload: AiPayload;
|
|
1538
|
+
}) => string;
|
|
1539
|
+
mapEntryRuntimeFromConfig?: (config: StrategyConfig) => StrategyRuntimeAiOptions | undefined;
|
|
1405
1540
|
}
|
|
1406
|
-
interface
|
|
1407
|
-
|
|
1408
|
-
|
|
1541
|
+
interface StrategyMlAdapter {
|
|
1542
|
+
normalizeSignal?: (signal: Signal) => Signal;
|
|
1543
|
+
normalizeStrategyConfig?: (strategyConfig?: Record<string, any>) => Record<string, any> | undefined;
|
|
1544
|
+
mapEntryRuntimeFromConfig?: (config: StrategyConfig) => StrategyRuntimeMlOptions | undefined;
|
|
1409
1545
|
}
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
mode: 'observe' | 'gate';
|
|
1414
|
-
provider?: JevProviderConfig;
|
|
1415
|
-
recordsDir?: string;
|
|
1416
|
-
modelFile?: string;
|
|
1417
|
-
modelSha256?: string;
|
|
1418
|
-
minScores?: Partial<Record<JevDimension, number>>;
|
|
1419
|
-
requireGeometry?: boolean;
|
|
1546
|
+
interface StrategyHookGateResult {
|
|
1547
|
+
allow?: boolean;
|
|
1548
|
+
reason?: string;
|
|
1420
1549
|
}
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1550
|
+
type EntryDecision = Extract<StrategyDecision, {
|
|
1551
|
+
kind: 'entry';
|
|
1552
|
+
}>;
|
|
1553
|
+
type ExitDecision = Extract<StrategyDecision, {
|
|
1554
|
+
kind: 'exit';
|
|
1555
|
+
}>;
|
|
1556
|
+
interface StrategyHookCtx {
|
|
1557
|
+
connector: Connector;
|
|
1558
|
+
strategyName: string;
|
|
1559
|
+
userName: string;
|
|
1425
1560
|
symbol: string;
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1561
|
+
universe?: MarketUniverse;
|
|
1562
|
+
assetClass?: AssetClass;
|
|
1563
|
+
accountId?: string;
|
|
1564
|
+
deploymentId?: string;
|
|
1565
|
+
policyProfileId?: string;
|
|
1566
|
+
strategyConfig: StrategyConfig;
|
|
1567
|
+
env: string;
|
|
1568
|
+
isConfigFromBacktest: boolean;
|
|
1434
1569
|
}
|
|
1435
|
-
interface
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1570
|
+
interface StrategyPolicyProfile {
|
|
1571
|
+
id: string;
|
|
1572
|
+
appliesTo?: {
|
|
1573
|
+
universes?: readonly MarketUniverse[];
|
|
1574
|
+
assetClasses?: readonly AssetClass[];
|
|
1575
|
+
};
|
|
1576
|
+
marketDataRequirements?: readonly MarketDataCapability[];
|
|
1577
|
+
entryRuntimeDefaults?: {
|
|
1578
|
+
ai?: StrategyRuntimeAiOptions;
|
|
1579
|
+
ml?: StrategyRuntimeMlOptions;
|
|
1580
|
+
};
|
|
1581
|
+
aiAdapter?: StrategyAiAdapter;
|
|
1582
|
+
mlAdapter?: StrategyMlAdapter;
|
|
1440
1583
|
}
|
|
1441
|
-
interface
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1584
|
+
interface StrategyHookMarketContext {
|
|
1585
|
+
candle?: KlineChartItem;
|
|
1586
|
+
btcCandle?: KlineChartItem;
|
|
1587
|
+
data?: KlineChartItem[];
|
|
1588
|
+
btcData?: KlineChartItem[];
|
|
1445
1589
|
}
|
|
1446
|
-
interface
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
scores: JevScores;
|
|
1455
|
-
createdAt: string;
|
|
1456
|
-
elapsedMs: number;
|
|
1590
|
+
interface StrategyHookEntryContext {
|
|
1591
|
+
context: StrategyEntrySignalContext;
|
|
1592
|
+
orderPlan: StrategyEntryOrderPlan;
|
|
1593
|
+
signal?: Signal;
|
|
1594
|
+
runtime: {
|
|
1595
|
+
raw?: StrategyEntryRuntimeOptions;
|
|
1596
|
+
resolved: StrategyEntryRuntimeOptions;
|
|
1597
|
+
};
|
|
1457
1598
|
}
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1599
|
+
type StrategyHookMlSkippedReason = 'BACKTEST' | 'DISABLED' | 'NO_RUNTIME' | 'NO_STRATEGY_CONFIG' | 'NO_THRESHOLD' | 'NO_RESULT';
|
|
1600
|
+
interface StrategyHookMlContext {
|
|
1601
|
+
config?: StrategyRuntimeMlOptions;
|
|
1602
|
+
attempted: boolean;
|
|
1603
|
+
applied: boolean;
|
|
1604
|
+
result?: Signal['ml'];
|
|
1605
|
+
skippedReason?: StrategyHookMlSkippedReason;
|
|
1606
|
+
}
|
|
1607
|
+
type StrategyHookAiSkippedReason = 'BACKTEST' | 'DISABLED' | 'NO_RUNTIME' | 'NO_QUALITY';
|
|
1608
|
+
interface StrategyHookAiContext {
|
|
1609
|
+
config?: StrategyRuntimeAiOptions;
|
|
1610
|
+
attempted: boolean;
|
|
1611
|
+
applied: boolean;
|
|
1612
|
+
quality?: number;
|
|
1613
|
+
skippedReason?: StrategyHookAiSkippedReason;
|
|
1614
|
+
}
|
|
1615
|
+
type StrategyHookStage = 'onInit' | 'onBar' | 'afterCoreDecision' | 'afterBarDecision' | 'onSkip' | 'beforeClosePosition' | 'afterEnrichMl' | 'afterEnrichAi' | 'beforeEntryGate' | 'beforePlaceOrder' | 'afterPlaceOrder' | 'runtime.beforePlaceOrder' | 'enrichSignalWithMl' | 'enrichSignalWithAi' | 'setTakeProfits' | 'setStopLoss' | 'protectPosition' | 'closePosition' | 'placeOrder';
|
|
1616
|
+
interface StrategyHookErrorPayload {
|
|
1617
|
+
stage: StrategyHookStage;
|
|
1618
|
+
cause: unknown;
|
|
1619
|
+
}
|
|
1620
|
+
interface StrategyHookErrorContext {
|
|
1621
|
+
ctx: StrategyHookCtx;
|
|
1622
|
+
market?: StrategyHookMarketContext;
|
|
1623
|
+
decision?: StrategyDecision;
|
|
1624
|
+
entry?: StrategyHookEntryContext;
|
|
1625
|
+
error: StrategyHookErrorPayload;
|
|
1626
|
+
}
|
|
1627
|
+
interface StrategyHookInitContext {
|
|
1628
|
+
ctx: StrategyHookCtx;
|
|
1629
|
+
market: Required<Pick<StrategyHookMarketContext, 'data' | 'btcData'>>;
|
|
1630
|
+
}
|
|
1631
|
+
interface StrategyHookBarContext {
|
|
1632
|
+
ctx: StrategyHookCtx;
|
|
1633
|
+
market: Required<Pick<StrategyHookMarketContext, 'candle' | 'btcCandle'>>;
|
|
1634
|
+
}
|
|
1635
|
+
interface StrategyHookAfterDecisionContext extends StrategyHookBarContext {
|
|
1636
|
+
decision: StrategyDecision;
|
|
1637
|
+
}
|
|
1638
|
+
interface StrategyHookSkipContext extends StrategyHookAfterDecisionContext {
|
|
1639
|
+
decision: Extract<StrategyDecision, {
|
|
1640
|
+
kind: 'skip';
|
|
1641
|
+
}>;
|
|
1642
|
+
}
|
|
1643
|
+
interface StrategyHookBeforeCloseContext extends StrategyHookAfterDecisionContext {
|
|
1644
|
+
decision: ExitDecision;
|
|
1645
|
+
}
|
|
1646
|
+
interface StrategyHookEnrichContext {
|
|
1647
|
+
ctx: StrategyHookCtx;
|
|
1648
|
+
market: Required<Pick<StrategyHookMarketContext, 'candle' | 'btcCandle'>>;
|
|
1649
|
+
decision: EntryDecision;
|
|
1650
|
+
entry: StrategyHookEntryContext;
|
|
1651
|
+
ml: StrategyHookMlContext;
|
|
1652
|
+
}
|
|
1653
|
+
interface StrategyHookAfterAiContext extends StrategyHookEnrichContext {
|
|
1654
|
+
ai: StrategyHookAiContext;
|
|
1655
|
+
}
|
|
1656
|
+
interface StrategyHookPolicyContext {
|
|
1657
|
+
aiQuality?: number;
|
|
1658
|
+
makeOrdersEnabled: boolean;
|
|
1659
|
+
minAiQuality: number;
|
|
1660
|
+
}
|
|
1661
|
+
interface StrategyHookBeforeEntryGateContext {
|
|
1662
|
+
ctx: StrategyHookCtx;
|
|
1663
|
+
market: Required<Pick<StrategyHookMarketContext, 'candle' | 'btcCandle'>>;
|
|
1664
|
+
decision: EntryDecision;
|
|
1665
|
+
entry: StrategyHookEntryContext;
|
|
1666
|
+
policy: StrategyHookPolicyContext;
|
|
1667
|
+
ml?: StrategyHookMlContext;
|
|
1668
|
+
ai?: StrategyHookAiContext;
|
|
1669
|
+
}
|
|
1670
|
+
interface StrategyHookBeforePlaceOrderContext {
|
|
1671
|
+
ctx: StrategyHookCtx;
|
|
1672
|
+
market: Required<Pick<StrategyHookMarketContext, 'candle' | 'btcCandle'>>;
|
|
1673
|
+
decision: EntryDecision;
|
|
1674
|
+
entry: StrategyHookEntryContext;
|
|
1675
|
+
policy: StrategyHookPolicyContext;
|
|
1676
|
+
ml?: StrategyHookMlContext;
|
|
1677
|
+
ai?: StrategyHookAiContext;
|
|
1678
|
+
}
|
|
1679
|
+
interface StrategyHookOrderContext {
|
|
1680
|
+
result: Signal | string;
|
|
1681
|
+
}
|
|
1682
|
+
interface StrategyHookAfterPlaceOrderContext {
|
|
1683
|
+
ctx: StrategyHookCtx;
|
|
1684
|
+
market: Required<Pick<StrategyHookMarketContext, 'candle' | 'btcCandle'>>;
|
|
1685
|
+
decision: EntryDecision;
|
|
1686
|
+
entry: StrategyHookEntryContext;
|
|
1687
|
+
policy: StrategyHookPolicyContext;
|
|
1688
|
+
ml?: StrategyHookMlContext;
|
|
1689
|
+
ai?: StrategyHookAiContext;
|
|
1690
|
+
order: StrategyHookOrderContext;
|
|
1691
|
+
}
|
|
1692
|
+
type StrategyMarketContextSource = 'binance' | 'coinmarketcap' | 'derivatives' | 'hyperliquidWhales' | 'news';
|
|
1693
|
+
interface StrategyManifest {
|
|
1694
|
+
aiFeatures?: readonly AiFeatureDefinition[];
|
|
1695
|
+
name: string;
|
|
1696
|
+
contextRequirements?: {
|
|
1697
|
+
tickerProfiles?: {
|
|
1698
|
+
provider: string;
|
|
1699
|
+
universeId: string;
|
|
1700
|
+
};
|
|
1701
|
+
/** Market context that must be available before strategy core evaluation. */
|
|
1702
|
+
core?: readonly StrategyMarketContextSource[];
|
|
1703
|
+
};
|
|
1704
|
+
policyProfiles?: readonly StrategyPolicyProfile[];
|
|
1705
|
+
defaultPolicyProfileId?: string;
|
|
1706
|
+
entryRuntimeDefaults?: {
|
|
1707
|
+
ai?: StrategyRuntimeAiOptions;
|
|
1708
|
+
ml?: Pick<StrategyRuntimeMlOptions, 'enabled'>;
|
|
1709
|
+
};
|
|
1710
|
+
hooks?: {
|
|
1711
|
+
onInit?: (params: StrategyHookInitContext) => Promise<void> | void;
|
|
1712
|
+
onBar?: (params: StrategyHookBarContext) => Promise<StrategyDecision | void> | StrategyDecision | void;
|
|
1713
|
+
afterCoreDecision?: (params: StrategyHookAfterDecisionContext) => Promise<void> | void;
|
|
1714
|
+
afterBarDecision?: (params: StrategyHookAfterDecisionContext) => Promise<void> | void;
|
|
1715
|
+
onSkip?: (params: StrategyHookSkipContext) => Promise<void> | void;
|
|
1716
|
+
beforeClosePosition?: (params: StrategyHookBeforeCloseContext) => Promise<StrategyHookGateResult | void> | StrategyHookGateResult | void;
|
|
1717
|
+
afterEnrichMl?: (params: StrategyHookEnrichContext) => Promise<void> | void;
|
|
1718
|
+
afterEnrichAi?: (params: StrategyHookAfterAiContext) => Promise<void> | void;
|
|
1719
|
+
beforeEntryGate?: (params: StrategyHookBeforeEntryGateContext) => Promise<StrategyHookGateResult | void> | StrategyHookGateResult | void;
|
|
1720
|
+
beforePlaceOrder?: (params: StrategyHookBeforePlaceOrderContext) => Promise<void> | void;
|
|
1721
|
+
afterPlaceOrder?: (params: StrategyHookAfterPlaceOrderContext) => Promise<void> | void;
|
|
1722
|
+
onRuntimeError?: (params: StrategyHookErrorContext) => Promise<void> | void;
|
|
1723
|
+
};
|
|
1724
|
+
aiAdapter?: StrategyAiAdapter;
|
|
1725
|
+
mlAdapter?: StrategyMlAdapter;
|
|
1726
|
+
}
|
|
1727
|
+
interface StrategyRegistryEntry<TConfig extends StrategyConfig = any> {
|
|
1728
|
+
kind?: 'candle';
|
|
1729
|
+
manifest: StrategyManifest;
|
|
1730
|
+
defaults: TConfig;
|
|
1731
|
+
/** Parse an untrusted project declaration into a complete strategy config. */
|
|
1732
|
+
parseConfig: (input: unknown) => TConfig;
|
|
1733
|
+
createCore: CreateStrategyCore<TConfig, any, any>;
|
|
1734
|
+
detectorKey?: (config: TConfig) => string | undefined;
|
|
1735
|
+
detectorNoSignalSkipReason?: string;
|
|
1736
|
+
}
|
|
1737
|
+
type RegisteredStrategyEntry = StrategyRegistryEntry | PortfolioStrategyEntry;
|
|
1738
|
+
interface StrategyPluginDefinition {
|
|
1739
|
+
strategyEntries: RegisteredStrategyEntry[];
|
|
1740
|
+
}
|
|
1741
|
+
|
|
1742
|
+
type JevDimension = 'trend' | 'swing' | 'participation' | 'setupParticipation' | 'extension' | 'confirmation' | 'setupStrength' | 'geometry' | 'signalStrength';
|
|
1743
|
+
/** Internal scores stay normalized; signalStrength is exported on a 1–10 scale. */
|
|
1744
|
+
type JevScores = Record<JevDimension, number | null>;
|
|
1745
|
+
type JevQuestionSet = 'micro-v3';
|
|
1746
|
+
interface JevScoreQuestion {
|
|
1747
|
+
type: 'score';
|
|
1748
|
+
instructions: string;
|
|
1749
|
+
criteria: readonly string[];
|
|
1750
|
+
}
|
|
1751
|
+
type JevFeature = number | string | boolean | null;
|
|
1752
|
+
interface JevFactProvenance {
|
|
1753
|
+
knownAt: number;
|
|
1754
|
+
scope: 'target' | 'strategy';
|
|
1755
|
+
unit?: string;
|
|
1756
|
+
source?: string;
|
|
1757
|
+
}
|
|
1758
|
+
/** Optional, signal-time facts supplied by any strategy package. */
|
|
1759
|
+
interface JevEvidence {
|
|
1760
|
+
version: string;
|
|
1761
|
+
knownAt: number;
|
|
1762
|
+
facts: Record<string, JevFeature>;
|
|
1763
|
+
geometry?: Record<string, JevFeature>;
|
|
1764
|
+
/** Optional per-fact provenance; omitted facts use the evidence-level knownAt. */
|
|
1765
|
+
factDetails?: Record<string, JevFactProvenance>;
|
|
1766
|
+
}
|
|
1767
|
+
interface JevProviderConfig {
|
|
1768
|
+
endpoint: string;
|
|
1769
|
+
model: string;
|
|
1770
|
+
}
|
|
1771
|
+
/** Credentials belong to Account settings, never to this configuration. */
|
|
1772
|
+
interface JevConfig {
|
|
1773
|
+
source: 'provider' | 'recorded' | 'local';
|
|
1774
|
+
mode: 'observe' | 'gate';
|
|
1775
|
+
provider?: JevProviderConfig;
|
|
1776
|
+
recordsDir?: string;
|
|
1777
|
+
modelFile?: string;
|
|
1778
|
+
modelSha256?: string;
|
|
1779
|
+
minScores?: Partial<Record<JevDimension, number>>;
|
|
1780
|
+
requireGeometry?: boolean;
|
|
1781
|
+
}
|
|
1782
|
+
interface JevInput {
|
|
1783
|
+
questionSet: JevQuestionSet;
|
|
1784
|
+
schema: 'tradejs-jev-input/v4';
|
|
1785
|
+
strategy: string;
|
|
1786
|
+
symbol: string;
|
|
1787
|
+
interval: string;
|
|
1788
|
+
timestamp: number;
|
|
1789
|
+
direction: 'LONG' | 'SHORT';
|
|
1790
|
+
features: Record<string, JevFeature>;
|
|
1791
|
+
provenance: Record<string, JevFactProvenance>;
|
|
1792
|
+
missing: Record<string, string>;
|
|
1793
|
+
questions: JevDimension[];
|
|
1794
|
+
geometryStatus: 'available' | 'facts_only' | 'absent' | 'invalid';
|
|
1795
|
+
}
|
|
1796
|
+
interface JevScoreAnswer {
|
|
1797
|
+
type: 'score';
|
|
1798
|
+
score: number;
|
|
1799
|
+
confidence: number;
|
|
1800
|
+
probabilities: Record<string, number>;
|
|
1801
|
+
}
|
|
1802
|
+
interface JevResponse {
|
|
1803
|
+
model: string;
|
|
1804
|
+
answers: Partial<Record<JevDimension, JevScoreAnswer>>;
|
|
1805
|
+
usage?: Record<string, unknown>;
|
|
1806
|
+
}
|
|
1807
|
+
interface JevRecord {
|
|
1808
|
+
schema: 'tradejs-jev-record/v4';
|
|
1809
|
+
id: string;
|
|
1810
|
+
inputHash: string;
|
|
1811
|
+
questionsHash: string;
|
|
1812
|
+
provider: JevProviderConfig;
|
|
1813
|
+
input: JevInput;
|
|
1814
|
+
response: JevResponse;
|
|
1815
|
+
scores: JevScores;
|
|
1816
|
+
createdAt: string;
|
|
1817
|
+
elapsedMs: number;
|
|
1818
|
+
}
|
|
1819
|
+
interface SignalAssessment {
|
|
1820
|
+
questionSet: JevQuestionSet;
|
|
1821
|
+
schema: 'tradejs-signal-assessment/v5';
|
|
1822
|
+
source: JevConfig['source'];
|
|
1823
|
+
mode: JevConfig['mode'];
|
|
1463
1824
|
status: 'available' | 'unavailable';
|
|
1464
1825
|
recordId?: string;
|
|
1465
1826
|
inputHash: string;
|
|
@@ -1555,6 +1916,31 @@ interface ExecutionCostModel {
|
|
|
1555
1916
|
capturedAt: number;
|
|
1556
1917
|
}
|
|
1557
1918
|
type Strategy = (candle: KlineChartItem, btcCandle: KlineChartItem, ethCandle?: KlineChartItem) => Promise<string | Signal>;
|
|
1919
|
+
interface PreparedPortfolioEntry {
|
|
1920
|
+
decision: Extract<StrategyDecision, {
|
|
1921
|
+
kind: 'entry';
|
|
1922
|
+
}> & {
|
|
1923
|
+
signal: Signal;
|
|
1924
|
+
};
|
|
1925
|
+
approved: boolean;
|
|
1926
|
+
reason: string | null;
|
|
1927
|
+
ai?: StrategyHookAiContext;
|
|
1928
|
+
ml?: StrategyHookMlContext;
|
|
1929
|
+
}
|
|
1930
|
+
type PortfolioChildRuntime = Strategy & {
|
|
1931
|
+
reconcilePortfolio(): Promise<void>;
|
|
1932
|
+
submitPortfolioEntry(input: {
|
|
1933
|
+
offer: PreparedPortfolioEntry;
|
|
1934
|
+
candle: KlineChartItem;
|
|
1935
|
+
btcCandle: KlineChartItem;
|
|
1936
|
+
confirmation?: {
|
|
1937
|
+
price: number;
|
|
1938
|
+
qty: number;
|
|
1939
|
+
risk: number;
|
|
1940
|
+
timestamp: number;
|
|
1941
|
+
};
|
|
1942
|
+
}): Promise<string | Signal>;
|
|
1943
|
+
};
|
|
1558
1944
|
type BacktestDetectorOptimizedStrategy = Strategy & {
|
|
1559
1945
|
detectorFanoutKey?: string;
|
|
1560
1946
|
detectorNoSignalSkipReason?: string;
|
|
@@ -1629,6 +2015,10 @@ interface StrategyCreatorParams {
|
|
|
1629
2015
|
sharedIndicatorsReplayKey?: string;
|
|
1630
2016
|
sharedStrategyStateKey?: string;
|
|
1631
2017
|
portfolioShadow?: true;
|
|
2018
|
+
portfolioLive?: {
|
|
2019
|
+
policy: PortfolioPolicyConfig;
|
|
2020
|
+
offer(entry: PreparedPortfolioEntry): void;
|
|
2021
|
+
};
|
|
1632
2022
|
/** Historical composition may defer eligible submissions until the batch is complete. */
|
|
1633
2023
|
selectReplayEntry?: (input: {
|
|
1634
2024
|
decision: Extract<StrategyDecision, {
|
|
@@ -2063,30 +2453,6 @@ declare const DEFAULT_MARKET_UNIVERSE: MarketUniverse;
|
|
|
2063
2453
|
declare const isMarketUniverse: (value: unknown) => value is MarketUniverse;
|
|
2064
2454
|
declare const resolveConnectorUniverse: (capabilities: ConnectorCapabilities, requested?: unknown) => MarketUniverse;
|
|
2065
2455
|
|
|
2066
|
-
type AiFeatureRole = 'input' | 'data-quality' | 'metadata' | 'outcome' | 'policy';
|
|
2067
|
-
type AiFeaturePrimitive = number | string | boolean | null;
|
|
2068
|
-
/** Explicit strategy extensions use paths in the untrimmed signal projection. */
|
|
2069
|
-
interface AiFeatureDefinition {
|
|
2070
|
-
id: string;
|
|
2071
|
-
version: number;
|
|
2072
|
-
path: string;
|
|
2073
|
-
source?: 'signal' | 'payload';
|
|
2074
|
-
stationary?: boolean;
|
|
2075
|
-
role: AiFeatureRole;
|
|
2076
|
-
scope: 'target' | 'benchmark' | 'global' | 'setup';
|
|
2077
|
-
unit: string;
|
|
2078
|
-
description: string;
|
|
2079
|
-
/** Arrays require an explicit causal reduction, never implicit truncation. */
|
|
2080
|
-
reduction?: 'last' | 'mean' | 'min' | 'max' | 'count';
|
|
2081
|
-
/** Source field used for a ratio; division by zero or missing returns null. */
|
|
2082
|
-
divideBy?: string;
|
|
2083
|
-
}
|
|
2084
|
-
interface AiFeatureSnapshot {
|
|
2085
|
-
schema: 'tradejs-ai-features/v1';
|
|
2086
|
-
definitions: readonly AiFeatureDefinition[];
|
|
2087
|
-
values: Record<string, AiFeaturePrimitive>;
|
|
2088
|
-
}
|
|
2089
|
-
|
|
2090
2456
|
type Interval = '1' | '3' | '5' | '15' | '30' | '60' | '120' | '240' | '360' | '720' | 'D' | 'W' | 'M';
|
|
2091
2457
|
type Provider = 'bybit' | 'binance' | 'coinbase' | 'hyperliquid';
|
|
2092
2458
|
interface Candle {
|
|
@@ -3003,341 +3369,6 @@ interface BotStatus {
|
|
|
3003
3369
|
type BotResults = BotStatus[];
|
|
3004
3370
|
type BotConfig = Bot[];
|
|
3005
3371
|
|
|
3006
|
-
interface PortfolioEntryCandidate {
|
|
3007
|
-
id: string;
|
|
3008
|
-
strategy: string;
|
|
3009
|
-
symbol: string;
|
|
3010
|
-
direction: Direction;
|
|
3011
|
-
stop: number;
|
|
3012
|
-
targets: readonly number[];
|
|
3013
|
-
gate: {
|
|
3014
|
-
approved: boolean;
|
|
3015
|
-
reason: string | null;
|
|
3016
|
-
rawQuality: number | null;
|
|
3017
|
-
explicitHardBlock: boolean;
|
|
3018
|
-
};
|
|
3019
|
-
}
|
|
3020
|
-
interface PortfolioEntryBatch {
|
|
3021
|
-
closedAt: number;
|
|
3022
|
-
candidates: readonly PortfolioEntryCandidate[];
|
|
3023
|
-
market: {
|
|
3024
|
-
candle(symbol: string, barsAgo: number): Candle | undefined;
|
|
3025
|
-
};
|
|
3026
|
-
}
|
|
3027
|
-
interface PortfolioEntrySelection {
|
|
3028
|
-
ranked: readonly string[];
|
|
3029
|
-
pending: readonly {
|
|
3030
|
-
candidateId: string;
|
|
3031
|
-
confirmAt: number;
|
|
3032
|
-
}[];
|
|
3033
|
-
}
|
|
3034
|
-
interface PortfolioReplayExecution {
|
|
3035
|
-
maxPositions: number;
|
|
3036
|
-
feeRate: number;
|
|
3037
|
-
slippageBps: number;
|
|
3038
|
-
}
|
|
3039
|
-
interface PortfolioConfirmation {
|
|
3040
|
-
candidate: PortfolioEntryCandidate;
|
|
3041
|
-
candle: Candle;
|
|
3042
|
-
openingPrice: number;
|
|
3043
|
-
minNetRewardToRisk: number;
|
|
3044
|
-
}
|
|
3045
|
-
interface PortfolioChildStrategy {
|
|
3046
|
-
entry: StrategyRegistryEntry;
|
|
3047
|
-
config: StrategyConfig;
|
|
3048
|
-
}
|
|
3049
|
-
interface PortfolioStrategyEntry<TConfig extends StrategyConfig = any> {
|
|
3050
|
-
kind: 'portfolio';
|
|
3051
|
-
manifest: StrategyManifest;
|
|
3052
|
-
defaults: TConfig;
|
|
3053
|
-
parseConfig(input: unknown): TConfig;
|
|
3054
|
-
resolveChildren(config: TConfig): readonly PortfolioChildStrategy[];
|
|
3055
|
-
selectEntries(batch: PortfolioEntryBatch): PortfolioEntrySelection;
|
|
3056
|
-
confirmEntry(input: PortfolioConfirmation): {
|
|
3057
|
-
qty: number;
|
|
3058
|
-
risk: number;
|
|
3059
|
-
} | null;
|
|
3060
|
-
execution: PortfolioReplayExecution;
|
|
3061
|
-
}
|
|
3062
|
-
|
|
3063
|
-
interface IndicatorPluginComputeParams {
|
|
3064
|
-
candle: Candle;
|
|
3065
|
-
btcCandle?: Candle;
|
|
3066
|
-
data: Candle[];
|
|
3067
|
-
btcData: Candle[];
|
|
3068
|
-
baseResult: Partial<IndicatorSnapshot>;
|
|
3069
|
-
}
|
|
3070
|
-
interface IndicatorPluginFigureRenderer {
|
|
3071
|
-
key: string;
|
|
3072
|
-
title?: string;
|
|
3073
|
-
type?: 'line' | 'bar';
|
|
3074
|
-
color?: string;
|
|
3075
|
-
lineWidth?: number;
|
|
3076
|
-
dashed?: boolean;
|
|
3077
|
-
constant?: number;
|
|
3078
|
-
}
|
|
3079
|
-
interface IndicatorPluginRenderer {
|
|
3080
|
-
indicatorName?: string;
|
|
3081
|
-
shortName?: string;
|
|
3082
|
-
paneId?: string;
|
|
3083
|
-
minHeight?: number;
|
|
3084
|
-
figures: IndicatorPluginFigureRenderer[];
|
|
3085
|
-
}
|
|
3086
|
-
interface IndicatorPluginEntry {
|
|
3087
|
-
aiFeatures?: readonly AiFeatureDefinition[];
|
|
3088
|
-
indicator: Indicator;
|
|
3089
|
-
historyKey?: string;
|
|
3090
|
-
compute?: (params: IndicatorPluginComputeParams) => number | null | undefined;
|
|
3091
|
-
renderer?: IndicatorPluginRenderer;
|
|
3092
|
-
}
|
|
3093
|
-
interface IndicatorPluginDefinition {
|
|
3094
|
-
indicatorEntries: IndicatorPluginEntry[];
|
|
3095
|
-
}
|
|
3096
|
-
|
|
3097
|
-
interface AiPayload {
|
|
3098
|
-
featureSnapshot?: AiFeatureSnapshot;
|
|
3099
|
-
signal: {
|
|
3100
|
-
symbol: Signal['symbol'];
|
|
3101
|
-
signalId: Signal['signalId'];
|
|
3102
|
-
interval: Signal['interval'];
|
|
3103
|
-
direction: Signal['direction'];
|
|
3104
|
-
timestamp: Signal['timestamp'];
|
|
3105
|
-
strategy: Signal['strategy'];
|
|
3106
|
-
prices: {
|
|
3107
|
-
currentPrice: Signal['prices']['currentPrice'];
|
|
3108
|
-
takeProfitPrice: Signal['prices']['takeProfitPrice'];
|
|
3109
|
-
stopLossPrice: Signal['prices']['stopLossPrice'];
|
|
3110
|
-
};
|
|
3111
|
-
};
|
|
3112
|
-
figures: Record<string, unknown>;
|
|
3113
|
-
indicators: unknown;
|
|
3114
|
-
additionalIndicators: unknown;
|
|
3115
|
-
}
|
|
3116
|
-
interface StrategyAiAdapter {
|
|
3117
|
-
buildPayload?: (params: {
|
|
3118
|
-
signal: Signal;
|
|
3119
|
-
basePayload: AiPayload;
|
|
3120
|
-
}) => AiPayload;
|
|
3121
|
-
postProcessAnalysis?: (params: {
|
|
3122
|
-
signal: Signal;
|
|
3123
|
-
payload: AiPayload;
|
|
3124
|
-
analysis: Partial<SignalAnalysis>;
|
|
3125
|
-
}) => Partial<SignalAnalysis>;
|
|
3126
|
-
postProcessLocalAnalysis?: (params: {
|
|
3127
|
-
signal: Signal;
|
|
3128
|
-
payload: AiPayload;
|
|
3129
|
-
analysis: Partial<SignalAnalysis>;
|
|
3130
|
-
}) => Partial<SignalAnalysis>;
|
|
3131
|
-
buildSystemPromptAddon?: (params: {
|
|
3132
|
-
signal: Signal;
|
|
3133
|
-
}) => string;
|
|
3134
|
-
buildHumanPromptAddon?: (params: {
|
|
3135
|
-
signal: Signal;
|
|
3136
|
-
payload: AiPayload;
|
|
3137
|
-
}) => string;
|
|
3138
|
-
mapEntryRuntimeFromConfig?: (config: StrategyConfig) => StrategyRuntimeAiOptions | undefined;
|
|
3139
|
-
}
|
|
3140
|
-
interface StrategyMlAdapter {
|
|
3141
|
-
normalizeSignal?: (signal: Signal) => Signal;
|
|
3142
|
-
normalizeStrategyConfig?: (strategyConfig?: Record<string, any>) => Record<string, any> | undefined;
|
|
3143
|
-
mapEntryRuntimeFromConfig?: (config: StrategyConfig) => StrategyRuntimeMlOptions | undefined;
|
|
3144
|
-
}
|
|
3145
|
-
interface StrategyHookGateResult {
|
|
3146
|
-
allow?: boolean;
|
|
3147
|
-
reason?: string;
|
|
3148
|
-
}
|
|
3149
|
-
type EntryDecision = Extract<StrategyDecision, {
|
|
3150
|
-
kind: 'entry';
|
|
3151
|
-
}>;
|
|
3152
|
-
type ExitDecision = Extract<StrategyDecision, {
|
|
3153
|
-
kind: 'exit';
|
|
3154
|
-
}>;
|
|
3155
|
-
interface StrategyHookCtx {
|
|
3156
|
-
connector: Connector;
|
|
3157
|
-
strategyName: string;
|
|
3158
|
-
userName: string;
|
|
3159
|
-
symbol: string;
|
|
3160
|
-
universe?: MarketUniverse;
|
|
3161
|
-
assetClass?: AssetClass;
|
|
3162
|
-
accountId?: string;
|
|
3163
|
-
deploymentId?: string;
|
|
3164
|
-
policyProfileId?: string;
|
|
3165
|
-
strategyConfig: StrategyConfig;
|
|
3166
|
-
env: string;
|
|
3167
|
-
isConfigFromBacktest: boolean;
|
|
3168
|
-
}
|
|
3169
|
-
interface StrategyPolicyProfile {
|
|
3170
|
-
id: string;
|
|
3171
|
-
appliesTo?: {
|
|
3172
|
-
universes?: readonly MarketUniverse[];
|
|
3173
|
-
assetClasses?: readonly AssetClass[];
|
|
3174
|
-
};
|
|
3175
|
-
marketDataRequirements?: readonly MarketDataCapability[];
|
|
3176
|
-
entryRuntimeDefaults?: {
|
|
3177
|
-
ai?: StrategyRuntimeAiOptions;
|
|
3178
|
-
ml?: StrategyRuntimeMlOptions;
|
|
3179
|
-
};
|
|
3180
|
-
aiAdapter?: StrategyAiAdapter;
|
|
3181
|
-
mlAdapter?: StrategyMlAdapter;
|
|
3182
|
-
}
|
|
3183
|
-
interface StrategyHookMarketContext {
|
|
3184
|
-
candle?: KlineChartItem;
|
|
3185
|
-
btcCandle?: KlineChartItem;
|
|
3186
|
-
data?: KlineChartItem[];
|
|
3187
|
-
btcData?: KlineChartItem[];
|
|
3188
|
-
}
|
|
3189
|
-
interface StrategyHookEntryContext {
|
|
3190
|
-
context: StrategyEntrySignalContext;
|
|
3191
|
-
orderPlan: StrategyEntryOrderPlan;
|
|
3192
|
-
signal?: Signal;
|
|
3193
|
-
runtime: {
|
|
3194
|
-
raw?: StrategyEntryRuntimeOptions;
|
|
3195
|
-
resolved: StrategyEntryRuntimeOptions;
|
|
3196
|
-
};
|
|
3197
|
-
}
|
|
3198
|
-
type StrategyHookMlSkippedReason = 'BACKTEST' | 'DISABLED' | 'NO_RUNTIME' | 'NO_STRATEGY_CONFIG' | 'NO_THRESHOLD' | 'NO_RESULT';
|
|
3199
|
-
interface StrategyHookMlContext {
|
|
3200
|
-
config?: StrategyRuntimeMlOptions;
|
|
3201
|
-
attempted: boolean;
|
|
3202
|
-
applied: boolean;
|
|
3203
|
-
result?: Signal['ml'];
|
|
3204
|
-
skippedReason?: StrategyHookMlSkippedReason;
|
|
3205
|
-
}
|
|
3206
|
-
type StrategyHookAiSkippedReason = 'BACKTEST' | 'DISABLED' | 'NO_RUNTIME' | 'NO_QUALITY';
|
|
3207
|
-
interface StrategyHookAiContext {
|
|
3208
|
-
config?: StrategyRuntimeAiOptions;
|
|
3209
|
-
attempted: boolean;
|
|
3210
|
-
applied: boolean;
|
|
3211
|
-
quality?: number;
|
|
3212
|
-
skippedReason?: StrategyHookAiSkippedReason;
|
|
3213
|
-
}
|
|
3214
|
-
type StrategyHookStage = 'onInit' | 'onBar' | 'afterCoreDecision' | 'afterBarDecision' | 'onSkip' | 'beforeClosePosition' | 'afterEnrichMl' | 'afterEnrichAi' | 'beforeEntryGate' | 'beforePlaceOrder' | 'afterPlaceOrder' | 'runtime.beforePlaceOrder' | 'enrichSignalWithMl' | 'enrichSignalWithAi' | 'setTakeProfits' | 'setStopLoss' | 'protectPosition' | 'closePosition' | 'placeOrder';
|
|
3215
|
-
interface StrategyHookErrorPayload {
|
|
3216
|
-
stage: StrategyHookStage;
|
|
3217
|
-
cause: unknown;
|
|
3218
|
-
}
|
|
3219
|
-
interface StrategyHookErrorContext {
|
|
3220
|
-
ctx: StrategyHookCtx;
|
|
3221
|
-
market?: StrategyHookMarketContext;
|
|
3222
|
-
decision?: StrategyDecision;
|
|
3223
|
-
entry?: StrategyHookEntryContext;
|
|
3224
|
-
error: StrategyHookErrorPayload;
|
|
3225
|
-
}
|
|
3226
|
-
interface StrategyHookInitContext {
|
|
3227
|
-
ctx: StrategyHookCtx;
|
|
3228
|
-
market: Required<Pick<StrategyHookMarketContext, 'data' | 'btcData'>>;
|
|
3229
|
-
}
|
|
3230
|
-
interface StrategyHookBarContext {
|
|
3231
|
-
ctx: StrategyHookCtx;
|
|
3232
|
-
market: Required<Pick<StrategyHookMarketContext, 'candle' | 'btcCandle'>>;
|
|
3233
|
-
}
|
|
3234
|
-
interface StrategyHookAfterDecisionContext extends StrategyHookBarContext {
|
|
3235
|
-
decision: StrategyDecision;
|
|
3236
|
-
}
|
|
3237
|
-
interface StrategyHookSkipContext extends StrategyHookAfterDecisionContext {
|
|
3238
|
-
decision: Extract<StrategyDecision, {
|
|
3239
|
-
kind: 'skip';
|
|
3240
|
-
}>;
|
|
3241
|
-
}
|
|
3242
|
-
interface StrategyHookBeforeCloseContext extends StrategyHookAfterDecisionContext {
|
|
3243
|
-
decision: ExitDecision;
|
|
3244
|
-
}
|
|
3245
|
-
interface StrategyHookEnrichContext {
|
|
3246
|
-
ctx: StrategyHookCtx;
|
|
3247
|
-
market: Required<Pick<StrategyHookMarketContext, 'candle' | 'btcCandle'>>;
|
|
3248
|
-
decision: EntryDecision;
|
|
3249
|
-
entry: StrategyHookEntryContext;
|
|
3250
|
-
ml: StrategyHookMlContext;
|
|
3251
|
-
}
|
|
3252
|
-
interface StrategyHookAfterAiContext extends StrategyHookEnrichContext {
|
|
3253
|
-
ai: StrategyHookAiContext;
|
|
3254
|
-
}
|
|
3255
|
-
interface StrategyHookPolicyContext {
|
|
3256
|
-
aiQuality?: number;
|
|
3257
|
-
makeOrdersEnabled: boolean;
|
|
3258
|
-
minAiQuality: number;
|
|
3259
|
-
}
|
|
3260
|
-
interface StrategyHookBeforeEntryGateContext {
|
|
3261
|
-
ctx: StrategyHookCtx;
|
|
3262
|
-
market: Required<Pick<StrategyHookMarketContext, 'candle' | 'btcCandle'>>;
|
|
3263
|
-
decision: EntryDecision;
|
|
3264
|
-
entry: StrategyHookEntryContext;
|
|
3265
|
-
policy: StrategyHookPolicyContext;
|
|
3266
|
-
ml?: StrategyHookMlContext;
|
|
3267
|
-
ai?: StrategyHookAiContext;
|
|
3268
|
-
}
|
|
3269
|
-
interface StrategyHookBeforePlaceOrderContext {
|
|
3270
|
-
ctx: StrategyHookCtx;
|
|
3271
|
-
market: Required<Pick<StrategyHookMarketContext, 'candle' | 'btcCandle'>>;
|
|
3272
|
-
decision: EntryDecision;
|
|
3273
|
-
entry: StrategyHookEntryContext;
|
|
3274
|
-
policy: StrategyHookPolicyContext;
|
|
3275
|
-
ml?: StrategyHookMlContext;
|
|
3276
|
-
ai?: StrategyHookAiContext;
|
|
3277
|
-
}
|
|
3278
|
-
interface StrategyHookOrderContext {
|
|
3279
|
-
result: Signal | string;
|
|
3280
|
-
}
|
|
3281
|
-
interface StrategyHookAfterPlaceOrderContext {
|
|
3282
|
-
ctx: StrategyHookCtx;
|
|
3283
|
-
market: Required<Pick<StrategyHookMarketContext, 'candle' | 'btcCandle'>>;
|
|
3284
|
-
decision: EntryDecision;
|
|
3285
|
-
entry: StrategyHookEntryContext;
|
|
3286
|
-
policy: StrategyHookPolicyContext;
|
|
3287
|
-
ml?: StrategyHookMlContext;
|
|
3288
|
-
ai?: StrategyHookAiContext;
|
|
3289
|
-
order: StrategyHookOrderContext;
|
|
3290
|
-
}
|
|
3291
|
-
type StrategyMarketContextSource = 'binance' | 'coinmarketcap' | 'derivatives' | 'hyperliquidWhales' | 'news';
|
|
3292
|
-
interface StrategyManifest {
|
|
3293
|
-
aiFeatures?: readonly AiFeatureDefinition[];
|
|
3294
|
-
name: string;
|
|
3295
|
-
contextRequirements?: {
|
|
3296
|
-
tickerProfiles?: {
|
|
3297
|
-
provider: string;
|
|
3298
|
-
universeId: string;
|
|
3299
|
-
};
|
|
3300
|
-
/** Market context that must be available before strategy core evaluation. */
|
|
3301
|
-
core?: readonly StrategyMarketContextSource[];
|
|
3302
|
-
};
|
|
3303
|
-
policyProfiles?: readonly StrategyPolicyProfile[];
|
|
3304
|
-
defaultPolicyProfileId?: string;
|
|
3305
|
-
entryRuntimeDefaults?: {
|
|
3306
|
-
ai?: StrategyRuntimeAiOptions;
|
|
3307
|
-
ml?: Pick<StrategyRuntimeMlOptions, 'enabled'>;
|
|
3308
|
-
};
|
|
3309
|
-
hooks?: {
|
|
3310
|
-
onInit?: (params: StrategyHookInitContext) => Promise<void> | void;
|
|
3311
|
-
onBar?: (params: StrategyHookBarContext) => Promise<StrategyDecision | void> | StrategyDecision | void;
|
|
3312
|
-
afterCoreDecision?: (params: StrategyHookAfterDecisionContext) => Promise<void> | void;
|
|
3313
|
-
afterBarDecision?: (params: StrategyHookAfterDecisionContext) => Promise<void> | void;
|
|
3314
|
-
onSkip?: (params: StrategyHookSkipContext) => Promise<void> | void;
|
|
3315
|
-
beforeClosePosition?: (params: StrategyHookBeforeCloseContext) => Promise<StrategyHookGateResult | void> | StrategyHookGateResult | void;
|
|
3316
|
-
afterEnrichMl?: (params: StrategyHookEnrichContext) => Promise<void> | void;
|
|
3317
|
-
afterEnrichAi?: (params: StrategyHookAfterAiContext) => Promise<void> | void;
|
|
3318
|
-
beforeEntryGate?: (params: StrategyHookBeforeEntryGateContext) => Promise<StrategyHookGateResult | void> | StrategyHookGateResult | void;
|
|
3319
|
-
beforePlaceOrder?: (params: StrategyHookBeforePlaceOrderContext) => Promise<void> | void;
|
|
3320
|
-
afterPlaceOrder?: (params: StrategyHookAfterPlaceOrderContext) => Promise<void> | void;
|
|
3321
|
-
onRuntimeError?: (params: StrategyHookErrorContext) => Promise<void> | void;
|
|
3322
|
-
};
|
|
3323
|
-
aiAdapter?: StrategyAiAdapter;
|
|
3324
|
-
mlAdapter?: StrategyMlAdapter;
|
|
3325
|
-
}
|
|
3326
|
-
interface StrategyRegistryEntry<TConfig extends StrategyConfig = any> {
|
|
3327
|
-
kind?: 'candle';
|
|
3328
|
-
manifest: StrategyManifest;
|
|
3329
|
-
defaults: TConfig;
|
|
3330
|
-
/** Parse an untrusted project declaration into a complete strategy config. */
|
|
3331
|
-
parseConfig: (input: unknown) => TConfig;
|
|
3332
|
-
createCore: CreateStrategyCore<TConfig, any, any>;
|
|
3333
|
-
detectorKey?: (config: TConfig) => string | undefined;
|
|
3334
|
-
detectorNoSignalSkipReason?: string;
|
|
3335
|
-
}
|
|
3336
|
-
type RegisteredStrategyEntry = StrategyRegistryEntry | PortfolioStrategyEntry;
|
|
3337
|
-
interface StrategyPluginDefinition {
|
|
3338
|
-
strategyEntries: RegisteredStrategyEntry[];
|
|
3339
|
-
}
|
|
3340
|
-
|
|
3341
3372
|
interface AiPromptPair {
|
|
3342
3373
|
systemPrompt: string;
|
|
3343
3374
|
humanPrompt: string;
|
|
@@ -3931,4 +3962,4 @@ type DataBackfillJob = DataBackfillRequest & {
|
|
|
3931
3962
|
error?: string;
|
|
3932
3963
|
};
|
|
3933
3964
|
|
|
3934
|
-
export { type AggTrade, type AggTradesRequest, type AiDatasetRow, type AiFeatureDefinition, type AiFeaturePrimitive, type AiFeatureRole, type AiFeatureSnapshot, type AiPayload, type AiPromptPair, type AssetClass, BACKTEST_WARNING_CODES, type BacktestDetectorOptimizedStrategy, type BacktestExecutionCosts, type BacktestHistoryStorage, type BacktestPriceMode, type BacktestRunConfig, type BacktestWarningCode, type BacktestWarningCounts, type BaseContextGateFeatures, type BaseGateFeatureApproveBias, type BaseGateFeatureConfirmation, type BaseGateFeatureConflict, type BaseGateFeatureEntryLocation, type BaseGateFeaturePrimaryIssue, type BaseGateFeatureRiskLevel, type BaseGateFeatureScoreKey, type BaseHyperliquidWhaleFlowContext, type BaseIndicatorsHistorySnapshot, type BaseMarketBreadthContext, type BaseMarketBreadthsContext, type BaseMarketTradeFlowContext, type BaseMultiTimeframeContext, type BaseParticipationContext, type BasePsychologicalLevelAssetContext, type BasePsychologicalLevelWindowContext, type BaseRawIndicatorSnapshot, type BaseRegimeContext, type BaseRelativeContext, type BaseStrategyContextSnapshot, type BaseStructureContext, type Bot, type BotConfig, type BotResults, type BotStatus, type BuildStrategySignalDraft, type BuildStrategySignalParams, type Candle, type ChartColor, type CliBacktestRun, type ClosedPnlRecord, type CmcExchangeLiquidityRegime, type CmcFearGreedClassification, type CmcFearGreedRegime, type CompletedTest, type Connector, type ConnectorAccountResolver, type ConnectorCachedKlineFactory, type ConnectorCapabilities, type ConnectorConfig, type ConnectorCreator, type ConnectorLogger, type ConnectorPluginDefinition, type ConnectorRegistryEntry, type ConnectorRuntime, type CoreResearchTraceEvent, type CreateStrategyCore, type CreateStrategyCoreParams, DEFAULT_MARKET_UNIVERSE, type DataBackfillJob, type DataBackfillRequest, type DataBackfillResult, type DataCoverage, type DataCoverageDataset, type DataCoverageDay, type DataCoverageSeriesDay, type DerivativesContext, type DerivativesContextRiskFlag, type DerivativesInterval, type DerivativesIntervalContext, type DerivativesPressure, type DerivativesPriceOiDivergenceType, type DerivativesRow, type DerivativesSymbolContext, type DerivativesTargetDerivedContext, type Direction, type EOMPoint, type ExchangeEntryRecord, type ExecutionCostModel, type ExecutionCostQuality, type ExecutionCostSource, type Filters, type FundingRateHistoryRequest, type FundingRatePoint, type GetAggTrades, type GetClosedPnlParams, type GetFundingRateHistory, type GetOrderBookDepth, type GetTickers, type GetTopOfBookTicker, type GetTradingFeeRate, HYPERLIQUID_WHALE_DATA_MODEL_VERSION, type HyperliquidPositionAction, type HyperliquidWhaleCoverageRow, type HyperliquidWhaleFlowRow, type HyperliquidWhaleTradeEventRow, type Indicator, type IndicatorPluginComputeParams, type IndicatorPluginDefinition, type IndicatorPluginEntry, type IndicatorPluginFigureRenderer, type IndicatorPluginRenderer, type IndicatorSnapshot, type Indicators, type IndicatorsHistorySnapshot, type InstrumentDescriptor, type InstrumentKind, type InstrumentQuery, type InstrumentStatus, type Interval, type Item, type Items, type JevConfig, type JevDimension, type JevEvidence, type JevFactProvenance, type JevFeature, type JevGateModel, type JevInput, type JevProviderConfig, type JevQuestionSet, type JevRecord, type JevResponse, type JevScoreAnswer, type JevScoreQuestion, type JevScores, type JevStudyRow, type JevTree, type Kline, type KlineChartData, type KlineChartItem, type KlineRequest, type ListInstruments, MCP_SCOPES, type MarketBreadthRow, type MarketCmcExchangeLiquidityContextRow, type MarketCmcFearGreedContextRow, type MarketCmcIndexConstituent, type MarketCmcIndexContextRow, type MarketCmcIndexSlug, type MarketDataCapability, type MarketFeatureInterval, type MarketGlobalContextRow, type MarketGlobalContextSource, type MarketKlineEvent, type MarketReferenceAssetContextRow, type MarketTradeFlowRow, type MarketUniverse, type McpJob, type McpPrincipal, type McpScope, type MetricThreshold, type Metrics, type MinimalStat, type MlCandleIndicatorsSnapshot, type MonthlyEquityStats, NEWS_PROVIDERS, NEWS_TYPES, type NewsArchive, type NewsContext, type NewsCoverage, type NewsEvent, type NewsFact, type NewsGateFeatures, type NewsProvider, type NewsPublication, type NewsType, type OnChangeCompare, type Order, type OrderBookDepth, type OrderBookDepthRequest, type OrderLeverage, type OrderLog, type OrderLogData, type OrderPositionIntent, type OrderType, type PortfolioChildStrategy, type PortfolioCloseIntent, type PortfolioConfirmation, type PortfolioContext, type PortfolioEntryBatch, type PortfolioEntryCandidate, type PortfolioEntrySelection, type PortfolioObservation, type PortfolioOrderObservation, type PortfolioPolicyConfig, type PortfolioPosition, type PortfolioReplayExecution, type PortfolioReservation, type PortfolioState, type PortfolioStateStore, type PortfolioStrategyEntry, type Position, type PositionLog, type PositionLogData, type PositionPnlSnapshot, type Provider, RUNTIME_CONTROLS_SCHEMA, RUNTIME_DEPLOYMENT_COMPOSITION_EVENT_SCHEMA, type ReferenceMarketFrame, type ReferenceMarketsContext, type RegisteredStrategyEntry, type ResearchEntryDecision, type ResearchEntryPolicy, type ResearchEntryPredicate, type RuntimeAiAnalysisSnapshot, type RuntimeAllocatorDecision, type RuntimeControls, type RuntimeDeployment, type RuntimeDeploymentCompositionEvent, type RuntimeDeploymentCompositionEventStrategy, type RuntimeDeploymentDeclaration, type RuntimeDeploymentHeartbeat, type RuntimeDeploymentStrategy, type RuntimeLaunchReport, type RuntimeLaunchReportBindings, type RuntimeLaunchReportResponse, type RuntimeLineage, type RuntimeRiskDecision, type RuntimeSignalEvaluationRecord, type RuntimeSignalEvaluationStatus, type RuntimeStrategiesResponse, type RuntimeStrategyCloseNotification, type RuntimeStrategyConfigSnapshot, type RuntimeStrategyControlEvent, type RuntimeStrategyControlEventAction, type RuntimeStrategyControlState, type RuntimeStrategyDeclaration, type RuntimeStrategyPauseOverride, type RuntimeStrategyRevisionChange, type RuntimeStrategySelection, type RuntimeStrategyTradeSummary, type RuntimeStrategyTradeView, type RuntimeStrategyView, type RuntimeTradeExitType, type RuntimeTradeFillSource, type RuntimeTradeRecord, type RuntimeTradeStatus, type RuntimeTradeTelemetryQuality, STRATEGY_EVIDENCE_MARKERS_SCHEMA, STRATEGY_LIVE_DIAGNOSIS_SCHEMA, STRATEGY_RELEASE_SCHEMA, type Signal, type SignalAnalysis, type SignalAssessment, type SignalOrderStatus, type SimpleOrderLogData, type Sl, type SpreadRow, type Strategy, type StrategyAPI, type StrategyAPIEntryParams, type StrategyAPIExitParams, type StrategyAPIProtectParams, type StrategyAdditionalIndicatorsMap, type StrategyAiAdapter, type StrategyAiMode, type StrategyChartDetail, type StrategyChartMetric, type StrategyChartMetricTone, type StrategyChartOrder, type StrategyChartSnapshot, type StrategyChartsSnapshotResponse, type StrategyClosePlan, type StrategyClosedCandlesRequest, type StrategyClosedCandlesSnapshot, type StrategyConfig, type StrategyConfigGrid, type StrategyCoreRunner, type StrategyCreator, type StrategyCreatorParams, type StrategyDecision, type StrategyDecisionPriceContext, type StrategyDirectionPolicy, type StrategyDirectionalTpSlParams, type StrategyDirectionalTpSlResult, type StrategyEntryBaseParams, type StrategyEntryModelFigures, type StrategyEntryOrderPlan, type StrategyEntryRuntimeBaseParams, type StrategyEntryRuntimeBuilderParams, type StrategyEntryRuntimeOptions, type StrategyEntrySignalContext, type StrategyEntrySignalDecisionBuilderParams, type StrategyEntryTakeProfitsParams, type StrategyEvidenceMarker, type StrategyEvidenceMarkerEnvelope, type StrategyEvidenceMarkerPayload, type StrategyEvidenceMarkerType, type StrategyEvidenceRetentionEntry, type StrategyEvidenceRetentionPlan, type StrategyFigureAnnotation, type StrategyFigureLine, type StrategyFigurePoint, type StrategyFigurePoints, type StrategyFigureZone, type StrategyHookAfterAiContext, type StrategyHookAfterDecisionContext, type StrategyHookAfterPlaceOrderContext, type StrategyHookAiContext, type StrategyHookAiSkippedReason, type StrategyHookBarContext, type StrategyHookBeforeCloseContext, type StrategyHookBeforeEntryGateContext, type StrategyHookBeforePlaceOrderContext, type StrategyHookCtx, type StrategyHookEnrichContext, type StrategyHookEntryContext, type StrategyHookErrorContext, type StrategyHookErrorPayload, type StrategyHookGateResult, type StrategyHookInitContext, type StrategyHookMarketContext, type StrategyHookMlContext, type StrategyHookMlSkippedReason, type StrategyHookOrderContext, type StrategyHookPolicyContext, type StrategyHookSkipContext, type StrategyHookStage, type StrategyIndicatorsContext, type StrategyIndicatorsMap, type StrategyIndicatorsState, type StrategyLastTradeController, type StrategyLastTradeControllerParams, type StrategyLiveDiagnosis, type StrategyLiveDiagnosisEnvelope, type StrategyLiveDiagnosisVerdict, type StrategyManifest, type StrategyMarketContextSource, type StrategyMlAdapter, type StrategyPluginDefinition, type StrategyPolicyProfile, type StrategyProtectPlan, type StrategyRegistryEntry, type StrategyReleaseEnvelope, type StrategyReleaseEvidenceReference, type StrategyReleaseHistoricalWindow, type StrategyReleaseManifest, type StrategyReleaseReason, type StrategyReleaseResearchDecision, type StrategyReleaseResearchDecisionAction, type StrategyReleaseResearchDecisionBlocker, type StrategyReleaseResearchDecisionInput, type StrategyReleaseVerdict, type StrategyResearchRetention, type StrategyResultConfig, type StrategyResultEntry, type StrategyResults, type StrategyRuntimeAiOptions, type StrategyRuntimeMlOptions, type StrategySharedReplayStateGetter, type StrategySignalMetaParams, type StrategySignalPriceParams, type StrategyStateController, type StrategyStateControllerOptions, type Test, type TestClosedSignalResult, type TestCompare, type TestCompareList, type TestConnector, type TestConnectorContext, type TestConnectorCreator, type TestResult, type TestStat, type TestSuite, type TestThresholds, type TestThresholdsKey, type TestTradeExitReason, type TestTradeResult, type TestWorkerResult, type TestingBox, type TestingBoxResult, type TestingOptions, type ThresholdLevel, type Ticker, type TickerProfile, type TickerProfileContext, type TickerProfileSnapshot, type TickerQuery, type TopOfBookTicker, type Tp, type TradejsRuntimeDeclaration, type TradingAccountRef, type TradingFeeRate, type Trend, type TrendLine, type TrendLineMode, type TrendLineOptions, WORLD_NEWS_MARKETS, WORLD_NEWS_PROVIDERS, WORLD_NEWS_TYPES, type WorldNewsEvidence, type WorldNewsMarket, type WorldNewsStory, type WorldNewsType, isMarketUniverse, resolveConnectorUniverse };
|
|
3965
|
+
export { type AggTrade, type AggTradesRequest, type AiDatasetRow, type AiFeatureDefinition, type AiFeaturePrimitive, type AiFeatureRole, type AiFeatureSnapshot, type AiPayload, type AiPromptPair, type AssetClass, BACKTEST_WARNING_CODES, type BacktestDetectorOptimizedStrategy, type BacktestExecutionCosts, type BacktestHistoryStorage, type BacktestPriceMode, type BacktestRunConfig, type BacktestWarningCode, type BacktestWarningCounts, type BaseContextGateFeatures, type BaseGateFeatureApproveBias, type BaseGateFeatureConfirmation, type BaseGateFeatureConflict, type BaseGateFeatureEntryLocation, type BaseGateFeaturePrimaryIssue, type BaseGateFeatureRiskLevel, type BaseGateFeatureScoreKey, type BaseHyperliquidWhaleFlowContext, type BaseIndicatorsHistorySnapshot, type BaseMarketBreadthContext, type BaseMarketBreadthsContext, type BaseMarketTradeFlowContext, type BaseMultiTimeframeContext, type BaseParticipationContext, type BasePsychologicalLevelAssetContext, type BasePsychologicalLevelWindowContext, type BaseRawIndicatorSnapshot, type BaseRegimeContext, type BaseRelativeContext, type BaseStrategyContextSnapshot, type BaseStructureContext, type Bot, type BotConfig, type BotResults, type BotStatus, type BuildStrategySignalDraft, type BuildStrategySignalParams, type Candle, type ChartColor, type CliBacktestRun, type ClosedPnlRecord, type CmcExchangeLiquidityRegime, type CmcFearGreedClassification, type CmcFearGreedRegime, type CompletedTest, type Connector, type ConnectorAccountResolver, type ConnectorCachedKlineFactory, type ConnectorCapabilities, type ConnectorConfig, type ConnectorCreator, type ConnectorLogger, type ConnectorPluginDefinition, type ConnectorRegistryEntry, type ConnectorRuntime, type CoreResearchTraceEvent, type CreateStrategyCore, type CreateStrategyCoreParams, DEFAULT_MARKET_UNIVERSE, type DataBackfillJob, type DataBackfillRequest, type DataBackfillResult, type DataCoverage, type DataCoverageDataset, type DataCoverageDay, type DataCoverageSeriesDay, type DerivativesContext, type DerivativesContextRiskFlag, type DerivativesInterval, type DerivativesIntervalContext, type DerivativesPressure, type DerivativesPriceOiDivergenceType, type DerivativesRow, type DerivativesSymbolContext, type DerivativesTargetDerivedContext, type Direction, type EOMPoint, type ExchangeEntryRecord, type ExecutionCostModel, type ExecutionCostQuality, type ExecutionCostSource, type Filters, type FundingRateHistoryRequest, type FundingRatePoint, type GetAggTrades, type GetClosedPnlParams, type GetFundingRateHistory, type GetOrderBookDepth, type GetTickers, type GetTopOfBookTicker, type GetTradingFeeRate, HYPERLIQUID_WHALE_DATA_MODEL_VERSION, type HyperliquidPositionAction, type HyperliquidWhaleCoverageRow, type HyperliquidWhaleFlowRow, type HyperliquidWhaleTradeEventRow, type Indicator, type IndicatorPluginComputeParams, type IndicatorPluginDefinition, type IndicatorPluginEntry, type IndicatorPluginFigureRenderer, type IndicatorPluginRenderer, type IndicatorSnapshot, type Indicators, type IndicatorsHistorySnapshot, type InstrumentDescriptor, type InstrumentKind, type InstrumentQuery, type InstrumentStatus, type Interval, type Item, type Items, type JevConfig, type JevDimension, type JevEvidence, type JevFactProvenance, type JevFeature, type JevGateModel, type JevInput, type JevProviderConfig, type JevQuestionSet, type JevRecord, type JevResponse, type JevScoreAnswer, type JevScoreQuestion, type JevScores, type JevStudyRow, type JevTree, type Kline, type KlineChartData, type KlineChartItem, type KlineRequest, type ListInstruments, MCP_SCOPES, type MarketBreadthRow, type MarketCmcExchangeLiquidityContextRow, type MarketCmcFearGreedContextRow, type MarketCmcIndexConstituent, type MarketCmcIndexContextRow, type MarketCmcIndexSlug, type MarketDataCapability, type MarketFeatureInterval, type MarketGlobalContextRow, type MarketGlobalContextSource, type MarketKlineEvent, type MarketReferenceAssetContextRow, type MarketTradeFlowRow, type MarketUniverse, type McpJob, type McpPrincipal, type McpScope, type MetricThreshold, type Metrics, type MinimalStat, type MlCandleIndicatorsSnapshot, type MonthlyEquityStats, NEWS_PROVIDERS, NEWS_TYPES, type NewsArchive, type NewsContext, type NewsCoverage, type NewsEvent, type NewsFact, type NewsGateFeatures, type NewsProvider, type NewsPublication, type NewsType, type OnChangeCompare, type Order, type OrderBookDepth, type OrderBookDepthRequest, type OrderLeverage, type OrderLog, type OrderLogData, type OrderPositionIntent, type OrderType, type PortfolioChildRuntime, type PortfolioChildStrategy, type PortfolioCloseIntent, type PortfolioConfirmation, type PortfolioContext, type PortfolioEntryBatch, type PortfolioEntryCandidate, type PortfolioEntrySelection, type PortfolioObservation, type PortfolioOrderObservation, type PortfolioPolicyConfig, type PortfolioPosition, type PortfolioReplayExecution, type PortfolioReservation, type PortfolioState, type PortfolioStateStore, type PortfolioStrategyEntry, type Position, type PositionLog, type PositionLogData, type PositionPnlSnapshot, type PreparedPortfolioEntry, type Provider, RUNTIME_CONTROLS_SCHEMA, RUNTIME_DEPLOYMENT_COMPOSITION_EVENT_SCHEMA, type ReferenceMarketFrame, type ReferenceMarketsContext, type RegisteredStrategyEntry, type ResearchEntryDecision, type ResearchEntryPolicy, type ResearchEntryPredicate, type RuntimeAiAnalysisSnapshot, type RuntimeAllocatorDecision, type RuntimeControls, type RuntimeDeployment, type RuntimeDeploymentCompositionEvent, type RuntimeDeploymentCompositionEventStrategy, type RuntimeDeploymentDeclaration, type RuntimeDeploymentHeartbeat, type RuntimeDeploymentStrategy, type RuntimeLaunchReport, type RuntimeLaunchReportBindings, type RuntimeLaunchReportResponse, type RuntimeLineage, type RuntimeRiskDecision, type RuntimeSignalEvaluationRecord, type RuntimeSignalEvaluationStatus, type RuntimeStrategiesResponse, type RuntimeStrategyCloseNotification, type RuntimeStrategyConfigSnapshot, type RuntimeStrategyControlEvent, type RuntimeStrategyControlEventAction, type RuntimeStrategyControlState, type RuntimeStrategyDeclaration, type RuntimeStrategyPauseOverride, type RuntimeStrategyRevisionChange, type RuntimeStrategySelection, type RuntimeStrategyTradeSummary, type RuntimeStrategyTradeView, type RuntimeStrategyView, type RuntimeTradeExitType, type RuntimeTradeFillSource, type RuntimeTradeRecord, type RuntimeTradeStatus, type RuntimeTradeTelemetryQuality, STRATEGY_EVIDENCE_MARKERS_SCHEMA, STRATEGY_LIVE_DIAGNOSIS_SCHEMA, STRATEGY_RELEASE_SCHEMA, type Signal, type SignalAnalysis, type SignalAssessment, type SignalOrderStatus, type SimpleOrderLogData, type Sl, type SpreadRow, type Strategy, type StrategyAPI, type StrategyAPIEntryParams, type StrategyAPIExitParams, type StrategyAPIProtectParams, type StrategyAdditionalIndicatorsMap, type StrategyAiAdapter, type StrategyAiMode, type StrategyChartDetail, type StrategyChartMetric, type StrategyChartMetricTone, type StrategyChartOrder, type StrategyChartSnapshot, type StrategyChartsSnapshotResponse, type StrategyClosePlan, type StrategyClosedCandlesRequest, type StrategyClosedCandlesSnapshot, type StrategyConfig, type StrategyConfigGrid, type StrategyCoreRunner, type StrategyCreator, type StrategyCreatorParams, type StrategyDecision, type StrategyDecisionPriceContext, type StrategyDirectionPolicy, type StrategyDirectionalTpSlParams, type StrategyDirectionalTpSlResult, type StrategyEntryBaseParams, type StrategyEntryModelFigures, type StrategyEntryOrderPlan, type StrategyEntryRuntimeBaseParams, type StrategyEntryRuntimeBuilderParams, type StrategyEntryRuntimeOptions, type StrategyEntrySignalContext, type StrategyEntrySignalDecisionBuilderParams, type StrategyEntryTakeProfitsParams, type StrategyEvidenceMarker, type StrategyEvidenceMarkerEnvelope, type StrategyEvidenceMarkerPayload, type StrategyEvidenceMarkerType, type StrategyEvidenceRetentionEntry, type StrategyEvidenceRetentionPlan, type StrategyFigureAnnotation, type StrategyFigureLine, type StrategyFigurePoint, type StrategyFigurePoints, type StrategyFigureZone, type StrategyHookAfterAiContext, type StrategyHookAfterDecisionContext, type StrategyHookAfterPlaceOrderContext, type StrategyHookAiContext, type StrategyHookAiSkippedReason, type StrategyHookBarContext, type StrategyHookBeforeCloseContext, type StrategyHookBeforeEntryGateContext, type StrategyHookBeforePlaceOrderContext, type StrategyHookCtx, type StrategyHookEnrichContext, type StrategyHookEntryContext, type StrategyHookErrorContext, type StrategyHookErrorPayload, type StrategyHookGateResult, type StrategyHookInitContext, type StrategyHookMarketContext, type StrategyHookMlContext, type StrategyHookMlSkippedReason, type StrategyHookOrderContext, type StrategyHookPolicyContext, type StrategyHookSkipContext, type StrategyHookStage, type StrategyIndicatorsContext, type StrategyIndicatorsMap, type StrategyIndicatorsState, type StrategyLastTradeController, type StrategyLastTradeControllerParams, type StrategyLiveDiagnosis, type StrategyLiveDiagnosisEnvelope, type StrategyLiveDiagnosisVerdict, type StrategyManifest, type StrategyMarketContextSource, type StrategyMlAdapter, type StrategyPluginDefinition, type StrategyPolicyProfile, type StrategyProtectPlan, type StrategyRegistryEntry, type StrategyReleaseEnvelope, type StrategyReleaseEvidenceReference, type StrategyReleaseHistoricalWindow, type StrategyReleaseManifest, type StrategyReleaseReason, type StrategyReleaseResearchDecision, type StrategyReleaseResearchDecisionAction, type StrategyReleaseResearchDecisionBlocker, type StrategyReleaseResearchDecisionInput, type StrategyReleaseVerdict, type StrategyResearchRetention, type StrategyResultConfig, type StrategyResultEntry, type StrategyResults, type StrategyRuntimeAiOptions, type StrategyRuntimeMlOptions, type StrategySharedReplayStateGetter, type StrategySignalMetaParams, type StrategySignalPriceParams, type StrategyStateController, type StrategyStateControllerOptions, type Test, type TestClosedSignalResult, type TestCompare, type TestCompareList, type TestConnector, type TestConnectorContext, type TestConnectorCreator, type TestResult, type TestStat, type TestSuite, type TestThresholds, type TestThresholdsKey, type TestTradeExitReason, type TestTradeResult, type TestWorkerResult, type TestingBox, type TestingBoxResult, type TestingOptions, type ThresholdLevel, type Ticker, type TickerProfile, type TickerProfileContext, type TickerProfileSnapshot, type TickerQuery, type TopOfBookTicker, type Tp, type TradejsRuntimeDeclaration, type TradingAccountRef, type TradingFeeRate, type Trend, type TrendLine, type TrendLineMode, type TrendLineOptions, WORLD_NEWS_MARKETS, WORLD_NEWS_PROVIDERS, WORLD_NEWS_TYPES, type WorldNewsEvidence, type WorldNewsMarket, type WorldNewsStory, type WorldNewsType, isMarketUniverse, resolveConnectorUniverse };
|