T-85: M1.4c — analyzeSignal / runEventStudy study runners in @stock-bot/research: analyzer math + automatic trial_ledger write + cluster N̂-deflated Sharpe (no new dependencies)
This commit is contained in:
parent
45a98d309e
commit
9d8dfc9bc8
4 changed files with 299 additions and 13 deletions
|
|
@ -179,6 +179,9 @@ describe.skipIf(!url)('signal-study runners PostgreSQL integration', () => {
|
|||
expect(sig2.trial.sampleEnd < VAULT_CUTOFF).toBe(true);
|
||||
expect(sig2.trial.expressionHash).not.toBe(sig1.trial.expressionHash);
|
||||
expect(sig2.deflatedSharpe.clusterSize).toBe(2);
|
||||
expect(sig2.deflatedSharpe.pairsUsed).toBe(0);
|
||||
expect(sig2.deflatedSharpe.pairsSkipped).toBe(1);
|
||||
expect(sig2.deflatedSharpe.effectiveTrials).toBe(2);
|
||||
expect(Number.isFinite(sig2.deflatedSharpe.effectiveTrials)).toBe(true);
|
||||
|
||||
const eventDates = makeBusinessDates('2025-02-03', 70);
|
||||
|
|
@ -211,6 +214,9 @@ describe.skipIf(!url)('signal-study runners PostgreSQL integration', () => {
|
|||
expect(evtRes.vaultExcludedEvents).toBe(2);
|
||||
expect(evtRes.trial.sampleEnd < VAULT_CUTOFF).toBe(true);
|
||||
expect(evtRes.deflatedSharpe.clusterSize).toBe(3);
|
||||
expect(evtRes.deflatedSharpe.pairsUsed).toBe(0);
|
||||
expect(evtRes.deflatedSharpe.pairsSkipped).toBe(3);
|
||||
expect(evtRes.deflatedSharpe.effectiveTrials).toBe(3);
|
||||
|
||||
// Insufficient-data run must append 0 additional rows.
|
||||
const insufRes = await analyzeSignal(f.pool, {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue