tradeblocks-mcp 4.3.0 → 4.4.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 +32 -0
- package/dist/{chunk-TLX7IBCM.js → chunk-CZNPQ574.js} +5 -5
- package/dist/{chunk-TLX7IBCM.js.map → chunk-CZNPQ574.js.map} +1 -1
- package/dist/{sync-EW33QZPD.js → sync-P6QUZFSF.js} +2 -2
- package/dist/test-exports.js +1 -1
- package/package.json +1 -1
- package/server/{chunk-YIWLVX7Z.js → chunk-5JTQEV7P.js} +307 -252
- package/server/chunk-5JTQEV7P.js.map +1 -0
- package/server/index.js +374 -168
- package/server/index.js.map +1 -1
- package/server/{sync-2POG6KA6.js → sync-336543PJ.js} +2 -2
- package/src/tools/reports/predictive.ts +170 -195
- package/src/utils/filter-curve.ts +257 -0
- package/server/chunk-YIWLVX7Z.js.map +0 -1
- /package/dist/{sync-EW33QZPD.js.map → sync-P6QUZFSF.js.map} +0 -0
- /package/server/{sync-2POG6KA6.js.map → sync-336543PJ.js.map} +0 -0
package/README.md
CHANGED
|
@@ -549,6 +549,38 @@ Field-based `suggest_filters` retains all-trade `currentStats` and reports per-f
|
|
|
549
549
|
Suggestions compare against those covered populations; `filter_curve.baseline`
|
|
550
550
|
reports the same covered and uncovered counts and P&L.
|
|
551
551
|
|
|
552
|
+
New in 4.4.0: [filter statistics](../../releases/v4.4.0.md) for asking whether a
|
|
553
|
+
chosen filter survives a full threshold search, with explicit assumptions and work caps.
|
|
554
|
+
|
|
555
|
+
`find_predictive_fields.method` selects `pearson` (default), `spearman`, or `kendall`
|
|
556
|
+
(tau-b with ties). Explicit requests name their method; omission preserves the Pearson
|
|
557
|
+
response. Ranking uses the chosen coefficient on the same causal entry-time values,
|
|
558
|
+
including `maxMissedSessions` refusals.
|
|
559
|
+
Kendall admits up to 75 million estimated pairs across fields, using each field's
|
|
560
|
+
valid field/target coverage after strategy/date filtering. It refuses by name
|
|
561
|
+
(`kendall_pair_work_limit`) before quadratic calculations. A 1,100-trade block with
|
|
562
|
+
100 fully covered fields passes (60,445,000 pairs); a 20,000-trade field is refused.
|
|
563
|
+
Pearson and Spearman retain their existing behavior.
|
|
564
|
+
|
|
565
|
+
`filter_curve` accepts either the existing `field` or up to 10 distinct `fields`.
|
|
566
|
+
Multi-field calls, an explicit `objective` (`totalPl` or `winRate`), or opt-in
|
|
567
|
+
`permutation: { iterations: 499, block: "month", seed: 42 }` add the best threshold
|
|
568
|
+
and per-year kept/removed stability. Permutation shuffles whole calendar-month outcome
|
|
569
|
+
blocks and reruns the complete threshold sweep, not just the selected threshold.
|
|
570
|
+
It reports add-one raw p-values and Holm-adjusted p-values across requested fields.
|
|
571
|
+
Single-field calls without these options retain their old outputs.
|
|
572
|
+
At least 30 covered trades and 8 observed months are required; refusals are named.
|
|
573
|
+
Iterations are capped at 499. Only permutation requests limit threshold and percentile
|
|
574
|
+
arrays to 100 entries, with a named `permutation_candidate_limit` refusal.
|
|
575
|
+
Without permutation, larger arrays retain their previous schema acceptance.
|
|
576
|
+
Sort-aware work admission caps permutation at 30 million units per field and
|
|
577
|
+
90 million per request, refusing the whole request before any sweeps. At 1,100 trades,
|
|
578
|
+
55 months, 499 iterations and default thresholds, the largest admitted family is
|
|
579
|
+
3 fully covered fields (87,751,152 estimated units); 4 fields exceed the cap.
|
|
580
|
+
Field, objective and mode choices across separate requests are outside the Holm family.
|
|
581
|
+
Monthly blocks retain within-month dependence, not cross-month dependence; block
|
|
582
|
+
exchangeability is an assumption. See [the full contract](../../docs/mcp-tools.md#filter-curve-significance-and-stability).
|
|
583
|
+
|
|
552
584
|
`suggest_filters` defaults to `objective: "totalPl"`: only positive P&L improvements,
|
|
553
585
|
ranked by P&L improvement with win-rate gain as tie-breaker. `objective: "winRate"`
|
|
554
586
|
admits/ranks by win-rate gain with P&L tie-breaks. `minImprovementPct` (default 3
|
|
@@ -3790,7 +3790,7 @@ async function openReadWriteConnection(dbPath, threads, memoryLimit) {
|
|
|
3790
3790
|
await createMarketParquetViews(connection, dataRoot);
|
|
3791
3791
|
await ensureMarketDataTables(connection);
|
|
3792
3792
|
try {
|
|
3793
|
-
const blocksDir = (await import("./sync-
|
|
3793
|
+
const blocksDir = (await import("./sync-P6QUZFSF.js")).getBlocksDir(dataRoot);
|
|
3794
3794
|
await migrateMetadataToJson(connection, dataRoot, blocksDir);
|
|
3795
3795
|
} catch (err) {
|
|
3796
3796
|
console.warn(
|
|
@@ -20622,7 +20622,7 @@ function calculateCorrelationMatrix(trades, options = {}) {
|
|
|
20622
20622
|
}
|
|
20623
20623
|
let correlation;
|
|
20624
20624
|
if (method === "pearson") {
|
|
20625
|
-
correlation =
|
|
20625
|
+
correlation = pearsonCorrelation(returns1, returns2);
|
|
20626
20626
|
} else if (method === "spearman") {
|
|
20627
20627
|
correlation = spearmanCorrelation(returns1, returns2);
|
|
20628
20628
|
} else {
|
|
@@ -20635,7 +20635,7 @@ function calculateCorrelationMatrix(trades, options = {}) {
|
|
|
20635
20635
|
}
|
|
20636
20636
|
return { strategies, correlationData, sampleSizes };
|
|
20637
20637
|
}
|
|
20638
|
-
function
|
|
20638
|
+
function pearsonCorrelation(x, y) {
|
|
20639
20639
|
if (x.length !== y.length || x.length === 0) return 0;
|
|
20640
20640
|
const meanX = mean(x);
|
|
20641
20641
|
const meanY = mean(y);
|
|
@@ -20657,7 +20657,7 @@ function spearmanCorrelation(x, y) {
|
|
|
20657
20657
|
if (x.length !== y.length || x.length === 0) return 0;
|
|
20658
20658
|
const rankX = getRanks(x);
|
|
20659
20659
|
const rankY = getRanks(y);
|
|
20660
|
-
return
|
|
20660
|
+
return pearsonCorrelation(rankX, rankY);
|
|
20661
20661
|
}
|
|
20662
20662
|
function kendallCorrelation(x, y) {
|
|
20663
20663
|
if (x.length !== y.length || x.length === 0) return 0;
|
|
@@ -23270,4 +23270,4 @@ decimal.js/decimal.mjs:
|
|
|
23270
23270
|
* MIT Licence
|
|
23271
23271
|
*)
|
|
23272
23272
|
*/
|
|
23273
|
-
//# sourceMappingURL=chunk-
|
|
23273
|
+
//# sourceMappingURL=chunk-CZNPQ574.js.map
|