tradeblocks-mcp 4.4.0 → 4.5.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 (47) hide show
  1. package/README.md +25 -0
  2. package/dist/{chunk-CZNPQ574.js → chunk-6IUDE55E.js} +3 -3
  3. package/dist/{chunk-35RVWZGT.js → chunk-BF4WFIP7.js} +13 -1
  4. package/dist/chunk-BF4WFIP7.js.map +1 -0
  5. package/dist/{chunk-ENXBPJ7Y.js → chunk-UOGG5TZQ.js} +31 -23
  6. package/dist/{chunk-ENXBPJ7Y.js.map → chunk-UOGG5TZQ.js.map} +1 -1
  7. package/dist/{daily-logs-store-FZRIGYUX.js → daily-logs-store-5KPMLDUC.js} +2 -2
  8. package/dist/{daily-logs-store-MEZ5S3BR.js → daily-logs-store-SG6AD3G5.js} +2 -2
  9. package/dist/market/provenance/index.js +1 -1
  10. package/dist/{sync-P6QUZFSF.js → sync-R7BQBTN4.js} +3 -3
  11. package/dist/test-exports.js +131 -126
  12. package/dist/test-exports.js.map +1 -1
  13. package/dist/{trades-store-PNLPRYRJ.js → trades-store-6WI7G5OY.js} +2 -2
  14. package/dist/{trades-store-3TOLBL2W.js → trades-store-JEXOYGOE.js} +2 -2
  15. package/package.json +1 -1
  16. package/server/{chunk-5JTQEV7P.js → chunk-2T44OXWR.js} +7 -5
  17. package/server/{chunk-5JTQEV7P.js.map → chunk-2T44OXWR.js.map} +1 -1
  18. package/server/{chunk-PDSUY2X2.js → chunk-C7HUTUSW.js} +31 -23
  19. package/server/{chunk-PDSUY2X2.js.map → chunk-C7HUTUSW.js.map} +1 -1
  20. package/server/{daily-logs-store-LRVO7COL.js → daily-logs-store-WTOHFVK2.js} +2 -2
  21. package/server/index.js +506 -244
  22. package/server/index.js.map +1 -1
  23. package/server/{sync-336543PJ.js → sync-RZHKNM7E.js} +3 -3
  24. package/server/{trades-store-MXUZLSF5.js → trades-store-4SMROY7M.js} +2 -2
  25. package/src/db/dataset-schemas.ts +5 -2
  26. package/src/tools/analysis.ts +5 -3
  27. package/src/tools/batch-exit-analysis.ts +3 -3
  28. package/src/tools/blocks/analysis.ts +1 -1
  29. package/src/tools/blocks/similarity.ts +1 -1
  30. package/src/tools/profile-analysis.ts +11 -6
  31. package/src/tools/reports/fields.ts +1 -1
  32. package/src/tools/reports/helpers.ts +2 -1
  33. package/src/tools/reports/predictive.ts +145 -13
  34. package/src/tools/shared/field-analysis.ts +39 -25
  35. package/src/tools/shared/filter-objective.ts +10 -3
  36. package/src/utils/filter-curve.ts +264 -55
  37. package/src/utils/trade-analysis-fields.ts +8 -2
  38. package/dist/chunk-35RVWZGT.js.map +0 -1
  39. /package/dist/{chunk-CZNPQ574.js.map → chunk-6IUDE55E.js.map} +0 -0
  40. /package/dist/{daily-logs-store-FZRIGYUX.js.map → daily-logs-store-5KPMLDUC.js.map} +0 -0
  41. /package/dist/{daily-logs-store-MEZ5S3BR.js.map → daily-logs-store-SG6AD3G5.js.map} +0 -0
  42. /package/dist/{sync-P6QUZFSF.js.map → sync-R7BQBTN4.js.map} +0 -0
  43. /package/dist/{trades-store-3TOLBL2W.js.map → trades-store-6WI7G5OY.js.map} +0 -0
  44. /package/dist/{trades-store-PNLPRYRJ.js.map → trades-store-JEXOYGOE.js.map} +0 -0
  45. /package/server/{daily-logs-store-LRVO7COL.js.map → daily-logs-store-WTOHFVK2.js.map} +0 -0
  46. /package/server/{sync-336543PJ.js.map → sync-RZHKNM7E.js.map} +0 -0
  47. /package/server/{trades-store-MXUZLSF5.js.map → trades-store-4SMROY7M.js.map} +0 -0
package/README.md CHANGED
@@ -581,6 +581,31 @@ Field, objective and mode choices across separate requests are outside the Holm
581
581
  Monthly blocks retain within-month dependence, not cross-month dependence; block
582
582
  exchangeability is an assumption. See [the full contract](../../docs/mcp-tools.md#filter-curve-significance-and-stability).
583
583
 
584
+ In 4.5.0, `unit: "day"` aggregates entry-date P&L before scoring and month
585
+ permutation; win rate counts profitable days. A field varying within a day is
586
+ refused as `day_field_varies`, with the varying dates. Cheap request/work admission
587
+ precedes causal field resolution and counts the chosen unit conservatively before
588
+ coverage. Omitted `unit` retains trade-mode outputs.
589
+ Day mode also offers `sharpe` (daily dollar P&L, rf=0, sample std, √252),
590
+ `mar` (calendar-day CAGR / drawdown fraction of observed starting capital), and
591
+ `maxDrawdown` (dollar drawdown reduction; smaller is better). Filtered dates are
592
+ flat. Trade units refuse these objectives; MAR additionally refuses missing capital.
593
+ `objectiveMetadata` documents definitions and undefined cases. This dollar-P&L
594
+ Sharpe intentionally differs from the capital-based portfolio return Sharpe.
595
+ `groupBy: "regime.label"` adds chosen-threshold `perGroup` rows in either unit,
596
+ with the same covered baseline/kept/removed shape as `perYear`. Numeric groups use
597
+ `bins` or shared regime-analysis quartiles; categorical groups use values.
598
+ Missing values form an explicit uncovered group, small groups stay flagged,
599
+ and within-day varying groups refuse as `day_group_varies`. Group values honor
600
+ the same causal availability and optional freshness limit.
601
+
602
+ Missing groups use `group: null`, `groupValue: null`, `uncoveredGroup: true`, distinct
603
+ from a real `"uncovered"` category. Varchar market fields such as `Trend_Direction`
604
+ are now categorical for filter suggestions and regime analysis. Explicit-field
605
+ tools resolve only consumed fields without changing their timing or values. See the
606
+ [4.5.0 release notes](../../releases/v4.5.0.md) for the timings, MAR capital/window
607
+ policy and the under-90-day per-year/per-group `marUnstable` guard.
608
+
584
609
  `suggest_filters` defaults to `objective: "totalPl"`: only positive P&L improvements,
585
610
  ranked by P&L improvement with win-rate gain as tie-breaker. `objective: "winRate"`
586
611
  admits/ranks by win-rate gain with P&L tie-breaks. `minImprovementPct` (default 3
@@ -6,7 +6,7 @@ import {
6
6
  getNetPl,
7
7
  getRiskFreeRate,
8
8
  resolveTreasuryRateByKey
9
- } from "./chunk-ENXBPJ7Y.js";
9
+ } from "./chunk-UOGG5TZQ.js";
10
10
  import {
11
11
  PlBasis
12
12
  } from "./chunk-BH6SQOWF.js";
@@ -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-P6QUZFSF.js")).getBlocksDir(dataRoot);
3793
+ const blocksDir = (await import("./sync-R7BQBTN4.js")).getBlocksDir(dataRoot);
3794
3794
  await migrateMetadataToJson(connection, dataRoot, blocksDir);
3795
3795
  } catch (err) {
3796
3796
  console.warn(
@@ -23270,4 +23270,4 @@ decimal.js/decimal.mjs:
23270
23270
  * MIT Licence
23271
23271
  *)
23272
23272
  */
23273
- //# sourceMappingURL=chunk-CZNPQ574.js.map
23273
+ //# sourceMappingURL=chunk-6IUDE55E.js.map
@@ -5184,6 +5184,18 @@ var MS_PER_DAY = 1e3 * 60 * 60 * 24;
5184
5184
  // ../lib/calculations/xnys-session-calendar.ts
5185
5185
  var MS_PER_DAY2 = 24 * 60 * 60 * 1e3;
5186
5186
 
5187
+ // ../lib/calculations/static-dataset-matcher.ts
5188
+ var easternOffsetFormatter = new Intl.DateTimeFormat("en-US", {
5189
+ timeZone: "America/New_York",
5190
+ timeZoneName: "shortOffset"
5191
+ });
5192
+ var easternDateFormatter = new Intl.DateTimeFormat("en-CA", {
5193
+ timeZone: "America/New_York",
5194
+ year: "numeric",
5195
+ month: "2-digit",
5196
+ day: "2-digit"
5197
+ });
5198
+
5187
5199
  // ../lib/db/index.ts
5188
5200
  var DB_NAME = "TradeBlocksDB";
5189
5201
  var DB_VERSION = 7;
@@ -5674,4 +5686,4 @@ export {
5674
5686
  searchTrades,
5675
5687
  getTradesPage
5676
5688
  };
5677
- //# sourceMappingURL=chunk-35RVWZGT.js.map
5689
+ //# sourceMappingURL=chunk-BF4WFIP7.js.map