tradeblocks-mcp 4.2.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.
Files changed (48) hide show
  1. package/README.md +72 -1
  2. package/dist/{chunk-YRD62LDE.js → chunk-35RVWZGT.js} +4 -1
  3. package/dist/{chunk-4UU7IT2A.js.map → chunk-35RVWZGT.js.map} +1 -1
  4. package/dist/{chunk-62GCLMQA.js → chunk-CZNPQ574.js} +6 -9
  5. package/dist/chunk-CZNPQ574.js.map +1 -0
  6. package/dist/{chunk-4UU7IT2A.js → chunk-ENXBPJ7Y.js} +148 -6
  7. package/dist/chunk-ENXBPJ7Y.js.map +1 -0
  8. package/dist/{daily-logs-store-PXB53WEK.js → daily-logs-store-FZRIGYUX.js} +2 -2
  9. package/dist/{daily-logs-store-65YHFJ5F.js → daily-logs-store-MEZ5S3BR.js} +2 -2
  10. package/dist/market/provenance/index.js +1 -4
  11. package/dist/market/provenance/index.js.map +1 -1
  12. package/dist/{sync-JL7OPLCT.js → sync-P6QUZFSF.js} +3 -3
  13. package/dist/test-exports.js +320 -279
  14. package/dist/test-exports.js.map +1 -1
  15. package/dist/{trades-store-UGZ62A7N.js → trades-store-3TOLBL2W.js} +2 -2
  16. package/dist/{trades-store-MOFJHRC2.js → trades-store-PNLPRYRJ.js} +2 -2
  17. package/package.json +1 -1
  18. package/server/{chunk-J4GWE6JR.js → chunk-5JTQEV7P.js} +307 -255
  19. package/server/chunk-5JTQEV7P.js.map +1 -0
  20. package/server/{chunk-7N6HBOAY.js → chunk-PDSUY2X2.js} +148 -6
  21. package/server/chunk-PDSUY2X2.js.map +1 -0
  22. package/server/{daily-logs-store-YAXASQN4.js → daily-logs-store-LRVO7COL.js} +2 -2
  23. package/server/index.js +1326 -928
  24. package/server/index.js.map +1 -1
  25. package/server/{sync-ZV3QEGMO.js → sync-336543PJ.js} +3 -3
  26. package/server/{trades-store-MF7YYLCH.js → trades-store-MXUZLSF5.js} +2 -2
  27. package/src/db/dataset-schemas.ts +97 -23
  28. package/src/tools/market-data.ts +327 -245
  29. package/src/tools/profile-analysis.ts +18 -4
  30. package/src/tools/reports/fields.ts +16 -11
  31. package/src/tools/reports/helpers.ts +6 -2
  32. package/src/tools/reports/predictive.ts +177 -191
  33. package/src/tools/shared/field-analysis.ts +57 -14
  34. package/src/tools/shared/filter-objective.ts +73 -0
  35. package/src/utils/filter-curve.ts +257 -0
  36. package/src/utils/trade-analysis-fields.ts +19 -4
  37. package/dist/chunk-62GCLMQA.js.map +0 -1
  38. package/dist/chunk-YRD62LDE.js.map +0 -1
  39. package/server/chunk-7N6HBOAY.js.map +0 -1
  40. package/server/chunk-J4GWE6JR.js.map +0 -1
  41. /package/dist/{daily-logs-store-65YHFJ5F.js.map → daily-logs-store-FZRIGYUX.js.map} +0 -0
  42. /package/dist/{daily-logs-store-PXB53WEK.js.map → daily-logs-store-MEZ5S3BR.js.map} +0 -0
  43. /package/dist/{sync-JL7OPLCT.js.map → sync-P6QUZFSF.js.map} +0 -0
  44. /package/dist/{trades-store-MOFJHRC2.js.map → trades-store-3TOLBL2W.js.map} +0 -0
  45. /package/dist/{trades-store-UGZ62A7N.js.map → trades-store-PNLPRYRJ.js.map} +0 -0
  46. /package/server/{daily-logs-store-YAXASQN4.js.map → daily-logs-store-LRVO7COL.js.map} +0 -0
  47. /package/server/{sync-ZV3QEGMO.js.map → sync-336543PJ.js.map} +0 -0
  48. /package/server/{trades-store-MF7YYLCH.js.map → trades-store-MXUZLSF5.js.map} +0 -0
package/README.md CHANGED
@@ -537,9 +537,80 @@ predictive reports, regime analysis and threshold sweeps. `import_daily_dataset`
537
537
  atomically, without changing market data or requiring provider credentials. Date-only close
538
538
  values are available the following calendar day at 00:00 ET; date-only open values require
539
539
  `knownBy`; timestamped rows are as-of. Sparse columns carry forward their latest available
540
- observation without a freshness cutoff. See the [dataset tools reference](../../docs/mcp-tools.md#market-analysis)
540
+ observation with no freshness cutoff by default. See the [dataset tools reference](../../docs/mcp-tools.md#market-analysis)
541
541
  and [4.1.0 behavior changes](../../releases/v4.1.0.md#behavior-changes).
542
542
 
543
+ With Docker's default `-v ./data:/data` mount, put the CSV at
544
+ `./data/datasets/vrp.csv` on the host and pass `csvPath: "datasets/vrp.csv"` or
545
+ `"/data/datasets/vrp.csv"`; use the container path beneath the configured data root.
546
+ Close-column metadata shows `knownBy: null`; open columns retain the configured value.
547
+ Field-based `suggest_filters` retains all-trade `currentStats` and reports per-field
548
+ `fieldBaselines` (`count`, `totalPl`, `uncoveredCount`, `uncoveredTotalPl`).
549
+ Suggestions compare against those covered populations; `filter_curve.baseline`
550
+ reports the same covered and uncovered counts and P&L.
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
+
584
+ `suggest_filters` defaults to `objective: "totalPl"`: only positive P&L improvements,
585
+ ranked by P&L improvement with win-rate gain as tie-breaker. `objective: "winRate"`
586
+ admits/ranks by win-rate gain with P&L tie-breaks. `minImprovementPct` (default 3
587
+ percentage points) applies only to `winRate`; it is ignored under `totalPl` and the
588
+ response notes this when supplied. Standalone and composite suggestions include
589
+ `tradesKept`, `keptFraction`, `tradesRemoved`, and `objective`. `confidence` means
590
+ sample-size support, not statistical confidence; keeping less than 20% caps it at
591
+ low and adds a low-retention warning. Composite metrics describe kept trades.
592
+
593
+ In 4.3.0, `minImprovementThreshold` is null under `totalPl` and numeric under
594
+ `winRate`. Shared support thresholds are high at 20 kept/10 removed, medium at
595
+ 10 kept/5 removed, otherwise low, subject to the retention cap. This replaces
596
+ the fields path's former kept-only 100/30 thresholds. Composites use the selected
597
+ objective without the old >2-point standalone-relative gate. Their `improvement`
598
+ still means kept win-rate gain over the better standalone on the same covered
599
+ pool, not P&L or baseline-relative gain. See the [4.3.0 behavior changes](../../releases/v4.3.0.md#behavior-changes).
600
+
601
+ Dataset consumers accept optional `maxMissedSessions` (a nonnegative integer).
602
+ `datasetAge` preserves calendar-day ages and adds missed expected XNYS session ages:
603
+ close columns expect the prior session; open columns expect today's session only
604
+ at/after known-by ET (timestamped open rows without known-by use midnight for this
605
+ daily-session diagnostic, not for as-of matching). Friday close → Monday is 0 missed;
606
+ a missing Friday is 1, and holidays do not count. The calendar covers 2022–2030;
607
+ outside it, age is explicitly `unsupported`. With a limit set, stale/unsupported
608
+ values are refused and count as uncovered in field baselines. Without it, matching
609
+ is unchanged. `datasetWarnings` names stale/unsupported/refused counts;
610
+ `enrich_trades` includes session age in provenance and names `datasetRejections`.
611
+ Session summaries include refused candidates; calendar-day summaries count accepted
612
+ attachments only, returning null ages when none were accepted.
613
+
543
614
  ### Strategy Profile Tools
544
615
 
545
616
  | Tool | Description |
@@ -5181,6 +5181,9 @@ async function getTradesPage(blockId, offset, limit) {
5181
5181
  // ../lib/utils/trade-frequency.ts
5182
5182
  var MS_PER_DAY = 1e3 * 60 * 60 * 24;
5183
5183
 
5184
+ // ../lib/calculations/xnys-session-calendar.ts
5185
+ var MS_PER_DAY2 = 24 * 60 * 60 * 1e3;
5186
+
5184
5187
  // ../lib/db/index.ts
5185
5188
  var DB_NAME = "TradeBlocksDB";
5186
5189
  var DB_VERSION = 7;
@@ -5671,4 +5674,4 @@ export {
5671
5674
  searchTrades,
5672
5675
  getTradesPage
5673
5676
  };
5674
- //# sourceMappingURL=chunk-YRD62LDE.js.map
5677
+ //# sourceMappingURL=chunk-35RVWZGT.js.map