feat(research): run retained strategies through durable canonical engine
This commit is contained in:
parent
d929db707a
commit
618fb9e33c
58 changed files with 6596 additions and 779 deletions
|
|
@ -290,6 +290,7 @@ export async function fixture(browser: Browser, native = false) {
|
|||
'16-strategy-catalog.sql',
|
||||
'17-research-retention.sql',
|
||||
'18-backtest-strategy-versions.sql',
|
||||
'19-canonical-research.sql',
|
||||
]) {
|
||||
await pool.query(
|
||||
readFileSync(new URL(`../../database/postgres/init/${name}`, import.meta.url), 'utf8')
|
||||
|
|
@ -331,8 +332,15 @@ export async function fixture(browser: Browser, native = false) {
|
|||
maxAttempts: 3,
|
||||
});
|
||||
const controlled = new FixtureEngine();
|
||||
const historicalDataReads: string[] = [];
|
||||
const runStorage: Pick<StorageService, 'getHistoricalBars'> = {
|
||||
async getHistoricalBars(...args) {
|
||||
historicalDataReads.push(args[0]);
|
||||
return storage.getHistoricalBars(...args);
|
||||
},
|
||||
};
|
||||
const engine = native
|
||||
? new RustBacktestAdapter({ logger, storage }, { timeoutMs: 15000 })
|
||||
? new RustBacktestAdapter({ logger, storage: runStorage }, { timeoutMs: 15000 })
|
||||
: controlled;
|
||||
const runner = new BacktestRunner({
|
||||
engine,
|
||||
|
|
@ -560,6 +568,7 @@ export async function fixture(browser: Browser, native = false) {
|
|||
login,
|
||||
close,
|
||||
unexpectedNetwork,
|
||||
historicalDataReads,
|
||||
seedCatalog: () => seedBuiltinCatalog(new StrategyCatalogService(container)),
|
||||
};
|
||||
} catch (error) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue