@dshtrading/strategies 0.3.0 → 0.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.
@@ -361,6 +361,8 @@ declare module '@deepseek-ai/cordis' {
361
361
  tradingNewsRegistry: TradingNewsRegistry;
362
362
  /** 跨市场快讯源(@dshtrading/connector-jin10 提供;缺席 = 未安装快讯连接器)。 */
363
363
  tradingFlashFeed: FlashFeedService;
364
+ /** 宏观/利率源(@dshtrading/connector-jin10 提供;缺席 = 未安装金十连接器)。 */
365
+ tradingMacroFeed: MacroFeedService;
364
366
  }
365
367
  }
366
368
  /**
@@ -487,6 +489,50 @@ interface FlashFeedService {
487
489
  /** 关键词搜快讯(上游一次性返回、不支持翻页)。 */
488
490
  searchFlash(keyword: string, limit?: number | undefined): Promise<readonly NewsItem[]>;
489
491
  }
492
+ /**
493
+ * 宏观经济日历条目(金十当周经济数据,2026-09-15):数值均为上游快照原样字符串,
494
+ * `actual` 缺省 = 未公布。
495
+ */
496
+ interface MacroCalendarEntry {
497
+ /** ISO 8601 公布时间(东八区解释,同 NewsItem 口径)。 */
498
+ readonly publishedAt: string;
499
+ /** 重要度(上游 star,0–5)。 */
500
+ readonly star: number;
501
+ /** 地区(标题前缀推断,如 美国/日本/中国;未识别 = 空串)。 */
502
+ readonly region: string;
503
+ readonly title: string;
504
+ readonly previous?: string;
505
+ readonly consensus?: string;
506
+ readonly actual?: string;
507
+ readonly revised?: string;
508
+ /** 上游公布影响词(利多/利空/影响较小…;原样透传)。 */
509
+ readonly affect?: string;
510
+ }
511
+ /** 央行最新利率条目(金十网页版,2026-09-15)。 */
512
+ interface MacroRateEntry {
513
+ /** 地区(flag 名推断,如 美国/日本/中国;未识别 = 空串)。 */
514
+ readonly region: string;
515
+ readonly bankName: string;
516
+ /** 最新利率(上游原样字符串,如 "3.75"/"0")。 */
517
+ readonly rate: string;
518
+ /** 公布日(上游原样 YYYY-MM-DD)。 */
519
+ readonly publishedAt: string;
520
+ /** 所属指标名(如「美联储利率决定(上限)」;部分央行缺省)。 */
521
+ readonly indicatorName?: string;
522
+ }
523
+ /**
524
+ * 宏观/利率源契约(2026-09-15 金十接入):host 平面由金十连接器 provide
525
+ * tradingMacroFeed,GUI 宏观面板(桥 /dshtrading/api/macro/*)消费;服务缺席 =
526
+ * 未安装/未启用该数据源 → 消费方报 TRADING_NOT_IMPLEMENTED,绝不把「没有数据源」
527
+ * 伪装成「没有数据」。日历走官方 MCP(list_calendar),利率走网页版公开接口
528
+ * (spikes/impl-jin10-macro-rates/EVIDENCE.md)。
529
+ */
530
+ interface MacroFeedService {
531
+ /** 当周经济日历(周一~周日,北京时间;limit 截尾,缺省全周)。 */
532
+ listCalendar(limit?: number | undefined): Promise<readonly MacroCalendarEntry[]>;
533
+ /** 央行最新利率(全量,客户端按地区过滤)。 */
534
+ listRates(): Promise<readonly MacroRateEntry[]>;
535
+ }
490
536
  /** 新闻聚合器注册表契约(Issue #37,router 插件提供)。 */
491
537
  interface TradingNewsRegistry {
492
538
  register(market: string, aggregator: NewsAggregator): () => void;
@@ -494,4 +540,4 @@ interface TradingNewsRegistry {
494
540
  markets(): string[];
495
541
  }
496
542
  //#endregion
497
- export { AccountBalance, AggregateNewsOptions, AggregateNewsResult, DerivativesData, DerivativesHistory, DerivativesPoint, Disposable, FlashFeedService, Interval, Kline, MarketDataRegistration, MarketDataRegistry, MarketDataService, MarketRouterService, NewsAggregator, NewsItem, Order, OrderRequest, OrderSide, OrderStatus, OrderType, Orderbook, OrderbookLevel, Position, PositionSide, StockFundamentals, Ticker, TradeFill, TradeRegistration, TradeRegistry, TradeService, TradeTick, TradingNewsRegistry };
543
+ export { AccountBalance, AggregateNewsOptions, AggregateNewsResult, DerivativesData, DerivativesHistory, DerivativesPoint, Disposable, FlashFeedService, Interval, Kline, MacroCalendarEntry, MacroFeedService, MacroRateEntry, MarketDataRegistration, MarketDataRegistry, MarketDataService, MarketRouterService, NewsAggregator, NewsItem, Order, OrderRequest, OrderSide, OrderStatus, OrderType, Orderbook, OrderbookLevel, Position, PositionSide, StockFundamentals, Ticker, TradeFill, TradeRegistration, TradeRegistry, TradeService, TradeTick, TradingNewsRegistry };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dshtrading/strategies",
3
3
  "description": "Trading strategies kernel for dsh-trading: pure math backtesting engine, strategy contracts, and 6 reference paradigms (short, swing, long). Pure library (zero runtime dependencies, browser-packable).",
4
- "version": "0.3.0",
4
+ "version": "0.4.0",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
7
7
  "types": "./lib/index.d.ts",
@@ -21,8 +21,8 @@
21
21
  ],
22
22
  "license": "PolyForm-Noncommercial-1.0.0",
23
23
  "dependencies": {
24
- "@dshtrading/dsh-home": "^0.3.0",
25
- "@dshtrading/indicators": "0.3.0"
24
+ "@dshtrading/dsh-home": "^0.4.0",
25
+ "@dshtrading/indicators": "0.4.0"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "@deepseek-ai/cordis": ">=4.0.0",
@@ -32,7 +32,7 @@
32
32
  "tsdown": "^0.22.0",
33
33
  "vitest": "^3.0.0",
34
34
  "typescript": "^5.5.0",
35
- "@dshtrading/api": "0.3.0"
35
+ "@dshtrading/api": "0.4.0"
36
36
  },
37
37
  "scripts": {
38
38
  "build": "tsdown",