feat(research): select and reuse frozen datasets in workbench
This commit is contained in:
parent
6a67ae8683
commit
b106c1ca85
29 changed files with 2295 additions and 426 deletions
|
|
@ -1,11 +1,12 @@
|
|||
import { z } from 'zod';
|
||||
import {
|
||||
datasetHashSchema,
|
||||
datasetManifestSchema,
|
||||
historicalDataPolicySchema,
|
||||
instrumentIdSchema,
|
||||
} from '@stock-bot/stock-config/backtest';
|
||||
|
||||
export { datasetHashSchema, historicalDataPolicySchema, instrumentIdSchema };
|
||||
export { datasetHashSchema, datasetManifestSchema, historicalDataPolicySchema, instrumentIdSchema };
|
||||
const positive = z.number().finite().positive();
|
||||
export const datasetBarSchema = z
|
||||
.object({
|
||||
|
|
@ -19,33 +20,6 @@ export const datasetBarSchema = z
|
|||
vwap: positive,
|
||||
})
|
||||
.strict();
|
||||
export const datasetManifestSchema = z
|
||||
.object({
|
||||
version: z.literal(1),
|
||||
hash: datasetHashSchema,
|
||||
instruments: z
|
||||
.array(
|
||||
z.object({ id: instrumentIdSchema, symbol: z.string(), exchange: z.string() }).strict()
|
||||
)
|
||||
.min(1),
|
||||
startDate: z.string().datetime(),
|
||||
endDate: z.string().datetime(),
|
||||
interval: z.enum(['1m', '5m', '15m', '1h', '1d']),
|
||||
policy: historicalDataPolicySchema,
|
||||
volumePolicy: z.literal('reported'),
|
||||
qualityPolicy: z.literal('reject-invalid-no-interpolation'),
|
||||
sources: z.array(
|
||||
z
|
||||
.object({
|
||||
instrumentId: instrumentIdSchema,
|
||||
provider: z.enum(['eod', 'questdb', 'synthetic']),
|
||||
revision: z.string().min(1),
|
||||
})
|
||||
.strict()
|
||||
),
|
||||
barCount: z.number().int().positive(),
|
||||
})
|
||||
.strict();
|
||||
export const datasetSchema = z
|
||||
.object({ manifest: datasetManifestSchema, bars: z.array(datasetBarSchema).min(1) })
|
||||
.strict();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue