stock-sdk 2.2.2 → 2.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 (66) hide show
  1. package/README.md +7 -2
  2. package/dist/{adapters-BiH4keVd.d.cts → adapters-CZUNRbxi.d.cts} +29 -1
  3. package/dist/{adapters-BiH4keVd.d.ts → adapters-CZUNRbxi.d.ts} +29 -1
  4. package/dist/cache.cjs +1 -1
  5. package/dist/cache.d.cts +35 -3
  6. package/dist/cache.d.ts +35 -3
  7. package/dist/cache.js +1 -1
  8. package/dist/chip-BbA23rr1.d.cts +113 -0
  9. package/dist/chip-BbA23rr1.d.ts +113 -0
  10. package/dist/chunk-46ECBWOQ.cjs +1 -0
  11. package/dist/chunk-4RN7AVFQ.js +1 -0
  12. package/dist/chunk-6FZNYDNN.cjs +1 -0
  13. package/dist/chunk-6MCPZDKN.cjs +1 -0
  14. package/dist/chunk-H5FDXQRK.js +1 -0
  15. package/dist/chunk-HKREKO2F.js +1 -0
  16. package/dist/chunk-LDYRNH4X.cjs +1 -0
  17. package/dist/chunk-OPCBE3NR.js +1 -0
  18. package/dist/chunk-R7M3BHS4.cjs +1 -0
  19. package/dist/chunk-SMCYQ6NL.js +1 -0
  20. package/dist/chunk-USZUOBM2.cjs +1 -0
  21. package/dist/chunk-VKXPLWPL.js +1 -0
  22. package/dist/chunk-W625VPPB.js +1 -0
  23. package/dist/chunk-WJOFTWZL.cjs +1 -0
  24. package/dist/cli.cjs +16 -16
  25. package/dist/cli.js +16 -16
  26. package/dist/index.cjs +1 -1
  27. package/dist/index.d.cts +24 -7
  28. package/dist/index.d.ts +24 -7
  29. package/dist/index.js +1 -1
  30. package/dist/indicators.cjs +1 -1
  31. package/dist/indicators.d.cts +1 -0
  32. package/dist/indicators.d.ts +1 -0
  33. package/dist/indicators.js +1 -1
  34. package/dist/mcp.cjs +83 -5
  35. package/dist/mcp.d.cts +29 -2
  36. package/dist/mcp.d.ts +29 -2
  37. package/dist/mcp.js +83 -5
  38. package/dist/screener.cjs +1 -1
  39. package/dist/screener.d.cts +51 -16
  40. package/dist/screener.d.ts +51 -16
  41. package/dist/screener.js +1 -1
  42. package/dist/{sdk-CmYFd7V2.d.ts → sdk-DGgSDZRx.d.ts} +200 -21
  43. package/dist/{sdk-BOfyUDzu.d.cts → sdk-RzQ-drS4.d.cts} +200 -21
  44. package/dist/signals.d.cts +3 -42
  45. package/dist/signals.d.ts +3 -42
  46. package/dist/symbols.cjs +1 -1
  47. package/dist/symbols.d.cts +2 -2
  48. package/dist/symbols.d.ts +2 -2
  49. package/dist/symbols.js +1 -1
  50. package/dist/types-7n5rSHbd.d.cts +42 -0
  51. package/dist/types-7n5rSHbd.d.ts +42 -0
  52. package/package.json +2 -1
  53. package/dist/chunk-3VUFYFFD.js +0 -1
  54. package/dist/chunk-6ZSZEHZW.js +0 -1
  55. package/dist/chunk-C4CA7QBB.cjs +0 -1
  56. package/dist/chunk-DU7MCVLJ.js +0 -1
  57. package/dist/chunk-EDUJJOAJ.js +0 -1
  58. package/dist/chunk-F3KZXCVO.js +0 -1
  59. package/dist/chunk-JP3ZPNWP.cjs +0 -1
  60. package/dist/chunk-KKGWFS2M.cjs +0 -1
  61. package/dist/chunk-LCX5Q36O.js +0 -1
  62. package/dist/chunk-T5CH7H3X.cjs +0 -1
  63. package/dist/chunk-TVIEKKDQ.cjs +0 -1
  64. package/dist/chunk-USK6JHLG.cjs +0 -1
  65. package/dist/chunk-WCBK5KYA.cjs +0 -1
  66. package/dist/chunk-ZZ2IBUMV.js +0 -1
@@ -1,5 +1,7 @@
1
1
  import { c as SdkErrorCode, R as RetryOptions, d as RateLimiterOptions, C as CircuitBreakerOptions, P as ProviderName, a as ProviderRequestPolicy, S as SdkError } from './index-mlzPfoON.cjs';
2
+ import { b as ChipDistributionOptions, d as ChipDistributionItem } from './chip-BbA23rr1.cjs';
2
3
  import { n as MarketTz, v as TodayTimelineResponse, I as IndicatorOptions, H as HistoryKline, s as MinuteTimeline, t as MinuteKline, w as HKHistoryKline, y as HKMinuteTimeline, x as HKMinuteKline, U as USHistoryKline, E as USMinuteTimeline, z as USMinuteKline, K as KlineWithIndicators, A as AnyHistoryKline } from './addIndicators-_V3HEi0q.cjs';
4
+ import { a as Signal } from './types-7n5rSHbd.cjs';
3
5
 
4
6
  interface HostHealthState {
5
7
  host: string;
@@ -320,7 +322,8 @@ interface HKQuote {
320
322
  totalMarketCap: number | null;
321
323
  currency: string;
322
324
  market: 'HK';
323
- assetType: 'stock';
325
+ /** 命中特殊指数注册表(HSI/HSCEI/HSTECH)的行标 'index'(港股真码恒为数字,无碰撞面) */
326
+ assetType: 'stock' | 'index';
324
327
  source: ProviderName;
325
328
  }
326
329
  /**
@@ -372,7 +375,8 @@ interface USQuote {
372
375
  /** 52周最低价 */
373
376
  low52w: number | null;
374
377
  market: 'US';
375
- assetType: 'stock';
378
+ /** 命中特殊指数注册表(DJI/INX/IXIC)的行标 'index',code 归一为注册表规范形 */
379
+ assetType: 'stock' | 'index';
376
380
  source: ProviderName;
377
381
  }
378
382
  /**
@@ -1102,13 +1106,95 @@ interface StockChangeItem {
1102
1106
  code: string;
1103
1107
  /** 股票名称 */
1104
1108
  name: string;
1105
- /** 异动类型 */
1106
- changeType: StockChangeType;
1107
- /** 异动类型对应的中文标签 */
1109
+ /** 异动类型(由响应 t 码反查;服务端新增的未知码为 'unknown',原始码见 typeCode) */
1110
+ changeType: StockChangeType | 'unknown';
1111
+ /** 原始类型码(服务端 t 字段) */
1112
+ typeCode: string;
1113
+ /** 异动类型对应的中文标签(未知码为空串) */
1108
1114
  changeTypeLabel: string;
1109
1115
  /** 相关信息(来自原始接口) */
1110
1116
  info: string;
1111
1117
  }
1118
+ /**
1119
+ * 个股盘口异动事件(个股按日接口,字段比全市场接口更丰富)
1120
+ */
1121
+ interface IndividualStockChangeItem {
1122
+ /** 发生时间 HH:MM:SS */
1123
+ time: string;
1124
+ /** 原始类型码(个股接口会返回 22 类之外的码,如 8219) */
1125
+ typeCode: string;
1126
+ /** 异动类型(未知码为 'unknown') */
1127
+ changeType: StockChangeType | 'unknown';
1128
+ /** 中文标签(未知码为空串) */
1129
+ changeTypeLabel: string;
1130
+ /** 触发价(元) */
1131
+ price: number | null;
1132
+ /** 触发时涨跌幅(%) */
1133
+ changePercent: number | null;
1134
+ /** 相关信息(来自原始接口,CSV 格式因类型而异) */
1135
+ info: string;
1136
+ /** 上游未文档化字段(疑似异动量级),原样透传 */
1137
+ v: number | null;
1138
+ }
1139
+ /**
1140
+ * 个股单个交易日的异动数据
1141
+ */
1142
+ interface IndividualChangesDay {
1143
+ /** 交易日 YYYY-MM-DD */
1144
+ date: string;
1145
+ /**
1146
+ * 服务端该交易日是否有数据。false = 无数据(changes 恒为空),与
1147
+ * "当日无异动"(true + 空数组)区分。
1148
+ *
1149
+ * 注意:服务端仅保留约最近数周(实测 1 个月左右),且窗口**不保证连续**
1150
+ * ——实测存在个别日期空洞(更早的日期反而有数据)。永远以逐日返回的
1151
+ * available 为准,不要按固定天数推断。
1152
+ */
1153
+ available: boolean;
1154
+ /** 股票代码 */
1155
+ code: string;
1156
+ /** 股票名称(超窗时为空串) */
1157
+ name: string;
1158
+ /** 异动事件流(服务端顺序,最新在前) */
1159
+ changes: IndividualStockChangeItem[];
1160
+ }
1161
+ /**
1162
+ * 单个异动类型的计数(IndividualChangesHistory.stats 的值)
1163
+ */
1164
+ interface ChangeTypeCount {
1165
+ /** 出现次数 */
1166
+ count: number;
1167
+ /** 中文标签(未知类型码为空串) */
1168
+ label: string;
1169
+ }
1170
+ /**
1171
+ * 个股近 N 天异动历史(逐交易日聚合)
1172
+ */
1173
+ interface IndividualChangesHistory {
1174
+ /** 股票代码 */
1175
+ code: string;
1176
+ /** 股票名称 */
1177
+ name: string;
1178
+ /** 请求的自然日跨度 */
1179
+ requestedDays: number;
1180
+ /** 实际覆盖情况 */
1181
+ coverage: {
1182
+ /** 请求窗口起点(自然日)YYYY-MM-DD */
1183
+ from: string;
1184
+ /** 请求窗口终点(北京时间今天)YYYY-MM-DD */
1185
+ to: string;
1186
+ /** 窗口内首个有数据的交易日(其后仍可能有个别空洞日);全部无数据时为 null */
1187
+ availableFrom: string | null;
1188
+ };
1189
+ /** 逐交易日数据(按日期升序;available=false 表示服务端该日无数据) */
1190
+ days: IndividualChangesDay[];
1191
+ /**
1192
+ * 异动类型计数概览(仅统计 available 日)。
1193
+ * key 为**原始类型码**(typeCode,稳定、可跨会话程序化比较),
1194
+ * 中文标签见值内 label(未知码为空串)。
1195
+ */
1196
+ stats: Record<string, ChangeTypeCount>;
1197
+ }
1112
1198
  /**
1113
1199
  * 板块异动项
1114
1200
  */
@@ -1488,8 +1574,11 @@ interface FundNavPoint {
1488
1574
  date: string;
1489
1575
  /** 净值日期对应的毫秒时间戳(数据源原值,UTC 当日 00:00) */
1490
1576
  timestamp: number | null;
1491
- /** 单位净值 */
1492
- nav: number;
1577
+ /**
1578
+ * 单位净值;上游该行净值缺失 / 非数值时为 `null`
1579
+ * (v2.4.0 起从 `number` 放宽,与 accNav / dailyReturn 的可空口径一致)
1580
+ */
1581
+ nav: number | null;
1493
1582
  /** 累计净值;与单位净值数组按 timestamp 对齐,无法对齐时为 `null` */
1494
1583
  accNav: number | null;
1495
1584
  /** 日增长率(%);无值时为 `null` */
@@ -1940,18 +2029,6 @@ interface GetUSCodeListOptions {
1940
2029
  */
1941
2030
  type GetAllHKQuotesOptions = Omit<GetAllAShareQuotesOptions, 'market'>;
1942
2031
 
1943
- /**
1944
- * 腾讯 Smartbox 搜索接口
1945
- * 支持浏览器(JSONP)和 Node.js(fetch)双端
1946
- */
1947
-
1948
- /** 全局变量声明(浏览器环境)*/
1949
- declare global {
1950
- interface Window {
1951
- v_hint?: string;
1952
- }
1953
- }
1954
-
1955
2032
  /**
1956
2033
  * 东方财富 - A 股 K 线
1957
2034
  */
@@ -2274,6 +2351,91 @@ interface KlineWithIndicatorsOptions {
2274
2351
  * - 完整选项参见 `IndicatorOptions`
2275
2352
  */
2276
2353
  indicators?: IndicatorOptions;
2354
+ /**
2355
+ * 窗口前额外保留的 bar 数(内部选项,信号闭环用;默认 0)。
2356
+ * `getKlineSignals` 传 1:交叉识别需要窗口首日的前一根做锚点,按**下标**多留
2357
+ * 一根已算好指标的 bar —— 对任意长度的停牌缺口都精确(区别于按天数回推的
2358
+ * 启发式)。仅 `startDate` 存在时生效;保留的 bar 日期早于 startDate。
2359
+ */
2360
+ leadingBars?: number;
2361
+ }
2362
+ /**
2363
+ * `getKlineSignals` 的请求参数。
2364
+ *
2365
+ * 复用 K 线的取数选项(market / period / adjust / startDate / endDate),
2366
+ * 额外用 `maFast` / `maSlow` 指定 MA 金叉/死叉的快慢线周期。其余信号族
2367
+ * (MACD / KDJ / RSI / BOLL / SAR)用固定的常用默认阈值,一次性全部识别。
2368
+ */
2369
+ interface KlineSignalsOptions {
2370
+ /** 市场类型;不传由 `symbol` 自动识别(同 {@link KlineWithIndicatorsOptions.market}) */
2371
+ market?: MarketType;
2372
+ /** K 线周期,默认 `'daily'` */
2373
+ period?: 'daily' | 'weekly' | 'monthly';
2374
+ /** 复权方式:`''` 不复权 / `'qfq'` 前复权 / `'hfq'` 后复权 */
2375
+ adjust?: '' | 'qfq' | 'hfq';
2376
+ /**
2377
+ * 起始日期(`YYYYMMDD` 或 `YYYY-MM-DD`)。
2378
+ * 不传则在全部历史上识别信号;只关心近期请传起始日期收窄窗口。
2379
+ */
2380
+ startDate?: string;
2381
+ /** 结束日期(`YYYYMMDD` 或 `YYYY-MM-DD`) */
2382
+ endDate?: string;
2383
+ /** MA 金叉/死叉快线周期,默认 5(须为正整数且小于 `maSlow`) */
2384
+ maFast?: number;
2385
+ /** MA 金叉/死叉慢线周期,默认 20(须为正整数且大于 `maFast`) */
2386
+ maSlow?: number;
2387
+ }
2388
+ /**
2389
+ * 一条识别出的指标信号 —— 在原始 {@link Signal} 上补充**日期与收盘价**,
2390
+ * 让 LLM / 调用方无需回查 K 线即可解读(如「MACD 金叉 · 2026-06-15 · 收 1720」)。
2391
+ */
2392
+ interface KlineSignal {
2393
+ /** 信号类型(14 种:MA/MACD/KDJ 金叉死叉、KDJ/RSI 超买超卖、BOLL 突破、SAR 反转) */
2394
+ type: Signal['type'];
2395
+ /** 信号发生 K 线的日期(原始 `date`,通常 `YYYY-MM-DD`) */
2396
+ date: string;
2397
+ /** 信号发生 K 线的时间戳(epoch 毫秒,= {@link Signal.at}) */
2398
+ timestamp: number;
2399
+ /** 信号发生 K 线的收盘价 */
2400
+ close: number | null;
2401
+ /** 附加信息(如金叉的快慢周期、超买超卖的指标值) */
2402
+ detail?: Record<string, number>;
2403
+ }
2404
+
2405
+ /**
2406
+ * 筹码分布 Service:拉取对应市场日 K 线(含暖机段)→ 本地计算 → 裁剪返回。
2407
+ * 计算本体在 `src/indicators/chip.ts`(纯函数,零网络),本 service 只做编排。
2408
+ */
2409
+
2410
+ /** `chips.cn / hk / us` 的请求参数 */
2411
+ interface ChipDistributionRequestOptions extends Pick<ChipDistributionOptions, 'range' | 'includeHistogram' | 'decimals'> {
2412
+ /**
2413
+ * 返回最近多少个交易日的筹码分布序列。
2414
+ * @default 90
2415
+ */
2416
+ days?: number;
2417
+ /**
2418
+ * 复权方式(与对应市场 `kline.*` 一致,默认 `'qfq'` 前复权)。
2419
+ * 分布数值随复权口径变化;需对齐 akshare `stock_cyq_em` 默认输出时传 `''`。
2420
+ * @default 'qfq'
2421
+ */
2422
+ adjust?: '' | 'qfq' | 'hfq';
2423
+ }
2424
+
2425
+ /** `marketEvent.individualChanges` 的请求参数 */
2426
+ interface IndividualChangesOptions {
2427
+ /** 交易日 YYYYMMDD 或 YYYY-MM-DD;不传为北京时间今天 */
2428
+ date?: string;
2429
+ }
2430
+ /** `marketEvent.individualChangesHistory` 的请求参数 */
2431
+ interface IndividualChangesHistoryOptions {
2432
+ /**
2433
+ * 最近 N 个自然日(1~60)。内部按 A 股交易日历枚举其中的交易日逐日请求。
2434
+ * 注意服务端仅保留约最近数周(且可能存在个别日期空洞),
2435
+ * 无数据的日期返回 available: false。
2436
+ * @default 7
2437
+ */
2438
+ days?: number;
2277
2439
  }
2278
2440
 
2279
2441
  /**
@@ -2356,6 +2518,7 @@ declare class StockSDK {
2356
2518
  private readonly futuresService;
2357
2519
  private readonly optionsService;
2358
2520
  private readonly indicatorService;
2521
+ private readonly chipService;
2359
2522
  private readonly fundFlowService;
2360
2523
  private readonly northboundService;
2361
2524
  private readonly marketEventService;
@@ -2369,6 +2532,13 @@ declare class StockSDK {
2369
2532
  * 也可以通过 `providerPolicies` 为不同数据源覆盖请求治理策略而不影响既有 API。
2370
2533
  */
2371
2534
  constructor(options?: RequestClientOptions);
2535
+ /**
2536
+ * 清空本实例的全部内部缓存(代码表 / 交易日历 / 板块名称映射 / us-secid 解析)。
2537
+ *
2538
+ * R7-11 起这些缓存按实例隔离,模块级 `clearSharedCaches()` 对它们不再生效
2539
+ * —— 长驻进程需要强刷时用本方法。
2540
+ */
2541
+ clearCaches(): void;
2372
2542
  private readonly _ns;
2373
2543
  private memoNs;
2374
2544
  /** 实时行情 */
@@ -2409,6 +2579,13 @@ declare class StockSDK {
2409
2579
  us: (symbol: string, options?: USKlineOptions) => Promise<USHistoryKline[]>;
2410
2580
  usMinute: (symbol: string, options?: USMinuteKlineOptions) => Promise<USMinuteTimeline[] | USMinuteKline[]>;
2411
2581
  withIndicators: (symbol: string, options?: KlineWithIndicatorsOptions) => Promise<KlineWithIndicators<AnyHistoryKline>[]>;
2582
+ signals: (symbol: string, options?: KlineSignalsOptions) => Promise<KlineSignal[]>;
2583
+ };
2584
+ /** 筹码分布(A 股 / 港股 / 美股,基于日 K + 换手率本地计算) */
2585
+ get chips(): {
2586
+ cn: (symbol: string, options?: ChipDistributionRequestOptions) => Promise<ChipDistributionItem[]>;
2587
+ hk: (symbol: string, options?: ChipDistributionRequestOptions) => Promise<ChipDistributionItem[]>;
2588
+ us: (symbol: string, options?: ChipDistributionRequestOptions) => Promise<ChipDistributionItem[]>;
2412
2589
  };
2413
2590
  /** 板块(行业 / 概念) */
2414
2591
  get board(): {
@@ -2477,8 +2654,10 @@ declare class StockSDK {
2477
2654
  /** 涨停 / 盘口异动 */
2478
2655
  get marketEvent(): {
2479
2656
  ztPool: (type?: ZTPoolType, date?: string) => Promise<ZTPoolItem[]>;
2480
- stockChanges: (type?: StockChangeType) => Promise<StockChangeItem[]>;
2657
+ stockChanges: (type?: StockChangeType | StockChangeType[] | "all") => Promise<StockChangeItem[]>;
2481
2658
  boardChanges: () => Promise<BoardChangeItem[]>;
2659
+ individualChanges: (symbol: string, options?: IndividualChangesOptions) => Promise<IndividualStockChangeItem[]>;
2660
+ individualChangesHistory: (symbol: string, options?: IndividualChangesHistoryOptions) => Promise<IndividualChangesHistory>;
2482
2661
  };
2483
2662
  /** 龙虎榜 */
2484
2663
  get dragonTiger(): {
@@ -2527,4 +2706,4 @@ declare class StockSDK {
2527
2706
  search(keyword: string): Promise<SearchResult[]>;
2528
2707
  }
2529
2708
 
2530
- export { type ConceptBoard as $, type AShareMarket as A, type BlockTradeDateOptions as B, type ConceptBoardKlineOptions as C, type DragonTigerDateOptions as D, type ExternalLink as E, FundService as F, type GetAllAShareQuotesOptions as G, type HistoryKlineOptions as H, type IndustryBoardKlineOptions as I, type FundFlow as J, type HKQuote as K, type USQuote as L, type MarketType as M, type NorthboundHoldingRankOptions as N, type FundQuote as O, type PanelLargeOrder as P, type Quote as Q, type RequestClientOptions as R, StockSDK as S, TradingCalendarService as T, type USMarket as U, type IndustryBoard as V, type IndustryBoardSpot as W, type IndustryBoardConstituent as X, type IndustryBoardKline as Y, type IndustryBoardMinuteTimeline as Z, type IndustryBoardMinuteKline as _, RequestClient as a, type FundAssetAllocation as a$, type ConceptBoardSpot as a0, type ConceptBoardConstituent as a1, type ConceptBoardKline as a2, type ConceptBoardMinuteTimeline as a3, type ConceptBoardMinuteKline as a4, type FuturesExchange as a5, type FuturesKline as a6, type GlobalFuturesQuote as a7, type FuturesInventorySymbol as a8, type FuturesInventory as a9, type ZTPoolItem as aA, type StockChangeType as aB, type StockChangeItem as aC, type BoardChangeItem as aD, type DragonTigerPeriod as aE, type DragonTigerDetailItem as aF, type DragonTigerStockStatItem as aG, type DragonTigerInstitutionItem as aH, type DragonTigerBranchItem as aI, type DragonTigerSeatItem as aJ, type BlockTradeMarketStatItem as aK, type BlockTradeDetailItem as aL, type BlockTradeDailyStatItem as aM, type MarginAccountItem as aN, type MarginTargetItem as aO, type FundDividendRank as aP, type FundSortDirection as aQ, type FundDividendListOptions as aR, type FundDividend as aS, type FundDividendListResult as aT, type FundNavPoint as aU, type FundNavHistory as aV, type FundEstimate as aW, type FundRankPoint as aX, type FundRankHistory as aY, type FundHolding as aZ, type FundBondHolding as a_, type ComexInventory as aa, type IndexOptionProduct as ab, type OptionTQuote as ac, type OptionTQuoteResult as ad, type OptionKline as ae, type OptionMinute as af, type ETFOptionMonth as ag, type ETFOptionExpireDay as ah, type ETFOptionCate as ai, type CFFEXOptionQuote as aj, type OptionLHBItem as ak, type SearchResultType as al, type DividendDetail as am, type StockFundFlowDaily as an, type FundFlowRankItem as ao, type SectorFundFlowItem as ap, type MarketFundFlow as aq, type NorthboundDirection as ar, type NorthboundMarket as as, type NorthboundRankPeriod as at, type NorthboundMinuteItem as au, type NorthboundFlowSummary as av, type NorthboundHoldingRankItem as aw, type NorthboundHistoryItem as ax, type NorthboundIndividualItem as ay, type ZTPoolType as az, type SearchResult as b, type FundPositionPoint as b0, type FundManager as b1, type FundPerformanceEvaluation as b2, type FundHolderStructure as b3, type FundScaleChange as b4, type FundBuySedemption as b5, type FundStageReturns as b6, type FundSameTypePeer as b7, type FundSameType as b8, type ThemeFundSort as b9, type ThemeFundOrder as ba, type ThemeCategory as bb, type GetThemeListOptions as bc, type GetHotThemesOptions as bd, type ThemeFundRankSort as be, type GetThemeFundsOptions as bf, type ThemeFund as bg, type ThemeFundListResult as bh, type HotThemesResult as bi, type ThemeFundItem as bj, type ThemeFundItemList as bk, type GetAShareCodeListOptions as c, type GetUSCodeListOptions as d, type GetAllUSQuotesOptions as e, type MarketStatus as f, type SupportedMarket as g, type FundProfile as h, type MinuteKlineOptions as i, type HKKlineOptions as j, type HKMinuteKlineOptions as k, type USKlineOptions as l, type USMinuteKlineOptions as m, type IndustryBoardMinuteKlineOptions as n, type ConceptBoardMinuteKlineOptions as o, type FuturesKlineOptions as p, type GlobalFuturesSpotOptions as q, type GlobalFuturesKlineOptions as r, type FuturesInventoryOptions as s, type ComexInventoryOptions as t, type CFFEXOptionQuotesOptions as u, type FundFlowOptions as v, type FundFlowRankOptions as w, type NorthboundHistoryOptions as x, type FullQuote as y, type SimpleQuote as z };
2709
+ export { type IndustryBoardKline as $, type AShareMarket as A, type NorthboundHistoryOptions as B, type ChipDistributionRequestOptions as C, type BlockTradeDateOptions as D, type ExternalLink as E, FundService as F, type GetAllAShareQuotesOptions as G, type HistoryKlineOptions as H, type IndividualChangesOptions as I, type DragonTigerDateOptions as J, type FullQuote as K, type SimpleQuote as L, type MarketType as M, type NorthboundHoldingRankOptions as N, type FundFlow as O, type PanelLargeOrder as P, type HKQuote as Q, type RequestClientOptions as R, StockSDK as S, TradingCalendarService as T, type USMarket as U, type USQuote as V, type FundQuote as W, type Quote as X, type IndustryBoard as Y, type IndustryBoardSpot as Z, type IndustryBoardConstituent as _, RequestClient as a, type FundNavPoint as a$, type IndustryBoardMinuteTimeline as a0, type IndustryBoardMinuteKline as a1, type ConceptBoard as a2, type ConceptBoardSpot as a3, type ConceptBoardConstituent as a4, type ConceptBoardKline as a5, type ConceptBoardMinuteTimeline as a6, type ConceptBoardMinuteKline as a7, type FuturesExchange as a8, type FuturesKline as a9, type NorthboundHistoryItem as aA, type NorthboundIndividualItem as aB, type ZTPoolType as aC, type ZTPoolItem as aD, type StockChangeType as aE, type StockChangeItem as aF, type IndividualStockChangeItem as aG, type IndividualChangesDay as aH, type ChangeTypeCount as aI, type IndividualChangesHistory as aJ, type BoardChangeItem as aK, type DragonTigerPeriod as aL, type DragonTigerDetailItem as aM, type DragonTigerStockStatItem as aN, type DragonTigerInstitutionItem as aO, type DragonTigerBranchItem as aP, type DragonTigerSeatItem as aQ, type BlockTradeMarketStatItem as aR, type BlockTradeDetailItem as aS, type BlockTradeDailyStatItem as aT, type MarginAccountItem as aU, type MarginTargetItem as aV, type FundDividendRank as aW, type FundSortDirection as aX, type FundDividendListOptions as aY, type FundDividend as aZ, type FundDividendListResult as a_, type GlobalFuturesQuote as aa, type FuturesInventorySymbol as ab, type FuturesInventory as ac, type ComexInventory as ad, type IndexOptionProduct as ae, type OptionTQuote as af, type OptionTQuoteResult as ag, type OptionKline as ah, type OptionMinute as ai, type ETFOptionMonth as aj, type ETFOptionExpireDay as ak, type ETFOptionCate as al, type CFFEXOptionQuote as am, type OptionLHBItem as an, type SearchResultType as ao, type DividendDetail as ap, type StockFundFlowDaily as aq, type FundFlowRankItem as ar, type SectorFundFlowItem as as, type MarketFundFlow as at, type NorthboundDirection as au, type NorthboundMarket as av, type NorthboundRankPeriod as aw, type NorthboundMinuteItem as ax, type NorthboundFlowSummary as ay, type NorthboundHoldingRankItem as az, type SearchResult as b, type FundNavHistory as b0, type FundEstimate as b1, type FundRankPoint as b2, type FundRankHistory as b3, type FundHolding as b4, type FundBondHolding as b5, type FundAssetAllocation as b6, type FundPositionPoint as b7, type FundManager as b8, type FundPerformanceEvaluation as b9, type FundHolderStructure as ba, type FundScaleChange as bb, type FundBuySedemption as bc, type FundStageReturns as bd, type FundSameTypePeer as be, type FundSameType as bf, type ThemeFundSort as bg, type ThemeFundOrder as bh, type ThemeCategory as bi, type GetThemeListOptions as bj, type GetHotThemesOptions as bk, type ThemeFundRankSort as bl, type GetThemeFundsOptions as bm, type ThemeFund as bn, type ThemeFundListResult as bo, type HotThemesResult as bp, type ThemeFundItem as bq, type ThemeFundItemList as br, type IndividualChangesHistoryOptions as c, type GetAShareCodeListOptions as d, type GetUSCodeListOptions as e, type GetAllUSQuotesOptions as f, type MarketStatus as g, type SupportedMarket as h, type FundProfile as i, type MinuteKlineOptions as j, type HKKlineOptions as k, type HKMinuteKlineOptions as l, type USKlineOptions as m, type USMinuteKlineOptions as n, type IndustryBoardKlineOptions as o, type IndustryBoardMinuteKlineOptions as p, type ConceptBoardKlineOptions as q, type ConceptBoardMinuteKlineOptions as r, type FuturesKlineOptions as s, type GlobalFuturesSpotOptions as t, type GlobalFuturesKlineOptions as u, type FuturesInventoryOptions as v, type ComexInventoryOptions as w, type CFFEXOptionQuotesOptions as x, type FundFlowOptions as y, type FundFlowRankOptions as z };
@@ -1,45 +1,6 @@
1
1
  import { K as KlineWithIndicators, A as AnyHistoryKline } from './addIndicators-_V3HEi0q.cjs';
2
-
3
- /**
4
- * 指标信号层类型(v2 B1)
5
- */
6
- /** 信号类型 */
7
- type SignalType = 'ma_golden_cross' | 'ma_death_cross' | 'macd_golden_cross' | 'macd_death_cross' | 'kdj_golden_cross' | 'kdj_death_cross' | 'kdj_overbought' | 'kdj_oversold' | 'rsi_overbought' | 'rsi_oversold' | 'boll_break_upper' | 'boll_break_lower' | 'sar_reversal_up' | 'sar_reversal_down';
8
- /** 单条信号 */
9
- interface Signal {
10
- type: SignalType;
11
- /** 对应 K 线的 timestamp(恒非空:calcSignals 跳过 timestamp 为 null 的 K 线) */
12
- at: number;
13
- /** 对应 K 线在输入数组中的下标 */
14
- index: number;
15
- /** 附加信息(如金叉的快慢周期、超买超卖的指标值) */
16
- detail?: Record<string, number>;
17
- }
18
- /** 信号计算选项;只为传入的指标计算信号 */
19
- interface SignalOptions {
20
- /** MA 金叉/死叉:fast 上穿/下穿 slow */
21
- ma?: {
22
- fast: number;
23
- slow: number;
24
- };
25
- /** MACD 金叉/死叉:DIF 上穿/下穿 DEA */
26
- macd?: boolean;
27
- /** KDJ 金叉死叉 + 超买超卖(默认 80/20) */
28
- kdj?: {
29
- overbought?: number;
30
- oversold?: number;
31
- };
32
- /** RSI 超买超卖(默认 period=6,70/30) */
33
- rsi?: {
34
- period?: number;
35
- overbought?: number;
36
- oversold?: number;
37
- };
38
- /** BOLL 收盘突破上/下轨 */
39
- boll?: boolean;
40
- /** SAR 趋势反转 */
41
- sar?: boolean;
42
- }
2
+ import { S as SignalOptions, a as Signal } from './types-7n5rSHbd.cjs';
3
+ export { b as SignalType } from './types-7n5rSHbd.cjs';
43
4
 
44
5
  /**
45
6
  * 指标信号层(v2 B1)
@@ -57,4 +18,4 @@ type Kline = KlineWithIndicators<AnyHistoryKline>;
57
18
  */
58
19
  declare function calcSignals(klines: Kline[], options?: SignalOptions): Signal[];
59
20
 
60
- export { type Signal, type SignalOptions, type SignalType, calcSignals };
21
+ export { Signal, SignalOptions, calcSignals };
package/dist/signals.d.ts CHANGED
@@ -1,45 +1,6 @@
1
1
  import { K as KlineWithIndicators, A as AnyHistoryKline } from './addIndicators-_V3HEi0q.js';
2
-
3
- /**
4
- * 指标信号层类型(v2 B1)
5
- */
6
- /** 信号类型 */
7
- type SignalType = 'ma_golden_cross' | 'ma_death_cross' | 'macd_golden_cross' | 'macd_death_cross' | 'kdj_golden_cross' | 'kdj_death_cross' | 'kdj_overbought' | 'kdj_oversold' | 'rsi_overbought' | 'rsi_oversold' | 'boll_break_upper' | 'boll_break_lower' | 'sar_reversal_up' | 'sar_reversal_down';
8
- /** 单条信号 */
9
- interface Signal {
10
- type: SignalType;
11
- /** 对应 K 线的 timestamp(恒非空:calcSignals 跳过 timestamp 为 null 的 K 线) */
12
- at: number;
13
- /** 对应 K 线在输入数组中的下标 */
14
- index: number;
15
- /** 附加信息(如金叉的快慢周期、超买超卖的指标值) */
16
- detail?: Record<string, number>;
17
- }
18
- /** 信号计算选项;只为传入的指标计算信号 */
19
- interface SignalOptions {
20
- /** MA 金叉/死叉:fast 上穿/下穿 slow */
21
- ma?: {
22
- fast: number;
23
- slow: number;
24
- };
25
- /** MACD 金叉/死叉:DIF 上穿/下穿 DEA */
26
- macd?: boolean;
27
- /** KDJ 金叉死叉 + 超买超卖(默认 80/20) */
28
- kdj?: {
29
- overbought?: number;
30
- oversold?: number;
31
- };
32
- /** RSI 超买超卖(默认 period=6,70/30) */
33
- rsi?: {
34
- period?: number;
35
- overbought?: number;
36
- oversold?: number;
37
- };
38
- /** BOLL 收盘突破上/下轨 */
39
- boll?: boolean;
40
- /** SAR 趋势反转 */
41
- sar?: boolean;
42
- }
2
+ import { S as SignalOptions, a as Signal } from './types-7n5rSHbd.js';
3
+ export { b as SignalType } from './types-7n5rSHbd.js';
43
4
 
44
5
  /**
45
6
  * 指标信号层(v2 B1)
@@ -57,4 +18,4 @@ type Kline = KlineWithIndicators<AnyHistoryKline>;
57
18
  */
58
19
  declare function calcSignals(klines: Kline[], options?: SignalOptions): Signal[];
59
20
 
60
- export { type Signal, type SignalOptions, type SignalType, calcSignals };
21
+ export { Signal, SignalOptions, calcSignals };
package/dist/symbols.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkT5CH7H3Xcjs = require('./chunk-T5CH7H3X.cjs');require('./chunk-4Q7UQ5Q3.cjs');require('./chunk-4VDLQK6F.cjs');exports.EXCHANGE_TO_SECID_PREFIX = _chunkT5CH7H3Xcjs.g; exports.FUTURES_EXCHANGES = _chunkT5CH7H3Xcjs.b; exports.extractVariety = _chunkT5CH7H3Xcjs.c; exports.inferAShareExchange = _chunkT5CH7H3Xcjs.a; exports.marketOf = _chunkT5CH7H3Xcjs.f; exports.normalizeSymbol = _chunkT5CH7H3Xcjs.e; exports.toEastmoneySecid = _chunkT5CH7H3Xcjs.i; exports.toPlainCode = _chunkT5CH7H3Xcjs.j; exports.toTencentSymbol = _chunkT5CH7H3Xcjs.h;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkUSZUOBM2cjs = require('./chunk-USZUOBM2.cjs');require('./chunk-4Q7UQ5Q3.cjs');require('./chunk-4VDLQK6F.cjs');exports.EXCHANGE_TO_SECID_PREFIX = _chunkUSZUOBM2cjs.h; exports.FUTURES_EXCHANGES = _chunkUSZUOBM2cjs.b; exports.extractVariety = _chunkUSZUOBM2cjs.c; exports.inferAShareExchange = _chunkUSZUOBM2cjs.a; exports.marketOf = _chunkUSZUOBM2cjs.g; exports.normalizeSymbol = _chunkUSZUOBM2cjs.f; exports.toEastmoneySecid = _chunkUSZUOBM2cjs.j; exports.toPlainCode = _chunkUSZUOBM2cjs.k; exports.toTencentSymbol = _chunkUSZUOBM2cjs.i; exports.tryToTencentSymbols = _chunkUSZUOBM2cjs.l;
@@ -1,5 +1,5 @@
1
- import { E as Exchange, M as Market } from './adapters-BiH4keVd.cjs';
2
- export { A as AssetType, d as EXCHANGE_TO_SECID_PREFIX, N as NormalizedSymbol, a as SymbolInput, S as SymbolRef, m as marketOf, n as normalizeSymbol, b as toEastmoneySecid, c as toPlainCode, t as toTencentSymbol } from './adapters-BiH4keVd.cjs';
1
+ import { E as Exchange, M as Market } from './adapters-CZUNRbxi.cjs';
2
+ export { A as AssetType, e as EXCHANGE_TO_SECID_PREFIX, N as NormalizedSymbol, a as SymbolInput, S as SymbolRef, T as TencentSymbolBatch, m as marketOf, n as normalizeSymbol, b as toEastmoneySecid, c as toPlainCode, t as toTencentSymbol, d as tryToTencentSymbols } from './adapters-CZUNRbxi.cjs';
3
3
 
4
4
  /**
5
5
  * 纯代码的市场 / 交易所推断(收编原 core/utils.ts 的 getMarketCode 语义)
package/dist/symbols.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { E as Exchange, M as Market } from './adapters-BiH4keVd.js';
2
- export { A as AssetType, d as EXCHANGE_TO_SECID_PREFIX, N as NormalizedSymbol, a as SymbolInput, S as SymbolRef, m as marketOf, n as normalizeSymbol, b as toEastmoneySecid, c as toPlainCode, t as toTencentSymbol } from './adapters-BiH4keVd.js';
1
+ import { E as Exchange, M as Market } from './adapters-CZUNRbxi.js';
2
+ export { A as AssetType, e as EXCHANGE_TO_SECID_PREFIX, N as NormalizedSymbol, a as SymbolInput, S as SymbolRef, T as TencentSymbolBatch, m as marketOf, n as normalizeSymbol, b as toEastmoneySecid, c as toPlainCode, t as toTencentSymbol, d as tryToTencentSymbols } from './adapters-CZUNRbxi.js';
3
3
 
4
4
  /**
5
5
  * 纯代码的市场 / 交易所推断(收编原 core/utils.ts 的 getMarketCode 语义)
package/dist/symbols.js CHANGED
@@ -1 +1 @@
1
- import{a,b,c,e as d,f as e,g as f,h as g,i as h,j as i}from"./chunk-ZZ2IBUMV.js";import"./chunk-UBIQBXQ7.js";import"./chunk-WOT6VMZA.js";export{f as EXCHANGE_TO_SECID_PREFIX,b as FUTURES_EXCHANGES,c as extractVariety,a as inferAShareExchange,e as marketOf,d as normalizeSymbol,h as toEastmoneySecid,i as toPlainCode,g as toTencentSymbol};
1
+ import{a,b,c,f as d,g as e,h as f,i as g,j as h,k as i,l as j}from"./chunk-4RN7AVFQ.js";import"./chunk-UBIQBXQ7.js";import"./chunk-WOT6VMZA.js";export{f as EXCHANGE_TO_SECID_PREFIX,b as FUTURES_EXCHANGES,c as extractVariety,a as inferAShareExchange,e as marketOf,d as normalizeSymbol,h as toEastmoneySecid,i as toPlainCode,g as toTencentSymbol,j as tryToTencentSymbols};
@@ -0,0 +1,42 @@
1
+ /**
2
+ * 指标信号层类型(v2 B1)
3
+ */
4
+ /** 信号类型 */
5
+ type SignalType = 'ma_golden_cross' | 'ma_death_cross' | 'macd_golden_cross' | 'macd_death_cross' | 'kdj_golden_cross' | 'kdj_death_cross' | 'kdj_overbought' | 'kdj_oversold' | 'rsi_overbought' | 'rsi_oversold' | 'boll_break_upper' | 'boll_break_lower' | 'sar_reversal_up' | 'sar_reversal_down';
6
+ /** 单条信号 */
7
+ interface Signal {
8
+ type: SignalType;
9
+ /** 对应 K 线的 timestamp(恒非空:calcSignals 跳过 timestamp 为 null 的 K 线) */
10
+ at: number;
11
+ /** 对应 K 线在输入数组中的下标 */
12
+ index: number;
13
+ /** 附加信息(如金叉的快慢周期、超买超卖的指标值) */
14
+ detail?: Record<string, number>;
15
+ }
16
+ /** 信号计算选项;只为传入的指标计算信号 */
17
+ interface SignalOptions {
18
+ /** MA 金叉/死叉:fast 上穿/下穿 slow */
19
+ ma?: {
20
+ fast: number;
21
+ slow: number;
22
+ };
23
+ /** MACD 金叉/死叉:DIF 上穿/下穿 DEA */
24
+ macd?: boolean;
25
+ /** KDJ 金叉死叉 + 超买超卖(默认 80/20) */
26
+ kdj?: {
27
+ overbought?: number;
28
+ oversold?: number;
29
+ };
30
+ /** RSI 超买超卖(默认 period=6,70/30) */
31
+ rsi?: {
32
+ period?: number;
33
+ overbought?: number;
34
+ oversold?: number;
35
+ };
36
+ /** BOLL 收盘突破上/下轨 */
37
+ boll?: boolean;
38
+ /** SAR 趋势反转 */
39
+ sar?: boolean;
40
+ }
41
+
42
+ export type { SignalOptions as S, Signal as a, SignalType as b };
@@ -0,0 +1,42 @@
1
+ /**
2
+ * 指标信号层类型(v2 B1)
3
+ */
4
+ /** 信号类型 */
5
+ type SignalType = 'ma_golden_cross' | 'ma_death_cross' | 'macd_golden_cross' | 'macd_death_cross' | 'kdj_golden_cross' | 'kdj_death_cross' | 'kdj_overbought' | 'kdj_oversold' | 'rsi_overbought' | 'rsi_oversold' | 'boll_break_upper' | 'boll_break_lower' | 'sar_reversal_up' | 'sar_reversal_down';
6
+ /** 单条信号 */
7
+ interface Signal {
8
+ type: SignalType;
9
+ /** 对应 K 线的 timestamp(恒非空:calcSignals 跳过 timestamp 为 null 的 K 线) */
10
+ at: number;
11
+ /** 对应 K 线在输入数组中的下标 */
12
+ index: number;
13
+ /** 附加信息(如金叉的快慢周期、超买超卖的指标值) */
14
+ detail?: Record<string, number>;
15
+ }
16
+ /** 信号计算选项;只为传入的指标计算信号 */
17
+ interface SignalOptions {
18
+ /** MA 金叉/死叉:fast 上穿/下穿 slow */
19
+ ma?: {
20
+ fast: number;
21
+ slow: number;
22
+ };
23
+ /** MACD 金叉/死叉:DIF 上穿/下穿 DEA */
24
+ macd?: boolean;
25
+ /** KDJ 金叉死叉 + 超买超卖(默认 80/20) */
26
+ kdj?: {
27
+ overbought?: number;
28
+ oversold?: number;
29
+ };
30
+ /** RSI 超买超卖(默认 period=6,70/30) */
31
+ rsi?: {
32
+ period?: number;
33
+ overbought?: number;
34
+ oversold?: number;
35
+ };
36
+ /** BOLL 收盘突破上/下轨 */
37
+ boll?: boolean;
38
+ /** SAR 趋势反转 */
39
+ sar?: boolean;
40
+ }
41
+
42
+ export type { SignalOptions as S, Signal as a, SignalType as b };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stock-sdk",
3
- "version": "2.2.2",
3
+ "version": "2.4.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
@@ -23,6 +23,7 @@
23
23
  "build:docs": "pnpm docs:meta && DOCS_BASE=/ vitepress build website",
24
24
  "build:pages": "pnpm docs:meta && DOCS_BASE=/stock-sdk/ vitepress build website",
25
25
  "gen:llms": "tsx ./scripts/generate-llms.ts",
26
+ "gen:indicator-baseline": "tsx ./scripts/gen-indicator-baseline.ts",
26
27
  "prepare": "node ./scripts/install-git-hooks.js"
27
28
  },
28
29
  "exports": {