stock-sdk 1.8.2 → 1.9.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 +93 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1303 -616
- package/dist/index.d.ts +1303 -616
- package/dist/index.js +1 -1
- package/package.json +8 -4
package/dist/index.d.cts
CHANGED
|
@@ -12,46 +12,10 @@ interface RateLimiterOptions {
|
|
|
12
12
|
maxBurst?: number;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
/**
|
|
16
|
-
* 熔断器 - 防止雪崩效应
|
|
17
|
-
*
|
|
18
|
-
* 状态机:
|
|
19
|
-
* - CLOSED: 正常状态,允许所有请求
|
|
20
|
-
* - OPEN: 熔断状态,拒绝所有请求
|
|
21
|
-
* - HALF_OPEN: 半开状态,允许少量请求探测
|
|
22
|
-
*/
|
|
23
|
-
/**
|
|
24
|
-
* 熔断器状态
|
|
25
|
-
*/
|
|
26
|
-
type CircuitState = 'CLOSED' | 'OPEN' | 'HALF_OPEN';
|
|
27
|
-
/**
|
|
28
|
-
* 熔断器配置
|
|
29
|
-
*/
|
|
30
|
-
interface CircuitBreakerOptions {
|
|
31
|
-
/** 触发熔断的失败次数阈值,默认 5 */
|
|
32
|
-
failureThreshold?: number;
|
|
33
|
-
/** 熔断持续时间(毫秒),默认 30000 (30秒) */
|
|
34
|
-
resetTimeout?: number;
|
|
35
|
-
/** 半开状态允许的探测请求数,默认 1 */
|
|
36
|
-
halfOpenRequests?: number;
|
|
37
|
-
/** 状态变化回调 */
|
|
38
|
-
onStateChange?: (from: CircuitState, to: CircuitState) => void;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
15
|
/**
|
|
42
16
|
* 已知的数据源名称
|
|
43
17
|
*/
|
|
44
18
|
type ProviderName = 'tencent' | 'eastmoney' | 'sina' | 'linkdiary' | 'unknown';
|
|
45
|
-
/**
|
|
46
|
-
* HTTP 错误类
|
|
47
|
-
*/
|
|
48
|
-
declare class HttpError extends Error {
|
|
49
|
-
readonly status: number;
|
|
50
|
-
readonly statusText: string;
|
|
51
|
-
readonly url?: string | undefined;
|
|
52
|
-
readonly provider?: string | undefined;
|
|
53
|
-
constructor(status: number, statusText: string, url?: string | undefined, provider?: string | undefined);
|
|
54
|
-
}
|
|
55
19
|
/**
|
|
56
20
|
* 重试配置选项
|
|
57
21
|
*/
|
|
@@ -92,6 +56,89 @@ interface ProviderRequestPolicy {
|
|
|
92
56
|
/** 熔断器配置(连续失败时暂停请求) */
|
|
93
57
|
circuitBreaker?: CircuitBreakerOptions;
|
|
94
58
|
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* SDK 统一错误码
|
|
62
|
+
*/
|
|
63
|
+
type SdkErrorCode = 'NETWORK_ERROR' | 'TIMEOUT' | 'HTTP_ERROR' | 'RATE_LIMITED' | 'CIRCUIT_OPEN' | 'UPSTREAM_EMPTY' | 'INVALID_SYMBOL' | 'INVALID_ARGUMENT' | 'NOT_FOUND';
|
|
64
|
+
/**
|
|
65
|
+
* SDK 错误构造参数
|
|
66
|
+
*/
|
|
67
|
+
interface SdkErrorOptions {
|
|
68
|
+
code: SdkErrorCode;
|
|
69
|
+
message: string;
|
|
70
|
+
provider?: ProviderName;
|
|
71
|
+
url?: string;
|
|
72
|
+
status?: number;
|
|
73
|
+
details?: Record<string, unknown>;
|
|
74
|
+
cause?: unknown;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* SDK 标准错误
|
|
78
|
+
*/
|
|
79
|
+
declare class SdkError extends Error {
|
|
80
|
+
readonly code: SdkErrorCode;
|
|
81
|
+
readonly provider?: ProviderName;
|
|
82
|
+
readonly url?: string;
|
|
83
|
+
readonly status?: number;
|
|
84
|
+
readonly details?: Record<string, unknown>;
|
|
85
|
+
constructor(options: SdkErrorOptions);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* HTTP 错误类
|
|
89
|
+
*/
|
|
90
|
+
declare class HttpError extends SdkError {
|
|
91
|
+
readonly status: number;
|
|
92
|
+
readonly statusText: string;
|
|
93
|
+
constructor(status: number, statusText: string, url?: string, provider?: ProviderName);
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* 标准化后的请求错误元数据。
|
|
97
|
+
* 为保持兼容,网络类错误会尽量复用原始 Error 实例,并附加这些字段。
|
|
98
|
+
*/
|
|
99
|
+
interface RequestErrorMetadata {
|
|
100
|
+
sdkCode?: SdkErrorCode;
|
|
101
|
+
provider?: ProviderName;
|
|
102
|
+
url?: string;
|
|
103
|
+
status?: number;
|
|
104
|
+
details?: Record<string, unknown>;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* 带标准化元数据的请求错误。
|
|
108
|
+
*/
|
|
109
|
+
type RequestError = Error & RequestErrorMetadata;
|
|
110
|
+
/**
|
|
111
|
+
* 读取错误上的 SDK 标准错误码。
|
|
112
|
+
*/
|
|
113
|
+
declare function getSdkErrorCode(error: unknown): SdkErrorCode | undefined;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* 熔断器 - 防止雪崩效应
|
|
117
|
+
*
|
|
118
|
+
* 状态机:
|
|
119
|
+
* - CLOSED: 正常状态,允许所有请求
|
|
120
|
+
* - OPEN: 熔断状态,拒绝所有请求
|
|
121
|
+
* - HALF_OPEN: 半开状态,允许少量请求探测
|
|
122
|
+
*/
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* 熔断器状态
|
|
126
|
+
*/
|
|
127
|
+
type CircuitState = 'CLOSED' | 'OPEN' | 'HALF_OPEN';
|
|
128
|
+
/**
|
|
129
|
+
* 熔断器配置
|
|
130
|
+
*/
|
|
131
|
+
interface CircuitBreakerOptions {
|
|
132
|
+
/** 触发熔断的失败次数阈值,默认 5 */
|
|
133
|
+
failureThreshold?: number;
|
|
134
|
+
/** 熔断持续时间(毫秒),默认 30000 (30秒) */
|
|
135
|
+
resetTimeout?: number;
|
|
136
|
+
/** 半开状态允许的探测请求数,默认 1 */
|
|
137
|
+
halfOpenRequests?: number;
|
|
138
|
+
/** 状态变化回调 */
|
|
139
|
+
onStateChange?: (from: CircuitState, to: CircuitState) => void;
|
|
140
|
+
}
|
|
141
|
+
|
|
95
142
|
/**
|
|
96
143
|
* 请求客户端配置选项
|
|
97
144
|
*/
|
|
@@ -412,6 +459,7 @@ interface FundQuote {
|
|
|
412
459
|
navDate: string;
|
|
413
460
|
raw: string[];
|
|
414
461
|
}
|
|
462
|
+
|
|
415
463
|
/**
|
|
416
464
|
* A 股历史 K 线(日/周/月)
|
|
417
465
|
*/
|
|
@@ -463,7 +511,7 @@ interface MinuteTimeline {
|
|
|
463
511
|
avgPrice: number | null;
|
|
464
512
|
}
|
|
465
513
|
/**
|
|
466
|
-
* A 股分钟 K 线(5/15/30/60
|
|
514
|
+
* A 股分钟 K 线(5/15/30/60)
|
|
467
515
|
*/
|
|
468
516
|
interface MinuteKline {
|
|
469
517
|
/** 时间 YYYY-MM-DD HH:mm */
|
|
@@ -476,47 +524,53 @@ interface MinuteKline {
|
|
|
476
524
|
high: number | null;
|
|
477
525
|
/** 最低价 */
|
|
478
526
|
low: number | null;
|
|
479
|
-
/** 涨跌幅% */
|
|
480
|
-
changePercent: number | null;
|
|
481
|
-
/** 涨跌额 */
|
|
482
|
-
change: number | null;
|
|
483
527
|
/** 成交量 */
|
|
484
528
|
volume: number | null;
|
|
485
529
|
/** 成交额 */
|
|
486
530
|
amount: number | null;
|
|
487
531
|
/** 振幅% */
|
|
488
532
|
amplitude: number | null;
|
|
533
|
+
/** 涨跌幅% */
|
|
534
|
+
changePercent: number | null;
|
|
535
|
+
/** 涨跌额 */
|
|
536
|
+
change: number | null;
|
|
489
537
|
/** 换手率% */
|
|
490
538
|
turnoverRate: number | null;
|
|
491
539
|
}
|
|
492
540
|
/**
|
|
493
|
-
*
|
|
541
|
+
* 当日分时项
|
|
494
542
|
*/
|
|
495
543
|
interface TodayTimeline {
|
|
496
544
|
/** 时间 HH:mm */
|
|
497
545
|
time: string;
|
|
498
|
-
/**
|
|
546
|
+
/** 当前价 */
|
|
499
547
|
price: number;
|
|
500
|
-
/**
|
|
548
|
+
/** 均价 */
|
|
549
|
+
avgPrice: number;
|
|
550
|
+
/** 累计成交量(股) */
|
|
501
551
|
volume: number;
|
|
502
|
-
/**
|
|
552
|
+
/** 累计成交额(元) */
|
|
503
553
|
amount: number;
|
|
504
|
-
/** 当日均价(累计成交额 / 累计成交量 × 100) */
|
|
505
|
-
avgPrice: number;
|
|
506
554
|
}
|
|
507
555
|
/**
|
|
508
|
-
*
|
|
556
|
+
* 当日分时响应
|
|
509
557
|
*/
|
|
510
558
|
interface TodayTimelineResponse {
|
|
511
559
|
/** 股票代码 */
|
|
512
560
|
code: string;
|
|
513
|
-
/** 交易日期
|
|
561
|
+
/** 交易日期 YYYY-MM-DD */
|
|
514
562
|
date: string;
|
|
515
|
-
/**
|
|
563
|
+
/**
|
|
564
|
+
* 昨收价
|
|
565
|
+
* - 由 SDK 解析腾讯接口的 `quoteFields[4]` 得到
|
|
566
|
+
* - 上游异常或接口未返回时可能为 `0` 或 `undefined`
|
|
567
|
+
*/
|
|
568
|
+
preClose?: number;
|
|
569
|
+
/** 当日分时序列 */
|
|
516
570
|
data: TodayTimeline[];
|
|
517
571
|
}
|
|
518
572
|
/**
|
|
519
|
-
*
|
|
573
|
+
* 港股 / 美股历史 K 线
|
|
520
574
|
*/
|
|
521
575
|
interface HKUSHistoryKline {
|
|
522
576
|
/** 日期 YYYY-MM-DD */
|
|
@@ -546,15 +600,16 @@ interface HKUSHistoryKline {
|
|
|
546
600
|
/** 换手率% */
|
|
547
601
|
turnoverRate: number | null;
|
|
548
602
|
}
|
|
603
|
+
|
|
549
604
|
/**
|
|
550
|
-
*
|
|
605
|
+
* 行业板块列表项
|
|
551
606
|
*/
|
|
552
607
|
interface IndustryBoard {
|
|
553
608
|
/** 排名 */
|
|
554
609
|
rank: number;
|
|
555
610
|
/** 板块名称 */
|
|
556
611
|
name: string;
|
|
557
|
-
/**
|
|
612
|
+
/** 板块代码,如 BK1027 */
|
|
558
613
|
code: string;
|
|
559
614
|
/** 最新价 */
|
|
560
615
|
price: number | null;
|
|
@@ -570,25 +625,23 @@ interface IndustryBoard {
|
|
|
570
625
|
riseCount: number | null;
|
|
571
626
|
/** 下跌家数 */
|
|
572
627
|
fallCount: number | null;
|
|
573
|
-
/**
|
|
628
|
+
/** 领涨股名称 */
|
|
574
629
|
leadingStock: string | null;
|
|
575
|
-
/**
|
|
630
|
+
/** 领涨股涨跌幅% */
|
|
576
631
|
leadingStockChangePercent: number | null;
|
|
577
632
|
}
|
|
578
633
|
/**
|
|
579
|
-
*
|
|
634
|
+
* 行业板块实时行情指标
|
|
580
635
|
*/
|
|
581
636
|
interface IndustryBoardSpot {
|
|
582
|
-
/** 指标名称 */
|
|
583
637
|
item: string;
|
|
584
|
-
/** 指标值 */
|
|
585
638
|
value: number | null;
|
|
586
639
|
}
|
|
587
640
|
/**
|
|
588
641
|
* 行业板块成分股
|
|
589
642
|
*/
|
|
590
643
|
interface IndustryBoardConstituent {
|
|
591
|
-
/**
|
|
644
|
+
/** 排名 */
|
|
592
645
|
rank: number;
|
|
593
646
|
/** 股票代码 */
|
|
594
647
|
code: string;
|
|
@@ -610,13 +663,13 @@ interface IndustryBoardConstituent {
|
|
|
610
663
|
high: number | null;
|
|
611
664
|
/** 最低价 */
|
|
612
665
|
low: number | null;
|
|
613
|
-
/**
|
|
666
|
+
/** 开盘价 */
|
|
614
667
|
open: number | null;
|
|
615
668
|
/** 昨收 */
|
|
616
669
|
prevClose: number | null;
|
|
617
670
|
/** 换手率% */
|
|
618
671
|
turnoverRate: number | null;
|
|
619
|
-
/**
|
|
672
|
+
/** 市盈率 */
|
|
620
673
|
pe: number | null;
|
|
621
674
|
/** 市净率 */
|
|
622
675
|
pb: number | null;
|
|
@@ -625,447 +678,983 @@ interface IndustryBoardConstituent {
|
|
|
625
678
|
* 行业板块历史 K 线
|
|
626
679
|
*/
|
|
627
680
|
interface IndustryBoardKline {
|
|
628
|
-
/** 日期 */
|
|
629
681
|
date: string;
|
|
630
|
-
/** 开盘价 */
|
|
631
682
|
open: number | null;
|
|
632
|
-
/** 收盘价 */
|
|
633
683
|
close: number | null;
|
|
634
|
-
/** 最高价 */
|
|
635
684
|
high: number | null;
|
|
636
|
-
/** 最低价 */
|
|
637
685
|
low: number | null;
|
|
638
|
-
/** 涨跌幅% */
|
|
639
|
-
changePercent: number | null;
|
|
640
|
-
/** 涨跌额 */
|
|
641
|
-
change: number | null;
|
|
642
|
-
/** 成交量 */
|
|
643
686
|
volume: number | null;
|
|
644
|
-
/** 成交额 */
|
|
645
687
|
amount: number | null;
|
|
646
|
-
/** 振幅% */
|
|
647
688
|
amplitude: number | null;
|
|
648
|
-
|
|
689
|
+
changePercent: number | null;
|
|
690
|
+
change: number | null;
|
|
649
691
|
turnoverRate: number | null;
|
|
650
692
|
}
|
|
651
693
|
/**
|
|
652
|
-
* 行业板块 1
|
|
694
|
+
* 行业板块 1 分钟分时
|
|
653
695
|
*/
|
|
654
696
|
interface IndustryBoardMinuteTimeline {
|
|
655
|
-
/** 日期时间 */
|
|
656
697
|
time: string;
|
|
657
|
-
/** 开盘价 */
|
|
658
698
|
open: number | null;
|
|
659
|
-
/** 收盘价 */
|
|
660
699
|
close: number | null;
|
|
661
|
-
/** 最高价 */
|
|
662
700
|
high: number | null;
|
|
663
|
-
/** 最低价 */
|
|
664
701
|
low: number | null;
|
|
665
|
-
/** 成交量 */
|
|
666
702
|
volume: number | null;
|
|
667
|
-
/** 成交额 */
|
|
668
703
|
amount: number | null;
|
|
669
704
|
/** 最新价 */
|
|
670
705
|
price: number | null;
|
|
706
|
+
/**
|
|
707
|
+
* @deprecated 旧类型字段,请改用 `price`
|
|
708
|
+
*/
|
|
709
|
+
avgPrice: number | null;
|
|
671
710
|
}
|
|
672
711
|
/**
|
|
673
|
-
* 行业板块分钟 K
|
|
712
|
+
* 行业板块分钟 K 线(5/15/30/60)
|
|
674
713
|
*/
|
|
675
714
|
interface IndustryBoardMinuteKline {
|
|
676
|
-
/** 日期时间 */
|
|
677
715
|
time: string;
|
|
678
|
-
/** 开盘价 */
|
|
679
716
|
open: number | null;
|
|
680
|
-
/** 收盘价 */
|
|
681
717
|
close: number | null;
|
|
682
|
-
/** 最高价 */
|
|
683
718
|
high: number | null;
|
|
684
|
-
/** 最低价 */
|
|
685
719
|
low: number | null;
|
|
686
|
-
/** 涨跌幅% */
|
|
687
|
-
changePercent: number | null;
|
|
688
|
-
/** 涨跌额 */
|
|
689
|
-
change: number | null;
|
|
690
|
-
/** 成交量 */
|
|
691
720
|
volume: number | null;
|
|
692
|
-
/** 成交额 */
|
|
693
721
|
amount: number | null;
|
|
694
|
-
/** 振幅% */
|
|
695
722
|
amplitude: number | null;
|
|
696
|
-
|
|
723
|
+
changePercent: number | null;
|
|
724
|
+
change: number | null;
|
|
697
725
|
turnoverRate: number | null;
|
|
698
726
|
}
|
|
699
727
|
/**
|
|
700
|
-
*
|
|
728
|
+
* 概念板块类型复用行业板块结构
|
|
701
729
|
*/
|
|
702
730
|
type ConceptBoard = IndustryBoard;
|
|
703
|
-
/**
|
|
704
|
-
* 概念板块实时行情(结构同行业板块)
|
|
705
|
-
*/
|
|
706
731
|
type ConceptBoardSpot = IndustryBoardSpot;
|
|
707
|
-
/**
|
|
708
|
-
* 概念板块成分股(结构同行业板块)
|
|
709
|
-
*/
|
|
710
732
|
type ConceptBoardConstituent = IndustryBoardConstituent;
|
|
711
|
-
/**
|
|
712
|
-
* 概念板块历史 K 线(结构同行业板块)
|
|
713
|
-
*/
|
|
714
733
|
type ConceptBoardKline = IndustryBoardKline;
|
|
715
|
-
/**
|
|
716
|
-
* 概念板块 1 分钟分时数据(结构同行业板块)
|
|
717
|
-
*/
|
|
718
734
|
type ConceptBoardMinuteTimeline = IndustryBoardMinuteTimeline;
|
|
719
|
-
/**
|
|
720
|
-
* 概念板块分钟 K 线(结构同行业板块)
|
|
721
|
-
*/
|
|
722
735
|
type ConceptBoardMinuteKline = IndustryBoardMinuteKline;
|
|
736
|
+
|
|
723
737
|
/**
|
|
724
738
|
* 国内期货交易所
|
|
725
739
|
*/
|
|
726
740
|
type FuturesExchange = 'SHFE' | 'DCE' | 'CZCE' | 'INE' | 'CFFEX' | 'GFEX';
|
|
727
741
|
/**
|
|
728
|
-
*
|
|
742
|
+
* 期货 K 线
|
|
729
743
|
*/
|
|
730
744
|
interface FuturesKline {
|
|
731
|
-
/** 日期 YYYY-MM-DD */
|
|
732
745
|
date: string;
|
|
733
|
-
/** 合约代码 */
|
|
734
746
|
code: string;
|
|
735
|
-
/** 合约名称 */
|
|
736
747
|
name: string;
|
|
737
|
-
/** 开盘价 */
|
|
738
748
|
open: number | null;
|
|
739
|
-
/** 收盘价 */
|
|
740
749
|
close: number | null;
|
|
741
|
-
/** 最高价 */
|
|
742
750
|
high: number | null;
|
|
743
|
-
/** 最低价 */
|
|
744
751
|
low: number | null;
|
|
745
|
-
/** 成交量 */
|
|
746
752
|
volume: number | null;
|
|
747
|
-
/** 成交额 */
|
|
748
753
|
amount: number | null;
|
|
749
|
-
/** 振幅% */
|
|
750
754
|
amplitude: number | null;
|
|
751
|
-
/** 涨跌幅% */
|
|
752
755
|
changePercent: number | null;
|
|
753
|
-
/** 涨跌额 */
|
|
754
756
|
change: number | null;
|
|
755
|
-
/** 换手率% */
|
|
756
757
|
turnoverRate: number | null;
|
|
757
|
-
/** 持仓量(期货特有) */
|
|
758
758
|
openInterest: number | null;
|
|
759
759
|
}
|
|
760
760
|
/**
|
|
761
|
-
*
|
|
761
|
+
* 全球期货实时报价
|
|
762
762
|
*/
|
|
763
763
|
interface GlobalFuturesQuote {
|
|
764
|
-
/** 合约代码,如 HG00Y */
|
|
765
764
|
code: string;
|
|
766
|
-
/** 名称,如 COMEX铜 */
|
|
767
765
|
name: string;
|
|
768
|
-
/** 最新价 */
|
|
769
766
|
price: number | null;
|
|
770
|
-
/** 涨跌额 */
|
|
771
767
|
change: number | null;
|
|
772
|
-
/** 涨跌幅% */
|
|
773
768
|
changePercent: number | null;
|
|
774
|
-
/** 今开 */
|
|
775
769
|
open: number | null;
|
|
776
|
-
/** 最高 */
|
|
777
770
|
high: number | null;
|
|
778
|
-
/** 最低 */
|
|
779
771
|
low: number | null;
|
|
780
|
-
/** 昨结算价 */
|
|
781
772
|
prevSettle: number | null;
|
|
782
|
-
/** 成交量 */
|
|
783
773
|
volume: number | null;
|
|
784
|
-
/** 买盘量 */
|
|
785
774
|
buyVolume: number | null;
|
|
786
|
-
/** 卖盘量 */
|
|
787
775
|
sellVolume: number | null;
|
|
788
|
-
/** 持仓量 */
|
|
789
776
|
openInterest: number | null;
|
|
790
777
|
}
|
|
791
778
|
/**
|
|
792
|
-
*
|
|
779
|
+
* 期货库存品种
|
|
793
780
|
*/
|
|
794
781
|
interface FuturesInventorySymbol {
|
|
795
|
-
/** 品种代码 */
|
|
796
782
|
code: string;
|
|
797
|
-
/** 品种名称 */
|
|
798
783
|
name: string;
|
|
799
|
-
/** 市场代码 */
|
|
800
784
|
marketCode: string;
|
|
801
785
|
}
|
|
802
786
|
/**
|
|
803
787
|
* 期货库存数据
|
|
804
788
|
*/
|
|
805
789
|
interface FuturesInventory {
|
|
806
|
-
/** 品种代码,如 RB */
|
|
807
790
|
code: string;
|
|
808
|
-
/** 日期 */
|
|
809
791
|
date: string;
|
|
810
|
-
/** 库存量 */
|
|
811
792
|
inventory: number | null;
|
|
812
|
-
/** 增减 */
|
|
813
793
|
change: number | null;
|
|
814
794
|
}
|
|
815
795
|
/**
|
|
816
|
-
* COMEX
|
|
796
|
+
* COMEX 库存数据
|
|
817
797
|
*/
|
|
818
798
|
interface ComexInventory {
|
|
819
|
-
/** 日期 */
|
|
820
799
|
date: string;
|
|
821
|
-
/** 品种(黄金/白银) */
|
|
822
800
|
name: string;
|
|
823
|
-
/** 库存量(吨) */
|
|
824
801
|
storageTon: number | null;
|
|
825
|
-
/** 库存量(盎司) */
|
|
826
802
|
storageOunce: number | null;
|
|
803
|
+
/**
|
|
804
|
+
* @deprecated 请改用 `storageTon`
|
|
805
|
+
*/
|
|
806
|
+
inventory: number | null;
|
|
807
|
+
/**
|
|
808
|
+
* @deprecated COMEX 接口当前未提供稳定的变动字段,始终返回 `null`
|
|
809
|
+
*/
|
|
810
|
+
change: number | null;
|
|
811
|
+
/**
|
|
812
|
+
* @deprecated 请改用 `name`
|
|
813
|
+
*/
|
|
814
|
+
market: 'gold' | 'silver';
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
/**
|
|
818
|
+
* 中金所股指期权产品
|
|
819
|
+
*/
|
|
820
|
+
type IndexOptionProduct = 'ho' | 'io' | 'mo';
|
|
821
|
+
/**
|
|
822
|
+
* 期权 T 型报价项
|
|
823
|
+
*/
|
|
824
|
+
interface OptionTQuote {
|
|
825
|
+
symbol: string;
|
|
826
|
+
buyVolume: number | null;
|
|
827
|
+
buyPrice: number | null;
|
|
828
|
+
price: number | null;
|
|
829
|
+
askPrice: number | null;
|
|
830
|
+
askVolume: number | null;
|
|
831
|
+
openInterest: number | null;
|
|
832
|
+
change: number | null;
|
|
833
|
+
strikePrice: number | null;
|
|
827
834
|
}
|
|
828
835
|
/**
|
|
829
|
-
*
|
|
836
|
+
* 期权 T 型报价结果
|
|
837
|
+
*/
|
|
838
|
+
interface OptionTQuoteResult {
|
|
839
|
+
calls: OptionTQuote[];
|
|
840
|
+
puts: OptionTQuote[];
|
|
841
|
+
}
|
|
842
|
+
/**
|
|
843
|
+
* 期权日 K 线
|
|
844
|
+
*/
|
|
845
|
+
interface OptionKline {
|
|
846
|
+
date: string;
|
|
847
|
+
open: number | null;
|
|
848
|
+
high: number | null;
|
|
849
|
+
low: number | null;
|
|
850
|
+
close: number | null;
|
|
851
|
+
volume: number | null;
|
|
852
|
+
}
|
|
853
|
+
/**
|
|
854
|
+
* 期权分钟数据
|
|
855
|
+
*/
|
|
856
|
+
interface OptionMinute {
|
|
857
|
+
time: string;
|
|
858
|
+
date: string;
|
|
859
|
+
price: number | null;
|
|
860
|
+
volume: number | null;
|
|
861
|
+
openInterest: number | null;
|
|
862
|
+
avgPrice: number | null;
|
|
863
|
+
}
|
|
864
|
+
/**
|
|
865
|
+
* ETF 期权月份信息
|
|
866
|
+
*/
|
|
867
|
+
interface ETFOptionMonth {
|
|
868
|
+
months: string[];
|
|
869
|
+
stockId: string;
|
|
870
|
+
cateId: string;
|
|
871
|
+
cateList: string[];
|
|
872
|
+
}
|
|
873
|
+
/**
|
|
874
|
+
* ETF 期权到期信息
|
|
875
|
+
*/
|
|
876
|
+
interface ETFOptionExpireDay {
|
|
877
|
+
expireDay: string;
|
|
878
|
+
remainderDays: number;
|
|
879
|
+
stockId: string;
|
|
880
|
+
name: string;
|
|
881
|
+
}
|
|
882
|
+
/**
|
|
883
|
+
* ETF 期权品种
|
|
884
|
+
*/
|
|
885
|
+
type ETFOptionCate = '50ETF' | '300ETF' | '500ETF' | '科创50' | '科创板50';
|
|
886
|
+
/**
|
|
887
|
+
* 中金所期权实时行情
|
|
888
|
+
*/
|
|
889
|
+
interface CFFEXOptionQuote {
|
|
890
|
+
code: string;
|
|
891
|
+
name: string;
|
|
892
|
+
price: number | null;
|
|
893
|
+
change: number | null;
|
|
894
|
+
changePercent: number | null;
|
|
895
|
+
volume: number | null;
|
|
896
|
+
amount: number | null;
|
|
897
|
+
openInterest: number | null;
|
|
898
|
+
strikePrice: number | null;
|
|
899
|
+
remainDays: number | null;
|
|
900
|
+
dailyChange: number | null;
|
|
901
|
+
prevSettle: number | null;
|
|
902
|
+
open: number | null;
|
|
903
|
+
}
|
|
904
|
+
/**
|
|
905
|
+
* 期权龙虎榜项
|
|
906
|
+
*/
|
|
907
|
+
interface OptionLHBItem {
|
|
908
|
+
tradeType: string;
|
|
909
|
+
date: string;
|
|
910
|
+
symbol: string;
|
|
911
|
+
targetName: string;
|
|
912
|
+
rank: number;
|
|
913
|
+
memberName: string;
|
|
914
|
+
sellVolume: number | null;
|
|
915
|
+
sellVolumeChange: number | null;
|
|
916
|
+
netSellVolume: number | null;
|
|
917
|
+
sellVolumeRatio: number | null;
|
|
918
|
+
buyVolume: number | null;
|
|
919
|
+
buyVolumeChange: number | null;
|
|
920
|
+
netBuyVolume: number | null;
|
|
921
|
+
buyVolumeRatio: number | null;
|
|
922
|
+
sellPosition: number | null;
|
|
923
|
+
sellPositionChange: number | null;
|
|
924
|
+
netSellPosition: number | null;
|
|
925
|
+
sellPositionRatio: number | null;
|
|
926
|
+
buyPosition: number | null;
|
|
927
|
+
buyPositionChange: number | null;
|
|
928
|
+
netBuyPosition: number | null;
|
|
929
|
+
buyPositionRatio: number | null;
|
|
930
|
+
/**
|
|
931
|
+
* @deprecated 请改用 `date`
|
|
932
|
+
*/
|
|
933
|
+
tradeDate: string;
|
|
934
|
+
/**
|
|
935
|
+
* @deprecated 旧字段,使用当前数据时优先读取 `buyVolume` / `sellVolume`
|
|
936
|
+
*/
|
|
937
|
+
volume: number | null;
|
|
938
|
+
/**
|
|
939
|
+
* @deprecated 旧字段,使用当前数据时优先读取 `buyVolumeChange` / `sellVolumeChange`
|
|
940
|
+
*/
|
|
941
|
+
volumeChange: number | null;
|
|
942
|
+
/**
|
|
943
|
+
* @deprecated 旧字段,历史实现中无稳定金额语义,当前返回最接近的持仓值
|
|
944
|
+
*/
|
|
945
|
+
amount: number | null;
|
|
946
|
+
/**
|
|
947
|
+
* @deprecated 旧字段,历史实现中无稳定金额变动语义,当前返回最接近的持仓变动值
|
|
948
|
+
*/
|
|
949
|
+
amountChange: number | null;
|
|
950
|
+
/**
|
|
951
|
+
* @deprecated 请改用 `buyPosition` / `sellPosition`
|
|
952
|
+
*/
|
|
953
|
+
openInterest: number | null;
|
|
954
|
+
/**
|
|
955
|
+
* @deprecated 请改用 `buyPositionChange` / `sellPositionChange`
|
|
956
|
+
*/
|
|
957
|
+
openInterestChange: number | null;
|
|
958
|
+
/**
|
|
959
|
+
* @deprecated 请改用更细粒度的 `tradeType`
|
|
960
|
+
*/
|
|
961
|
+
side: 'buy' | 'sell' | 'net' | null;
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
/**
|
|
965
|
+
* 标准化的搜索结果资产分类
|
|
966
|
+
* - 由 `SearchResult.type` 原始字符串归一化得到
|
|
967
|
+
* - 用于跨数据源做统一的资产类型判断
|
|
968
|
+
*/
|
|
969
|
+
type SearchResultType = 'stock' | 'index' | 'fund' | 'bond' | 'futures' | 'option' | 'other';
|
|
970
|
+
/**
|
|
971
|
+
* 搜索结果
|
|
972
|
+
*
|
|
973
|
+
* @remarks
|
|
974
|
+
* `type` 字段保留上游原始资产类型字符串(如 `'GP-A'`、`'ZS'`、`'KJ'` 等),
|
|
975
|
+
* 以保持向后兼容;如需基于统一分类做判断,请使用 `category`。
|
|
830
976
|
*/
|
|
831
977
|
interface SearchResult {
|
|
832
|
-
/** 股票代码(完整,如 sh600519
|
|
978
|
+
/** 股票代码(完整,如 `sh600519`) */
|
|
833
979
|
code: string;
|
|
834
|
-
/**
|
|
980
|
+
/** 名称 */
|
|
835
981
|
name: string;
|
|
836
|
-
/**
|
|
982
|
+
/** 市场标识,如 `sh` / `sz` / `hk` / `us` */
|
|
837
983
|
market: string;
|
|
838
|
-
/**
|
|
984
|
+
/** 上游原始资产类型字符串,如 `'GP-A'` / `'ZS'` / `'KJ'` */
|
|
839
985
|
type: string;
|
|
986
|
+
/**
|
|
987
|
+
* 标准化后的资产分类(在原始 `type` 基础上做归一化)
|
|
988
|
+
* - 不影响 `type` 原值,可放心用于 `switch` 等场景
|
|
989
|
+
*/
|
|
990
|
+
category?: SearchResultType;
|
|
840
991
|
}
|
|
841
992
|
/**
|
|
842
993
|
* 分红派送详情
|
|
843
994
|
*/
|
|
844
995
|
interface DividendDetail {
|
|
845
|
-
/** 股票代码 */
|
|
846
996
|
code: string;
|
|
847
|
-
/** 股票名称 */
|
|
848
997
|
name: string;
|
|
849
|
-
/** 报告期 YYYY-MM-DD */
|
|
850
998
|
reportDate: string | null;
|
|
851
|
-
/** 预案公告日 YYYY-MM-DD */
|
|
852
999
|
planNoticeDate: string | null;
|
|
853
|
-
/** 业绩披露日期 YYYY-MM-DD */
|
|
854
1000
|
disclosureDate: string | null;
|
|
855
|
-
/** 送转总比例(每10股送转X股) */
|
|
856
1001
|
assignTransferRatio: number | null;
|
|
857
|
-
/** 送股比例(每10股送X股) */
|
|
858
1002
|
bonusRatio: number | null;
|
|
859
|
-
/** 转股比例(每10股转X股) */
|
|
860
1003
|
transferRatio: number | null;
|
|
861
|
-
/** 每10股派息(税前),单位:元 */
|
|
862
1004
|
dividendPretax: number | null;
|
|
863
|
-
/** 分红描述(如:10派2.36元(含税,扣税后2.124元)) */
|
|
864
1005
|
dividendDesc: string | null;
|
|
865
|
-
/** 股息率 */
|
|
866
1006
|
dividendYield: number | null;
|
|
867
|
-
/** 每股收益(元) */
|
|
868
1007
|
eps: number | null;
|
|
869
|
-
/** 每股净资产(元) */
|
|
870
1008
|
bps: number | null;
|
|
871
|
-
/** 每股公积金(元) */
|
|
872
1009
|
capitalReserve: number | null;
|
|
873
|
-
/** 每股未分配利润(元) */
|
|
874
1010
|
unassignedProfit: number | null;
|
|
875
|
-
/** 净利润同比增长(%) */
|
|
876
1011
|
netProfitYoy: number | null;
|
|
877
|
-
/** 总股本(股) */
|
|
878
1012
|
totalShares: number | null;
|
|
879
|
-
/** 股权登记日 YYYY-MM-DD */
|
|
880
1013
|
equityRecordDate: string | null;
|
|
881
|
-
/** 除权除息日 YYYY-MM-DD */
|
|
882
1014
|
exDividendDate: string | null;
|
|
883
|
-
/** 现金分红发放日 YYYY-MM-DD */
|
|
884
1015
|
payDate: string | null;
|
|
885
|
-
/** 方案进度(如:实施分配、股东大会预案等) */
|
|
886
1016
|
assignProgress: string | null;
|
|
887
|
-
/** 最新公告日期 YYYY-MM-DD */
|
|
888
1017
|
noticeDate: string | null;
|
|
889
1018
|
}
|
|
1019
|
+
|
|
890
1020
|
/**
|
|
891
|
-
*
|
|
1021
|
+
* 资金流向相关数据类型
|
|
892
1022
|
*/
|
|
893
|
-
type IndexOptionProduct = 'ho' | 'io' | 'mo';
|
|
894
1023
|
/**
|
|
895
|
-
*
|
|
1024
|
+
* 个股资金流(日/周/月线)
|
|
896
1025
|
*/
|
|
897
|
-
interface
|
|
898
|
-
/**
|
|
899
|
-
|
|
900
|
-
/**
|
|
901
|
-
|
|
902
|
-
/**
|
|
903
|
-
|
|
1026
|
+
interface StockFundFlowDaily {
|
|
1027
|
+
/** 日期 YYYY-MM-DD */
|
|
1028
|
+
date: string;
|
|
1029
|
+
/** 收盘价 */
|
|
1030
|
+
close: number | null;
|
|
1031
|
+
/** 涨跌幅(%) */
|
|
1032
|
+
changePercent: number | null;
|
|
1033
|
+
/** 主力净流入-净额(元) */
|
|
1034
|
+
mainNetInflow: number | null;
|
|
1035
|
+
/** 主力净流入-净占比(%) */
|
|
1036
|
+
mainNetInflowPercent: number | null;
|
|
1037
|
+
/** 超大单净流入-净额(元) */
|
|
1038
|
+
superLargeNetInflow: number | null;
|
|
1039
|
+
/** 超大单净流入-净占比(%) */
|
|
1040
|
+
superLargeNetInflowPercent: number | null;
|
|
1041
|
+
/** 大单净流入-净额(元) */
|
|
1042
|
+
largeNetInflow: number | null;
|
|
1043
|
+
/** 大单净流入-净占比(%) */
|
|
1044
|
+
largeNetInflowPercent: number | null;
|
|
1045
|
+
/** 中单净流入-净额(元) */
|
|
1046
|
+
mediumNetInflow: number | null;
|
|
1047
|
+
/** 中单净流入-净占比(%) */
|
|
1048
|
+
mediumNetInflowPercent: number | null;
|
|
1049
|
+
/** 小单净流入-净额(元) */
|
|
1050
|
+
smallNetInflow: number | null;
|
|
1051
|
+
/** 小单净流入-净占比(%) */
|
|
1052
|
+
smallNetInflowPercent: number | null;
|
|
1053
|
+
}
|
|
1054
|
+
/**
|
|
1055
|
+
* 个股资金流排名项(多维度统一结构,按排序周期返回相应周期数据)
|
|
1056
|
+
*/
|
|
1057
|
+
interface FundFlowRankItem {
|
|
1058
|
+
/** 股票代码 */
|
|
1059
|
+
code: string;
|
|
1060
|
+
/** 股票名称 */
|
|
1061
|
+
name: string;
|
|
904
1062
|
/** 最新价 */
|
|
905
1063
|
price: number | null;
|
|
906
|
-
/**
|
|
907
|
-
|
|
908
|
-
/**
|
|
909
|
-
|
|
910
|
-
/**
|
|
911
|
-
|
|
912
|
-
/**
|
|
913
|
-
|
|
914
|
-
/**
|
|
915
|
-
|
|
1064
|
+
/** 涨跌幅(%)(对应排序周期,例如 5 日则为 5 日涨跌幅) */
|
|
1065
|
+
changePercent: number | null;
|
|
1066
|
+
/** 主力净流入-净额(元) */
|
|
1067
|
+
mainNetInflow: number | null;
|
|
1068
|
+
/** 主力净流入-净占比(%) */
|
|
1069
|
+
mainNetInflowPercent: number | null;
|
|
1070
|
+
/** 超大单净流入-净额(元) */
|
|
1071
|
+
superLargeNetInflow: number | null;
|
|
1072
|
+
/** 超大单净流入-净占比(%) */
|
|
1073
|
+
superLargeNetInflowPercent: number | null;
|
|
1074
|
+
/** 大单净流入-净额(元) */
|
|
1075
|
+
largeNetInflow: number | null;
|
|
1076
|
+
/** 大单净流入-净占比(%) */
|
|
1077
|
+
largeNetInflowPercent: number | null;
|
|
1078
|
+
/** 中单净流入-净额(元) */
|
|
1079
|
+
mediumNetInflow: number | null;
|
|
1080
|
+
/** 中单净流入-净占比(%) */
|
|
1081
|
+
mediumNetInflowPercent: number | null;
|
|
1082
|
+
/** 小单净流入-净额(元) */
|
|
1083
|
+
smallNetInflow: number | null;
|
|
1084
|
+
/** 小单净流入-净占比(%) */
|
|
1085
|
+
smallNetInflowPercent: number | null;
|
|
1086
|
+
}
|
|
1087
|
+
/**
|
|
1088
|
+
* 板块资金流排名项
|
|
1089
|
+
*/
|
|
1090
|
+
interface SectorFundFlowItem {
|
|
1091
|
+
/** 板块代码(东方财富 BK 编号) */
|
|
1092
|
+
code: string;
|
|
1093
|
+
/** 板块名称 */
|
|
1094
|
+
name: string;
|
|
1095
|
+
/** 涨跌幅(%) */
|
|
1096
|
+
changePercent: number | null;
|
|
1097
|
+
/** 主力净流入-净额(元) */
|
|
1098
|
+
mainNetInflow: number | null;
|
|
1099
|
+
/** 主力净流入-净占比(%) */
|
|
1100
|
+
mainNetInflowPercent: number | null;
|
|
1101
|
+
/** 超大单净流入-净额(元) */
|
|
1102
|
+
superLargeNetInflow: number | null;
|
|
1103
|
+
/** 大单净流入-净额(元) */
|
|
1104
|
+
largeNetInflow: number | null;
|
|
1105
|
+
/** 中单净流入-净额(元) */
|
|
1106
|
+
mediumNetInflow: number | null;
|
|
1107
|
+
/** 小单净流入-净额(元) */
|
|
1108
|
+
smallNetInflow: number | null;
|
|
1109
|
+
/** 主力净流入最大股名称 */
|
|
1110
|
+
topStockName?: string;
|
|
1111
|
+
/** 主力净流入最大股代码 */
|
|
1112
|
+
topStockCode?: string;
|
|
1113
|
+
}
|
|
1114
|
+
/**
|
|
1115
|
+
* 大盘资金流(按日)
|
|
1116
|
+
*/
|
|
1117
|
+
interface MarketFundFlow {
|
|
1118
|
+
/** 日期 YYYY-MM-DD */
|
|
1119
|
+
date: string;
|
|
1120
|
+
/** 上证指数收盘价 */
|
|
1121
|
+
shClose: number | null;
|
|
1122
|
+
/** 上证指数涨跌幅(%) */
|
|
1123
|
+
shChangePercent: number | null;
|
|
1124
|
+
/** 深证指数收盘价 */
|
|
1125
|
+
szClose: number | null;
|
|
1126
|
+
/** 深证指数涨跌幅(%) */
|
|
1127
|
+
szChangePercent: number | null;
|
|
1128
|
+
/** 主力净流入-净额(元) */
|
|
1129
|
+
mainNetInflow: number | null;
|
|
1130
|
+
/** 主力净流入-净占比(%) */
|
|
1131
|
+
mainNetInflowPercent: number | null;
|
|
1132
|
+
/** 超大单净流入-净额(元) */
|
|
1133
|
+
superLargeNetInflow: number | null;
|
|
1134
|
+
/** 超大单净流入-净占比(%) */
|
|
1135
|
+
superLargeNetInflowPercent: number | null;
|
|
1136
|
+
/** 大单净流入-净额(元) */
|
|
1137
|
+
largeNetInflow: number | null;
|
|
1138
|
+
/** 大单净流入-净占比(%) */
|
|
1139
|
+
largeNetInflowPercent: number | null;
|
|
1140
|
+
/** 中单净流入-净额(元) */
|
|
1141
|
+
mediumNetInflow: number | null;
|
|
1142
|
+
/** 中单净流入-净占比(%) */
|
|
1143
|
+
mediumNetInflowPercent: number | null;
|
|
1144
|
+
/** 小单净流入-净额(元) */
|
|
1145
|
+
smallNetInflow: number | null;
|
|
1146
|
+
/** 小单净流入-净占比(%) */
|
|
1147
|
+
smallNetInflowPercent: number | null;
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
/**
|
|
1151
|
+
* 沪深港通 / 北向资金 数据类型
|
|
1152
|
+
*/
|
|
1153
|
+
/** 资金方向 */
|
|
1154
|
+
type NorthboundDirection = 'north' | 'south';
|
|
1155
|
+
/** 北向持股市场 */
|
|
1156
|
+
type NorthboundMarket = 'all' | 'shanghai' | 'shenzhen';
|
|
1157
|
+
/** 北向持股排行查询周期 */
|
|
1158
|
+
type NorthboundRankPeriod = 'today' | '3day' | '5day' | '10day' | 'month' | 'quarter' | 'year';
|
|
1159
|
+
/**
|
|
1160
|
+
* 北向 / 南向资金分时数据
|
|
1161
|
+
*/
|
|
1162
|
+
interface NorthboundMinuteItem {
|
|
1163
|
+
/** 日期 YYYY-MM-DD */
|
|
1164
|
+
date: string;
|
|
1165
|
+
/** 时间 HH:MM */
|
|
1166
|
+
time: string;
|
|
1167
|
+
/** 沪股通 / 港股通(沪) 净流入(万元) */
|
|
1168
|
+
shanghaiNetInflow: number | null;
|
|
1169
|
+
/** 深股通 / 港股通(深) 净流入(万元) */
|
|
1170
|
+
shenzhenNetInflow: number | null;
|
|
1171
|
+
/** 合计净流入(万元) */
|
|
1172
|
+
totalNetInflow: number | null;
|
|
1173
|
+
}
|
|
1174
|
+
/**
|
|
1175
|
+
* 沪深港通市场资金流向汇总(datacenter RPT_MUTUAL_QUOTA)
|
|
1176
|
+
*/
|
|
1177
|
+
interface NorthboundFlowSummary {
|
|
1178
|
+
/** 交易日 YYYY-MM-DD */
|
|
1179
|
+
date: string;
|
|
1180
|
+
/** 类型编号 */
|
|
1181
|
+
type: string;
|
|
1182
|
+
/** 板块名称(如「沪股通」「港股通(沪)」) */
|
|
1183
|
+
boardName: string;
|
|
1184
|
+
/** 资金方向(如「北向资金」「南向资金」) */
|
|
1185
|
+
direction: string;
|
|
1186
|
+
/** 交易状态 */
|
|
1187
|
+
status: string;
|
|
1188
|
+
/** 成交净买额(元,原始接口单位) */
|
|
1189
|
+
netBuyAmount: number | null;
|
|
1190
|
+
/** 资金净流入(元) */
|
|
1191
|
+
netInflow: number | null;
|
|
1192
|
+
/** 当日资金余额(元) */
|
|
1193
|
+
remainAmount: number | null;
|
|
1194
|
+
/** 上涨数 */
|
|
1195
|
+
upCount: number | null;
|
|
1196
|
+
/** 持平数 */
|
|
1197
|
+
flatCount: number | null;
|
|
1198
|
+
/** 下跌数 */
|
|
1199
|
+
downCount: number | null;
|
|
1200
|
+
/** 相关指数代码 */
|
|
1201
|
+
indexCode: string;
|
|
1202
|
+
/** 相关指数名称 */
|
|
1203
|
+
indexName: string;
|
|
1204
|
+
/** 指数涨跌幅(%) */
|
|
1205
|
+
indexChangePercent: number | null;
|
|
1206
|
+
}
|
|
1207
|
+
/**
|
|
1208
|
+
* 北向 / 沪股通 / 深股通持股个股排行项
|
|
1209
|
+
*/
|
|
1210
|
+
interface NorthboundHoldingRankItem {
|
|
1211
|
+
/** 日期 YYYY-MM-DD */
|
|
1212
|
+
date: string;
|
|
1213
|
+
/** 股票代码 */
|
|
1214
|
+
code: string;
|
|
1215
|
+
/** 股票名称 */
|
|
1216
|
+
name: string;
|
|
1217
|
+
/** 今日收盘价 */
|
|
1218
|
+
close: number | null;
|
|
1219
|
+
/** 今日涨跌幅(%) */
|
|
1220
|
+
changePercent: number | null;
|
|
1221
|
+
/** 今日持股股数 */
|
|
1222
|
+
holdShares: number | null;
|
|
1223
|
+
/** 今日持股市值(元) */
|
|
1224
|
+
holdMarketValue: number | null;
|
|
1225
|
+
/** 持股占流通股比(%) */
|
|
1226
|
+
holdRatioFloat: number | null;
|
|
1227
|
+
/** 持股占总股本比(%) */
|
|
1228
|
+
holdRatioTotal: number | null;
|
|
1229
|
+
/** 区间增持估计股数 */
|
|
1230
|
+
addShares: number | null;
|
|
1231
|
+
/** 区间增持估计市值(元) */
|
|
1232
|
+
addMarketValue: number | null;
|
|
1233
|
+
/** 区间增持估计市值增幅(%) */
|
|
1234
|
+
addMarketValuePercent: number | null;
|
|
1235
|
+
/** 所属板块 */
|
|
1236
|
+
sector: string;
|
|
1237
|
+
}
|
|
1238
|
+
/**
|
|
1239
|
+
* 北向资金历史项(按日)
|
|
1240
|
+
*/
|
|
1241
|
+
interface NorthboundHistoryItem {
|
|
1242
|
+
/** 日期 YYYY-MM-DD */
|
|
1243
|
+
date: string;
|
|
1244
|
+
/** 成交净买额(元) */
|
|
1245
|
+
netBuyAmount: number | null;
|
|
1246
|
+
/** 买入成交额(元) */
|
|
1247
|
+
buyAmount: number | null;
|
|
1248
|
+
/** 卖出成交额(元) */
|
|
1249
|
+
sellAmount: number | null;
|
|
1250
|
+
/** 历史累计净买额(元) */
|
|
1251
|
+
accNetBuyAmount: number | null;
|
|
1252
|
+
/** 当日资金流入(元) */
|
|
1253
|
+
netInflow: number | null;
|
|
1254
|
+
/** 当日资金余额(元) */
|
|
1255
|
+
remainAmount: number | null;
|
|
1256
|
+
/** 领涨股代码 */
|
|
1257
|
+
topStockCode: string | null;
|
|
1258
|
+
/** 领涨股名称 */
|
|
1259
|
+
topStockName: string | null;
|
|
1260
|
+
/** 领涨股涨跌幅(%) */
|
|
1261
|
+
topStockChangePercent: number | null;
|
|
1262
|
+
}
|
|
1263
|
+
/**
|
|
1264
|
+
* 个股北向持仓历史项
|
|
1265
|
+
*/
|
|
1266
|
+
interface NorthboundIndividualItem {
|
|
1267
|
+
/** 日期 YYYY-MM-DD */
|
|
1268
|
+
date: string;
|
|
1269
|
+
/** 持股数量 */
|
|
1270
|
+
holdShares: number | null;
|
|
1271
|
+
/** 持股市值(元) */
|
|
1272
|
+
holdMarketValue: number | null;
|
|
1273
|
+
/** 持股占流通股比(%) */
|
|
1274
|
+
holdRatioFloat: number | null;
|
|
1275
|
+
/** 持股占总股本比(%) */
|
|
1276
|
+
holdRatioTotal: number | null;
|
|
1277
|
+
/** 收盘价 */
|
|
1278
|
+
close: number | null;
|
|
1279
|
+
/** 涨跌幅(%) */
|
|
1280
|
+
changePercent: number | null;
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
/**
|
|
1284
|
+
* 涨停板 / 盘口异动 数据类型
|
|
1285
|
+
*/
|
|
1286
|
+
/** 涨停股池类型 */
|
|
1287
|
+
type ZTPoolType = 'zt' | 'yesterday' | 'strong' | 'sub_new' | 'broken' | 'dt';
|
|
1288
|
+
/**
|
|
1289
|
+
* 涨停股池项(统一字段,部分类型某些字段为空)
|
|
1290
|
+
*/
|
|
1291
|
+
interface ZTPoolItem {
|
|
1292
|
+
/** 股票代码 */
|
|
1293
|
+
code: string;
|
|
1294
|
+
/** 股票名称 */
|
|
1295
|
+
name: string;
|
|
1296
|
+
/** 最新价(元) */
|
|
1297
|
+
price: number | null;
|
|
1298
|
+
/** 涨跌幅(%) */
|
|
1299
|
+
changePercent: number | null;
|
|
1300
|
+
/** 涨停价(元) - 仅部分池子返回 */
|
|
1301
|
+
limitPrice: number | null;
|
|
1302
|
+
/** 成交额(元) */
|
|
1303
|
+
amount: number | null;
|
|
1304
|
+
/** 流通市值(元) */
|
|
1305
|
+
floatMarketValue: number | null;
|
|
1306
|
+
/** 总市值(元) */
|
|
1307
|
+
totalMarketValue: number | null;
|
|
1308
|
+
/** 换手率(%) */
|
|
1309
|
+
turnoverRate: number | null;
|
|
1310
|
+
/** 连板数 - 仅涨停股池返回 */
|
|
1311
|
+
continuousBoardCount: number | null;
|
|
1312
|
+
/** 首次封板时间 HHMMSS - 涨停/炸板池 */
|
|
1313
|
+
firstBoardTime: string | null;
|
|
1314
|
+
/** 最后封板时间 HHMMSS - 涨停池 */
|
|
1315
|
+
lastBoardTime: string | null;
|
|
1316
|
+
/** 封板资金(元) - 涨停池 */
|
|
1317
|
+
boardAmount: number | null;
|
|
1318
|
+
/** 封单资金(元) - 跌停池 */
|
|
1319
|
+
sealAmount: number | null;
|
|
1320
|
+
/** 炸板次数 */
|
|
1321
|
+
failedCount: number | null;
|
|
1322
|
+
/** 所属行业 */
|
|
1323
|
+
industry: string;
|
|
1324
|
+
/** 涨停统计(如 '3/5' 表示 5 天内涨停 3 次) */
|
|
1325
|
+
ztStatistics: string;
|
|
1326
|
+
/** 振幅(%) - 部分池子返回 */
|
|
1327
|
+
amplitude: number | null;
|
|
1328
|
+
/** 涨速 - 部分池子返回 */
|
|
1329
|
+
speed: number | null;
|
|
1330
|
+
}
|
|
1331
|
+
/** 盘口异动类型 */
|
|
1332
|
+
type StockChangeType = 'rocket_launch' | 'quick_rebound' | 'large_buy' | 'limit_up_seal' | 'limit_down_open' | 'big_buy_order' | 'auction_up' | 'high_open_5d' | 'gap_up' | 'high_60d' | 'surge_60d' | 'accelerate_down' | 'high_dive' | 'large_sell' | 'limit_down_seal' | 'limit_up_open' | 'big_sell_order' | 'auction_down' | 'low_open_5d' | 'gap_down' | 'low_60d' | 'drop_60d';
|
|
1333
|
+
/**
|
|
1334
|
+
* 盘口异动项
|
|
1335
|
+
*/
|
|
1336
|
+
interface StockChangeItem {
|
|
1337
|
+
/** 发生时间 HH:MM:SS */
|
|
1338
|
+
time: string;
|
|
1339
|
+
/** 股票代码 */
|
|
1340
|
+
code: string;
|
|
1341
|
+
/** 股票名称 */
|
|
1342
|
+
name: string;
|
|
1343
|
+
/** 异动类型 */
|
|
1344
|
+
changeType: StockChangeType;
|
|
1345
|
+
/** 异动类型对应的中文标签 */
|
|
1346
|
+
changeTypeLabel: string;
|
|
1347
|
+
/** 相关信息(来自原始接口) */
|
|
1348
|
+
info: string;
|
|
1349
|
+
}
|
|
1350
|
+
/**
|
|
1351
|
+
* 板块异动项
|
|
1352
|
+
*/
|
|
1353
|
+
interface BoardChangeItem {
|
|
1354
|
+
/** 板块名称 */
|
|
1355
|
+
name: string;
|
|
1356
|
+
/** 涨跌幅(%) */
|
|
1357
|
+
changePercent: number | null;
|
|
1358
|
+
/** 主力净流入(元) */
|
|
1359
|
+
mainNetInflow: number | null;
|
|
1360
|
+
/** 异动总次数 */
|
|
1361
|
+
totalChangeCount: number | null;
|
|
1362
|
+
/** 异动最频繁个股代码 */
|
|
1363
|
+
topStockCode: string;
|
|
1364
|
+
/** 异动最频繁个股名称 */
|
|
1365
|
+
topStockName: string;
|
|
1366
|
+
/** 异动最频繁个股方向:'大笔买入' | '大笔卖出' */
|
|
1367
|
+
topStockDirection: string;
|
|
1368
|
+
/** 异动类型分布(key 为类型代码,value 为出现次数) */
|
|
1369
|
+
changeTypeDistribution: Record<string, number>;
|
|
916
1370
|
}
|
|
1371
|
+
|
|
917
1372
|
/**
|
|
918
|
-
*
|
|
1373
|
+
* 龙虎榜数据类型
|
|
919
1374
|
*/
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
calls: OptionTQuote[];
|
|
923
|
-
/** 看跌合约列表 */
|
|
924
|
-
puts: OptionTQuote[];
|
|
925
|
-
}
|
|
1375
|
+
/** 龙虎榜统计周期 */
|
|
1376
|
+
type DragonTigerPeriod = '1month' | '3month' | '6month' | '1year';
|
|
926
1377
|
/**
|
|
927
|
-
*
|
|
1378
|
+
* 龙虎榜详情项
|
|
928
1379
|
*/
|
|
929
|
-
interface
|
|
930
|
-
/**
|
|
1380
|
+
interface DragonTigerDetailItem {
|
|
1381
|
+
/** 股票代码 */
|
|
1382
|
+
code: string;
|
|
1383
|
+
/** 股票名称 */
|
|
1384
|
+
name: string;
|
|
1385
|
+
/** 上榜日期 YYYY-MM-DD */
|
|
931
1386
|
date: string;
|
|
932
|
-
/** 开盘价 */
|
|
933
|
-
open: number | null;
|
|
934
|
-
/** 最高价 */
|
|
935
|
-
high: number | null;
|
|
936
|
-
/** 最低价 */
|
|
937
|
-
low: number | null;
|
|
938
1387
|
/** 收盘价 */
|
|
939
1388
|
close: number | null;
|
|
940
|
-
/**
|
|
941
|
-
|
|
1389
|
+
/** 涨跌幅(%) */
|
|
1390
|
+
changePercent: number | null;
|
|
1391
|
+
/** 龙虎榜净买额(元) */
|
|
1392
|
+
netBuyAmount: number | null;
|
|
1393
|
+
/** 龙虎榜买入额(元) */
|
|
1394
|
+
buyAmount: number | null;
|
|
1395
|
+
/** 龙虎榜卖出额(元) */
|
|
1396
|
+
sellAmount: number | null;
|
|
1397
|
+
/** 龙虎榜成交额(元) */
|
|
1398
|
+
dealAmount: number | null;
|
|
1399
|
+
/** 市场总成交额(元) */
|
|
1400
|
+
totalAmount: number | null;
|
|
1401
|
+
/** 净买额占总成交比(%) */
|
|
1402
|
+
netBuyRatio: number | null;
|
|
1403
|
+
/** 成交额占总成交比(%) */
|
|
1404
|
+
dealAmountRatio: number | null;
|
|
1405
|
+
/** 换手率(%) */
|
|
1406
|
+
turnoverRate: number | null;
|
|
1407
|
+
/** 流通市值(元) */
|
|
1408
|
+
floatMarketValue: number | null;
|
|
1409
|
+
/** 上榜原因 */
|
|
1410
|
+
reason: string;
|
|
1411
|
+
/** 上榜后 1 日涨跌幅(%) */
|
|
1412
|
+
afterChange1d: number | null;
|
|
1413
|
+
/** 上榜后 2 日涨跌幅(%) */
|
|
1414
|
+
afterChange2d: number | null;
|
|
1415
|
+
/** 上榜后 5 日涨跌幅(%) */
|
|
1416
|
+
afterChange5d: number | null;
|
|
1417
|
+
/** 上榜后 10 日涨跌幅(%) */
|
|
1418
|
+
afterChange10d: number | null;
|
|
1419
|
+
}
|
|
1420
|
+
/**
|
|
1421
|
+
* 龙虎榜个股上榜统计项
|
|
1422
|
+
*/
|
|
1423
|
+
interface DragonTigerStockStatItem {
|
|
1424
|
+
/** 股票代码 */
|
|
1425
|
+
code: string;
|
|
1426
|
+
/** 股票名称 */
|
|
1427
|
+
name: string;
|
|
1428
|
+
/** 最近上榜日 YYYY-MM-DD */
|
|
1429
|
+
latestDate: string;
|
|
1430
|
+
/** 收盘价 */
|
|
1431
|
+
close: number | null;
|
|
1432
|
+
/** 涨跌幅(%) */
|
|
1433
|
+
changePercent: number | null;
|
|
1434
|
+
/** 上榜次数 */
|
|
1435
|
+
count: number | null;
|
|
1436
|
+
/** 龙虎榜累计买入额(元) */
|
|
1437
|
+
totalBuyAmount: number | null;
|
|
1438
|
+
/** 龙虎榜累计卖出额(元) */
|
|
1439
|
+
totalSellAmount: number | null;
|
|
1440
|
+
/** 龙虎榜累计净额(元) */
|
|
1441
|
+
totalNetAmount: number | null;
|
|
1442
|
+
/** 龙虎榜累计成交额(元) */
|
|
1443
|
+
totalDealAmount: number | null;
|
|
1444
|
+
/** 累计买方机构次数 */
|
|
1445
|
+
buyOrgCount: number | null;
|
|
1446
|
+
/** 累计卖方机构次数 */
|
|
1447
|
+
sellOrgCount: number | null;
|
|
1448
|
+
}
|
|
1449
|
+
/**
|
|
1450
|
+
* 龙虎榜机构买卖项
|
|
1451
|
+
*/
|
|
1452
|
+
interface DragonTigerInstitutionItem {
|
|
1453
|
+
/** 股票代码 */
|
|
1454
|
+
code: string;
|
|
1455
|
+
/** 股票名称 */
|
|
1456
|
+
name: string;
|
|
1457
|
+
/** 上榜日期 YYYY-MM-DD */
|
|
1458
|
+
date: string;
|
|
1459
|
+
/** 收盘价 */
|
|
1460
|
+
close: number | null;
|
|
1461
|
+
/** 涨跌幅(%) */
|
|
1462
|
+
changePercent: number | null;
|
|
1463
|
+
/** 买方机构数 */
|
|
1464
|
+
buyOrgCount: number | null;
|
|
1465
|
+
/** 卖方机构数 */
|
|
1466
|
+
sellOrgCount: number | null;
|
|
1467
|
+
/** 机构买入额(元) */
|
|
1468
|
+
orgBuyAmount: number | null;
|
|
1469
|
+
/** 机构卖出额(元) */
|
|
1470
|
+
orgSellAmount: number | null;
|
|
1471
|
+
/** 机构净额(元) */
|
|
1472
|
+
orgNetAmount: number | null;
|
|
1473
|
+
}
|
|
1474
|
+
/**
|
|
1475
|
+
* 龙虎榜营业部排行项
|
|
1476
|
+
*/
|
|
1477
|
+
interface DragonTigerBranchItem {
|
|
1478
|
+
/** 营业部代码 */
|
|
1479
|
+
code: string;
|
|
1480
|
+
/** 营业部名称 */
|
|
1481
|
+
name: string;
|
|
1482
|
+
/** 买入总额(元) */
|
|
1483
|
+
totalBuyAmount: number | null;
|
|
1484
|
+
/** 卖出总额(元) */
|
|
1485
|
+
totalSellAmount: number | null;
|
|
1486
|
+
/** 买入次数 */
|
|
1487
|
+
buyCount: number | null;
|
|
1488
|
+
/** 卖出次数 */
|
|
1489
|
+
sellCount: number | null;
|
|
1490
|
+
/** 上榜次数 */
|
|
1491
|
+
totalCount: number | null;
|
|
942
1492
|
}
|
|
943
1493
|
/**
|
|
944
|
-
*
|
|
1494
|
+
* 龙虎榜个股席位明细项
|
|
945
1495
|
*/
|
|
946
|
-
interface
|
|
947
|
-
/**
|
|
948
|
-
|
|
949
|
-
/**
|
|
950
|
-
|
|
951
|
-
/**
|
|
952
|
-
|
|
953
|
-
/**
|
|
954
|
-
|
|
955
|
-
/**
|
|
956
|
-
|
|
957
|
-
/**
|
|
958
|
-
|
|
1496
|
+
interface DragonTigerSeatItem {
|
|
1497
|
+
/** 排名 */
|
|
1498
|
+
rank: number | null;
|
|
1499
|
+
/** 营业部名称 */
|
|
1500
|
+
branchName: string;
|
|
1501
|
+
/** 买入额(元) */
|
|
1502
|
+
buyAmount: number | null;
|
|
1503
|
+
/** 买入占总成交比(%) */
|
|
1504
|
+
buyAmountRatio: number | null;
|
|
1505
|
+
/** 卖出额(元) */
|
|
1506
|
+
sellAmount: number | null;
|
|
1507
|
+
/** 卖出占总成交比(%) */
|
|
1508
|
+
sellAmountRatio: number | null;
|
|
1509
|
+
/** 净额(元) */
|
|
1510
|
+
netAmount: number | null;
|
|
1511
|
+
/** 类型标识: 'buy' | 'sell' */
|
|
1512
|
+
side: 'buy' | 'sell';
|
|
1513
|
+
}
|
|
1514
|
+
/**
|
|
1515
|
+
* 龙虎榜日期范围参数
|
|
1516
|
+
*/
|
|
1517
|
+
interface DragonTigerDateOptions {
|
|
1518
|
+
/** 开始日期 YYYYMMDD */
|
|
1519
|
+
startDate: string;
|
|
1520
|
+
/** 结束日期 YYYYMMDD */
|
|
1521
|
+
endDate: string;
|
|
959
1522
|
}
|
|
1523
|
+
|
|
960
1524
|
/**
|
|
961
|
-
*
|
|
1525
|
+
* 大宗交易数据类型
|
|
962
1526
|
*/
|
|
963
|
-
interface ETFOptionMonth {
|
|
964
|
-
/** 到期月份数组 YYYY-MM */
|
|
965
|
-
months: string[];
|
|
966
|
-
/** 标的证券代码 */
|
|
967
|
-
stockId: string;
|
|
968
|
-
/** 当前品种标识 */
|
|
969
|
-
cateId: string;
|
|
970
|
-
/** 可选品种列表 */
|
|
971
|
-
cateList: string[];
|
|
972
|
-
}
|
|
973
1527
|
/**
|
|
974
|
-
*
|
|
1528
|
+
* 大宗交易市场统计项(按日)
|
|
975
1529
|
*/
|
|
976
|
-
interface
|
|
977
|
-
/**
|
|
978
|
-
|
|
979
|
-
/**
|
|
980
|
-
|
|
981
|
-
/**
|
|
982
|
-
|
|
983
|
-
/**
|
|
1530
|
+
interface BlockTradeMarketStatItem {
|
|
1531
|
+
/** 交易日期 YYYY-MM-DD */
|
|
1532
|
+
date: string;
|
|
1533
|
+
/** 上证指数 */
|
|
1534
|
+
shClose: number | null;
|
|
1535
|
+
/** 上证指数涨跌幅(%) */
|
|
1536
|
+
shChangePercent: number | null;
|
|
1537
|
+
/** 大宗交易成交总额(元) */
|
|
1538
|
+
totalAmount: number | null;
|
|
1539
|
+
/** 溢价成交总额(元) */
|
|
1540
|
+
premiumAmount: number | null;
|
|
1541
|
+
/** 溢价成交占比(%) */
|
|
1542
|
+
premiumRatio: number | null;
|
|
1543
|
+
/** 折价成交总额(元) */
|
|
1544
|
+
discountAmount: number | null;
|
|
1545
|
+
/** 折价成交占比(%) */
|
|
1546
|
+
discountRatio: number | null;
|
|
1547
|
+
}
|
|
1548
|
+
/**
|
|
1549
|
+
* 大宗交易明细项
|
|
1550
|
+
*/
|
|
1551
|
+
interface BlockTradeDetailItem {
|
|
1552
|
+
/** 股票代码 */
|
|
1553
|
+
code: string;
|
|
1554
|
+
/** 股票名称 */
|
|
1555
|
+
name: string;
|
|
1556
|
+
/** 交易日期 YYYY-MM-DD */
|
|
1557
|
+
date: string;
|
|
1558
|
+
/** 收盘价 */
|
|
1559
|
+
close: number | null;
|
|
1560
|
+
/** 涨跌幅(%) */
|
|
1561
|
+
changePercent: number | null;
|
|
1562
|
+
/** 成交价(元) */
|
|
1563
|
+
dealPrice: number | null;
|
|
1564
|
+
/** 成交量(股) */
|
|
1565
|
+
dealVolume: number | null;
|
|
1566
|
+
/** 成交额(元) */
|
|
1567
|
+
dealAmount: number | null;
|
|
1568
|
+
/** 溢价率(%) */
|
|
1569
|
+
premiumRate: number | null;
|
|
1570
|
+
/** 买方营业部 */
|
|
1571
|
+
buyBranch: string;
|
|
1572
|
+
/** 卖方营业部 */
|
|
1573
|
+
sellBranch: string;
|
|
1574
|
+
}
|
|
1575
|
+
/**
|
|
1576
|
+
* 大宗交易每日统计项(按股票汇总)
|
|
1577
|
+
*/
|
|
1578
|
+
interface BlockTradeDailyStatItem {
|
|
1579
|
+
/** 股票代码 */
|
|
1580
|
+
code: string;
|
|
1581
|
+
/** 股票名称 */
|
|
984
1582
|
name: string;
|
|
1583
|
+
/** 交易日期 YYYY-MM-DD */
|
|
1584
|
+
date: string;
|
|
1585
|
+
/** 涨跌幅(%) */
|
|
1586
|
+
changePercent: number | null;
|
|
1587
|
+
/** 收盘价 */
|
|
1588
|
+
close: number | null;
|
|
1589
|
+
/** 成交笔数 */
|
|
1590
|
+
dealCount: number | null;
|
|
1591
|
+
/** 成交总额(元) */
|
|
1592
|
+
dealTotalAmount: number | null;
|
|
1593
|
+
/** 成交总量(股) */
|
|
1594
|
+
dealTotalVolume: number | null;
|
|
1595
|
+
/** 溢价成交额(元) */
|
|
1596
|
+
premiumAmount: number | null;
|
|
1597
|
+
/** 折价成交额(元) */
|
|
1598
|
+
discountAmount: number | null;
|
|
1599
|
+
}
|
|
1600
|
+
/**
|
|
1601
|
+
* 大宗交易日期范围参数
|
|
1602
|
+
*/
|
|
1603
|
+
interface BlockTradeDateOptions {
|
|
1604
|
+
/** 开始日期 YYYYMMDD 或 YYYY-MM-DD */
|
|
1605
|
+
startDate?: string;
|
|
1606
|
+
/** 结束日期 YYYYMMDD 或 YYYY-MM-DD */
|
|
1607
|
+
endDate?: string;
|
|
985
1608
|
}
|
|
1609
|
+
|
|
986
1610
|
/**
|
|
987
|
-
*
|
|
1611
|
+
* 融资融券数据类型
|
|
988
1612
|
*/
|
|
989
|
-
type ETFOptionCate = '50ETF' | '300ETF' | '500ETF' | '科创50' | '科创板50';
|
|
990
1613
|
/**
|
|
991
|
-
*
|
|
1614
|
+
* 融资融券账户统计项(按日)
|
|
992
1615
|
*/
|
|
993
|
-
interface
|
|
994
|
-
/**
|
|
1616
|
+
interface MarginAccountItem {
|
|
1617
|
+
/** 日期 YYYY-MM-DD */
|
|
1618
|
+
date: string;
|
|
1619
|
+
/** 融资余额(元) */
|
|
1620
|
+
finBalance: number | null;
|
|
1621
|
+
/** 融券余额(元) */
|
|
1622
|
+
loanBalance: number | null;
|
|
1623
|
+
/** 融资买入额(元) */
|
|
1624
|
+
finBuyAmount: number | null;
|
|
1625
|
+
/** 融券卖出额(元) */
|
|
1626
|
+
loanSellAmount: number | null;
|
|
1627
|
+
/** 参与交易的投资者数量 */
|
|
1628
|
+
investorCount: number | null;
|
|
1629
|
+
/** 有融资融券负债的投资者数量 */
|
|
1630
|
+
liabilityInvestorCount: number | null;
|
|
1631
|
+
/** 担保物总价值(元) */
|
|
1632
|
+
totalGuarantee: number | null;
|
|
1633
|
+
/** 平均维持担保比例(%) */
|
|
1634
|
+
avgGuaranteeRatio: number | null;
|
|
1635
|
+
}
|
|
1636
|
+
/**
|
|
1637
|
+
* 融资融券标的证券项
|
|
1638
|
+
*/
|
|
1639
|
+
interface MarginTargetItem {
|
|
1640
|
+
/** 证券代码 */
|
|
995
1641
|
code: string;
|
|
996
|
-
/**
|
|
1642
|
+
/** 证券名称 */
|
|
997
1643
|
name: string;
|
|
998
|
-
/**
|
|
999
|
-
price: number | null;
|
|
1000
|
-
/** 涨跌额 */
|
|
1001
|
-
change: number | null;
|
|
1002
|
-
/** 涨跌幅% */
|
|
1003
|
-
changePercent: number | null;
|
|
1004
|
-
/** 成交量 */
|
|
1005
|
-
volume: number | null;
|
|
1006
|
-
/** 成交额 */
|
|
1007
|
-
amount: number | null;
|
|
1008
|
-
/** 持仓量 */
|
|
1009
|
-
openInterest: number | null;
|
|
1010
|
-
/** 行权价 */
|
|
1011
|
-
strikePrice: number | null;
|
|
1012
|
-
/** 剩余天数 */
|
|
1013
|
-
remainDays: number | null;
|
|
1014
|
-
/** 日增 */
|
|
1015
|
-
dailyChange: number | null;
|
|
1016
|
-
/** 昨结算价 */
|
|
1017
|
-
prevSettle: number | null;
|
|
1018
|
-
/** 今开 */
|
|
1019
|
-
open: number | null;
|
|
1020
|
-
}
|
|
1021
|
-
/**
|
|
1022
|
-
* 期权龙虎榜条目
|
|
1023
|
-
*/
|
|
1024
|
-
interface OptionLHBItem {
|
|
1025
|
-
/** 交易类型(认沽交易量/认沽持仓量/认购交易量/认购持仓量) */
|
|
1026
|
-
tradeType: string;
|
|
1027
|
-
/** 交易日期 YYYY-MM-DD */
|
|
1644
|
+
/** 日期 YYYY-MM-DD */
|
|
1028
1645
|
date: string;
|
|
1029
|
-
/**
|
|
1030
|
-
|
|
1031
|
-
/**
|
|
1032
|
-
|
|
1033
|
-
/**
|
|
1034
|
-
|
|
1035
|
-
/**
|
|
1036
|
-
|
|
1037
|
-
/**
|
|
1038
|
-
|
|
1039
|
-
/**
|
|
1040
|
-
|
|
1041
|
-
/** 净卖量 */
|
|
1042
|
-
netSellVolume: number | null;
|
|
1043
|
-
/** 卖量占比 */
|
|
1044
|
-
sellVolumeRatio: number | null;
|
|
1045
|
-
/** 买量 */
|
|
1046
|
-
buyVolume: number | null;
|
|
1047
|
-
/** 买量变化 */
|
|
1048
|
-
buyVolumeChange: number | null;
|
|
1049
|
-
/** 净买量 */
|
|
1050
|
-
netBuyVolume: number | null;
|
|
1051
|
-
/** 买量占比 */
|
|
1052
|
-
buyVolumeRatio: number | null;
|
|
1053
|
-
/** 卖持仓 */
|
|
1054
|
-
sellPosition: number | null;
|
|
1055
|
-
/** 卖持仓变化 */
|
|
1056
|
-
sellPositionChange: number | null;
|
|
1057
|
-
/** 净卖持仓 */
|
|
1058
|
-
netSellPosition: number | null;
|
|
1059
|
-
/** 卖持仓占比 */
|
|
1060
|
-
sellPositionRatio: number | null;
|
|
1061
|
-
/** 买持仓 */
|
|
1062
|
-
buyPosition: number | null;
|
|
1063
|
-
/** 买持仓变化 */
|
|
1064
|
-
buyPositionChange: number | null;
|
|
1065
|
-
/** 净买持仓 */
|
|
1066
|
-
netBuyPosition: number | null;
|
|
1067
|
-
/** 买持仓占比 */
|
|
1068
|
-
buyPositionRatio: number | null;
|
|
1646
|
+
/** 融资余额(元) */
|
|
1647
|
+
finBalance: number | null;
|
|
1648
|
+
/** 融资买入额(元) */
|
|
1649
|
+
finBuyAmount: number | null;
|
|
1650
|
+
/** 融资偿还额(元) */
|
|
1651
|
+
finRepayAmount: number | null;
|
|
1652
|
+
/** 融券余量(股) */
|
|
1653
|
+
loanBalance: number | null;
|
|
1654
|
+
/** 融券卖出量(股) */
|
|
1655
|
+
loanSellVolume: number | null;
|
|
1656
|
+
/** 融券偿还量(股) */
|
|
1657
|
+
loanRepayVolume: number | null;
|
|
1069
1658
|
}
|
|
1070
1659
|
|
|
1071
1660
|
/**
|
|
@@ -1149,18 +1738,6 @@ interface GetUSCodeListOptions {
|
|
|
1149
1738
|
market?: USMarket;
|
|
1150
1739
|
}
|
|
1151
1740
|
|
|
1152
|
-
/**
|
|
1153
|
-
* 腾讯 Smartbox 搜索接口
|
|
1154
|
-
* 支持浏览器(JSONP)和 Node.js(fetch)双端
|
|
1155
|
-
*/
|
|
1156
|
-
|
|
1157
|
-
/** 全局变量声明(浏览器环境)*/
|
|
1158
|
-
declare global {
|
|
1159
|
-
interface Window {
|
|
1160
|
-
v_hint?: string;
|
|
1161
|
-
}
|
|
1162
|
-
}
|
|
1163
|
-
|
|
1164
1741
|
/**
|
|
1165
1742
|
* 东方财富 - A 股 K 线
|
|
1166
1743
|
*/
|
|
@@ -1317,6 +1894,110 @@ interface ComexInventoryOptions {
|
|
|
1317
1894
|
pageSize?: number;
|
|
1318
1895
|
}
|
|
1319
1896
|
|
|
1897
|
+
/**
|
|
1898
|
+
* 东方财富 datacenter-web 通用请求器
|
|
1899
|
+
* 统一封装分页拉取、参数构建、响应解析。
|
|
1900
|
+
*
|
|
1901
|
+
* 覆盖场景:北向资金、龙虎榜、融资融券、大宗交易、股东分析等所有
|
|
1902
|
+
* 走 `https://datacenter-web.eastmoney.com/api/data/v1/get` 的接口。
|
|
1903
|
+
*/
|
|
1904
|
+
|
|
1905
|
+
/**
|
|
1906
|
+
* datacenter 查询参数
|
|
1907
|
+
*/
|
|
1908
|
+
interface DatacenterQuery {
|
|
1909
|
+
/** 报表名称(如 RPT_MUTUAL_STOCK_NORTHSTA) */
|
|
1910
|
+
reportName: string;
|
|
1911
|
+
/** 返回字段,默认 'ALL' */
|
|
1912
|
+
columns?: string;
|
|
1913
|
+
/** 过滤表达式,如 (TRADE_DATE='2024-01-15') */
|
|
1914
|
+
filter?: string;
|
|
1915
|
+
/** 排序字段(多个用逗号分隔) */
|
|
1916
|
+
sortColumns?: string;
|
|
1917
|
+
/** 排序方向:'-1' 降序, '1' 升序(多个用逗号分隔) */
|
|
1918
|
+
sortTypes?: string;
|
|
1919
|
+
/** 每页大小,默认 500 */
|
|
1920
|
+
pageSize?: number;
|
|
1921
|
+
/** 起始页码,默认 1 */
|
|
1922
|
+
startPage?: number;
|
|
1923
|
+
/** 是否自动拉取全部分页,默认 true */
|
|
1924
|
+
fetchAllPages?: boolean;
|
|
1925
|
+
/**
|
|
1926
|
+
* 最大拉取页数(仅作为死循环安全阀,默认 1000)。
|
|
1927
|
+
*
|
|
1928
|
+
* 取较大默认值是为了恢复原 dividend / futuresInventory 等接口"拉完所有页"的语义;
|
|
1929
|
+
* 大多数 datacenter 接口分页远低于此上限。如果确实希望限制拉取页数,
|
|
1930
|
+
* 调用方应显式传入较小的 `maxPages` 值。
|
|
1931
|
+
*
|
|
1932
|
+
* 命中此上限时会在 console 输出 warning 提示,避免数据被静默截断。
|
|
1933
|
+
*/
|
|
1934
|
+
maxPages?: number;
|
|
1935
|
+
/** 额外的 quoteColumns 参数(用于行情字段聚合) */
|
|
1936
|
+
quoteColumns?: string;
|
|
1937
|
+
/** 额外的 quoteType 参数 */
|
|
1938
|
+
quoteType?: string;
|
|
1939
|
+
/** 额外补充的查询参数(覆盖默认值,用于个别接口的特殊字段) */
|
|
1940
|
+
extraParams?: Record<string, string>;
|
|
1941
|
+
}
|
|
1942
|
+
/**
|
|
1943
|
+
* datacenter 分页响应
|
|
1944
|
+
*/
|
|
1945
|
+
interface DatacenterResult<T> {
|
|
1946
|
+
/** 解析后的数据列表 */
|
|
1947
|
+
data: T[];
|
|
1948
|
+
/** 总记录数(来自首页) */
|
|
1949
|
+
total: number;
|
|
1950
|
+
/** 总页数(来自首页) */
|
|
1951
|
+
pages: number;
|
|
1952
|
+
}
|
|
1953
|
+
|
|
1954
|
+
/**
|
|
1955
|
+
* 东方财富 - 资金流向
|
|
1956
|
+
* 数据来源:
|
|
1957
|
+
* - 个股/板块资金流历史: https://push2his.eastmoney.com/api/qt/stock/fflow/daykline/get
|
|
1958
|
+
* - 资金流排名: https://push2.eastmoney.com/api/qt/clist/get
|
|
1959
|
+
*/
|
|
1960
|
+
|
|
1961
|
+
/** 资金流周期 */
|
|
1962
|
+
interface FundFlowOptions {
|
|
1963
|
+
/** 周期: 'daily' | 'weekly' | 'monthly',默认 'daily' */
|
|
1964
|
+
period?: 'daily' | 'weekly' | 'monthly';
|
|
1965
|
+
}
|
|
1966
|
+
/** 资金流排名维度 */
|
|
1967
|
+
interface FundFlowRankOptions {
|
|
1968
|
+
/** 排名周期: 'today' | '3day' | '5day' | '10day',默认 'today' */
|
|
1969
|
+
indicator?: 'today' | '3day' | '5day' | '10day';
|
|
1970
|
+
/** 板块类型(仅 getSectorFundFlowRank 使用): 'industry' | 'concept' | 'region' */
|
|
1971
|
+
sectorType?: 'industry' | 'concept' | 'region';
|
|
1972
|
+
}
|
|
1973
|
+
|
|
1974
|
+
/**
|
|
1975
|
+
* 东方财富 - 沪深港通 / 北向资金
|
|
1976
|
+
* 数据来源:
|
|
1977
|
+
* - 分时数据: https://push2.eastmoney.com/api/qt/kamtbs.rtmin/get
|
|
1978
|
+
* - 资金流向汇总/排行/历史: datacenter-web RPT_MUTUAL_*
|
|
1979
|
+
*/
|
|
1980
|
+
|
|
1981
|
+
/** 北向持股排行选项 */
|
|
1982
|
+
interface NorthboundHoldingRankOptions {
|
|
1983
|
+
/** 市场: 'all' | 'shanghai' | 'shenzhen',默认 'all' */
|
|
1984
|
+
market?: NorthboundMarket;
|
|
1985
|
+
/** 排名周期,默认 '5day' */
|
|
1986
|
+
period?: NorthboundRankPeriod;
|
|
1987
|
+
/**
|
|
1988
|
+
* 指定交易日 YYYY-MM-DD(默认服务端最新交易日)。
|
|
1989
|
+
* 注意:必须是有数据的交易日,否则返回空数组。
|
|
1990
|
+
*/
|
|
1991
|
+
date?: string;
|
|
1992
|
+
}
|
|
1993
|
+
/** 北向资金历史/个股持仓选项 */
|
|
1994
|
+
interface NorthboundHistoryOptions {
|
|
1995
|
+
/** 起始日期 YYYY-MM-DD */
|
|
1996
|
+
startDate?: string;
|
|
1997
|
+
/** 结束日期 YYYY-MM-DD */
|
|
1998
|
+
endDate?: string;
|
|
1999
|
+
}
|
|
2000
|
+
|
|
1320
2001
|
interface OHLCV {
|
|
1321
2002
|
open: number | null;
|
|
1322
2003
|
high: number | null;
|
|
@@ -1851,17 +2532,88 @@ type KlineWithIndicators<T extends HistoryKline | HKUSHistoryKline> = T & {
|
|
|
1851
2532
|
*/
|
|
1852
2533
|
declare function addIndicators<T extends HistoryKline | HKUSHistoryKline>(klines: T[], options?: IndicatorOptions): KlineWithIndicators<T>[];
|
|
1853
2534
|
|
|
2535
|
+
type BaseKline = HistoryKline | HKUSHistoryKline;
|
|
2536
|
+
type IndicatorKey = keyof IndicatorOptions;
|
|
2537
|
+
interface IndicatorComputationContext {
|
|
2538
|
+
closes: (number | null)[];
|
|
2539
|
+
ohlcv: OHLCV[];
|
|
2540
|
+
}
|
|
2541
|
+
interface IndicatorLookback {
|
|
2542
|
+
bars: number;
|
|
2543
|
+
emaBased?: boolean;
|
|
2544
|
+
}
|
|
2545
|
+
interface IndicatorDescriptor<K extends IndicatorKey = IndicatorKey> {
|
|
2546
|
+
key: K;
|
|
2547
|
+
estimateLookback: (option: IndicatorOptions[K]) => IndicatorLookback;
|
|
2548
|
+
compute: (context: IndicatorComputationContext, option: IndicatorOptions[K]) => unknown[];
|
|
2549
|
+
}
|
|
2550
|
+
type IndicatorDescriptorMap = {
|
|
2551
|
+
[K in IndicatorKey]: IndicatorDescriptor<K>;
|
|
2552
|
+
};
|
|
2553
|
+
declare function buildIndicatorContext<T extends BaseKline>(klines: T[]): IndicatorComputationContext;
|
|
2554
|
+
declare const INDICATOR_REGISTRY: IndicatorDescriptorMap;
|
|
2555
|
+
declare function getEnabledIndicatorKeys(options: IndicatorOptions): IndicatorKey[];
|
|
2556
|
+
declare function estimateIndicatorLookback(options: IndicatorOptions): {
|
|
2557
|
+
maxLookback: number;
|
|
2558
|
+
hasEmaBasedIndicator: boolean;
|
|
2559
|
+
requiredBars: number;
|
|
2560
|
+
};
|
|
2561
|
+
|
|
1854
2562
|
/**
|
|
1855
|
-
*
|
|
1856
|
-
*
|
|
2563
|
+
* 腾讯 Smartbox 搜索接口
|
|
2564
|
+
* 支持浏览器(JSONP)和 Node.js(fetch)双端
|
|
1857
2565
|
*/
|
|
1858
2566
|
|
|
2567
|
+
/** 全局变量声明(浏览器环境)*/
|
|
2568
|
+
declare global {
|
|
2569
|
+
interface Window {
|
|
2570
|
+
v_hint?: string;
|
|
2571
|
+
}
|
|
2572
|
+
}
|
|
2573
|
+
|
|
2574
|
+
type MarketType = 'A' | 'HK' | 'US';
|
|
1859
2575
|
/**
|
|
1860
|
-
*
|
|
2576
|
+
* `getKlineWithIndicators` 的请求参数
|
|
1861
2577
|
*/
|
|
1862
|
-
|
|
2578
|
+
interface KlineWithIndicatorsOptions {
|
|
2579
|
+
/**
|
|
2580
|
+
* 市场类型
|
|
2581
|
+
* - 不传时由 SDK 根据 `symbol` 自动识别
|
|
2582
|
+
* - A 股 / 港股 / 美股 => 'A' / 'HK' / 'US'
|
|
2583
|
+
*/
|
|
2584
|
+
market?: MarketType;
|
|
2585
|
+
/** K 线周期,默认 `'daily'` */
|
|
2586
|
+
period?: 'daily' | 'weekly' | 'monthly';
|
|
2587
|
+
/** 复权方式:`''` 不复权 / `'qfq'` 前复权 / `'hfq'` 后复权 */
|
|
2588
|
+
adjust?: '' | 'qfq' | 'hfq';
|
|
2589
|
+
/**
|
|
2590
|
+
* 起始日期(`YYYYMMDD` 或 `YYYY-MM-DD`)
|
|
2591
|
+
* - SDK 会根据指标依赖自动向前多取若干 bar,以保证首日指标有效
|
|
2592
|
+
*/
|
|
2593
|
+
startDate?: string;
|
|
2594
|
+
/** 结束日期(`YYYYMMDD` 或 `YYYY-MM-DD`) */
|
|
2595
|
+
endDate?: string;
|
|
2596
|
+
/**
|
|
2597
|
+
* 指标配置
|
|
2598
|
+
* - 仅传入 key(如 `{ ma: [5, 10] }`)即可启用对应指标
|
|
2599
|
+
* - 完整选项参见 `IndicatorOptions`
|
|
2600
|
+
*/
|
|
2601
|
+
indicators?: IndicatorOptions;
|
|
2602
|
+
}
|
|
2603
|
+
|
|
1863
2604
|
declare class StockSDK {
|
|
1864
|
-
private client;
|
|
2605
|
+
private readonly client;
|
|
2606
|
+
private readonly quoteService;
|
|
2607
|
+
private readonly boardService;
|
|
2608
|
+
private readonly klineService;
|
|
2609
|
+
private readonly futuresService;
|
|
2610
|
+
private readonly optionsService;
|
|
2611
|
+
private readonly indicatorService;
|
|
2612
|
+
private readonly fundFlowService;
|
|
2613
|
+
private readonly northboundService;
|
|
2614
|
+
private readonly marketEventService;
|
|
2615
|
+
private readonly dragonTigerService;
|
|
2616
|
+
private readonly dataService;
|
|
1865
2617
|
/**
|
|
1866
2618
|
* 创建 Stock SDK 实例。
|
|
1867
2619
|
* 旧的全局 `timeout` / `retry` / `rateLimit` / `circuitBreaker` 配置继续有效,
|
|
@@ -1869,452 +2621,387 @@ declare class StockSDK {
|
|
|
1869
2621
|
*/
|
|
1870
2622
|
constructor(options?: RequestClientOptions);
|
|
1871
2623
|
/**
|
|
1872
|
-
* 获取 A
|
|
1873
|
-
* @param codes
|
|
2624
|
+
* 获取 A 股完整行情(腾讯接口)
|
|
2625
|
+
* @param codes 股票代码数组(如 `['sh600519', 'sz000001']`)
|
|
1874
2626
|
*/
|
|
1875
2627
|
getFullQuotes(codes: string[]): Promise<FullQuote[]>;
|
|
1876
2628
|
/**
|
|
1877
|
-
*
|
|
1878
|
-
* @param codes
|
|
2629
|
+
* 获取 A 股简化行情(腾讯接口)
|
|
2630
|
+
* @param codes 股票代码数组
|
|
1879
2631
|
*/
|
|
1880
2632
|
getSimpleQuotes(codes: string[]): Promise<SimpleQuote[]>;
|
|
1881
2633
|
/**
|
|
1882
|
-
*
|
|
1883
|
-
* @param codes
|
|
2634
|
+
* 获取港股行情
|
|
2635
|
+
* @param codes 港股代码数组(如 `['hk00700']`)
|
|
1884
2636
|
*/
|
|
1885
2637
|
getHKQuotes(codes: string[]): Promise<HKQuote[]>;
|
|
1886
2638
|
/**
|
|
1887
|
-
*
|
|
1888
|
-
* @param codes
|
|
2639
|
+
* 获取美股行情
|
|
2640
|
+
* @param codes 美股代码数组(如 `['usAAPL']`)
|
|
1889
2641
|
*/
|
|
1890
2642
|
getUSQuotes(codes: string[]): Promise<USQuote[]>;
|
|
1891
2643
|
/**
|
|
1892
|
-
*
|
|
1893
|
-
* @param codes
|
|
2644
|
+
* 获取基金行情(场内/场外)
|
|
2645
|
+
* @param codes 基金代码数组
|
|
1894
2646
|
*/
|
|
1895
2647
|
getFundQuotes(codes: string[]): Promise<FundQuote[]>;
|
|
1896
2648
|
/**
|
|
1897
|
-
*
|
|
1898
|
-
* @param codes
|
|
2649
|
+
* 获取资金流向数据
|
|
2650
|
+
* @param codes 股票代码数组
|
|
1899
2651
|
*/
|
|
1900
2652
|
getFundFlow(codes: string[]): Promise<FundFlow[]>;
|
|
1901
2653
|
/**
|
|
1902
|
-
*
|
|
1903
|
-
* @param codes
|
|
2654
|
+
* 获取盘口大单/异动数据
|
|
2655
|
+
* @param codes 股票代码数组
|
|
1904
2656
|
*/
|
|
1905
2657
|
getPanelLargeOrder(codes: string[]): Promise<PanelLargeOrder[]>;
|
|
1906
2658
|
/**
|
|
1907
|
-
*
|
|
1908
|
-
* @param code
|
|
2659
|
+
* 获取当日分时数据
|
|
2660
|
+
* @param code 单只股票代码
|
|
1909
2661
|
*/
|
|
1910
2662
|
getTodayTimeline(code: string): Promise<TodayTimelineResponse>;
|
|
1911
2663
|
/**
|
|
1912
|
-
*
|
|
1913
|
-
* @returns 行业板块列表
|
|
2664
|
+
* 获取行业板块列表(东方财富)
|
|
1914
2665
|
*/
|
|
1915
2666
|
getIndustryList(): Promise<IndustryBoard[]>;
|
|
1916
2667
|
/**
|
|
1917
|
-
*
|
|
1918
|
-
* @param symbol
|
|
1919
|
-
* @returns 实时行情指标列表
|
|
2668
|
+
* 获取行业板块成分股实时行情
|
|
2669
|
+
* @param symbol 行业板块代码
|
|
1920
2670
|
*/
|
|
1921
2671
|
getIndustrySpot(symbol: string): Promise<IndustryBoardSpot[]>;
|
|
1922
2672
|
/**
|
|
1923
|
-
*
|
|
1924
|
-
* @param symbol
|
|
1925
|
-
* @returns 成分股列表
|
|
2673
|
+
* 获取行业板块成分股列表
|
|
2674
|
+
* @param symbol 行业板块代码
|
|
1926
2675
|
*/
|
|
1927
2676
|
getIndustryConstituents(symbol: string): Promise<IndustryBoardConstituent[]>;
|
|
1928
2677
|
/**
|
|
1929
|
-
* 获取行业板块历史 K
|
|
1930
|
-
* @param symbol
|
|
1931
|
-
* @param options
|
|
1932
|
-
* @returns 历史 K 线数据
|
|
2678
|
+
* 获取行业板块历史 K 线
|
|
2679
|
+
* @param symbol 行业板块代码
|
|
2680
|
+
* @param options K 线参数
|
|
1933
2681
|
*/
|
|
1934
2682
|
getIndustryKline(symbol: string, options?: IndustryBoardKlineOptions): Promise<IndustryBoardKline[]>;
|
|
1935
2683
|
/**
|
|
1936
|
-
*
|
|
1937
|
-
* @param symbol
|
|
1938
|
-
* @param options
|
|
1939
|
-
* @returns 分时行情数据
|
|
2684
|
+
* 获取行业板块分时/分钟 K 线
|
|
2685
|
+
* @param symbol 行业板块代码
|
|
2686
|
+
* @param options 周期参数(不传周期则返回当日分时)
|
|
1940
2687
|
*/
|
|
1941
2688
|
getIndustryMinuteKline(symbol: string, options?: IndustryBoardMinuteKlineOptions): Promise<IndustryBoardMinuteTimeline[] | IndustryBoardMinuteKline[]>;
|
|
1942
2689
|
/**
|
|
1943
|
-
*
|
|
1944
|
-
* @returns 概念板块列表
|
|
2690
|
+
* 获取概念板块列表(东方财富)
|
|
1945
2691
|
*/
|
|
1946
2692
|
getConceptList(): Promise<ConceptBoard[]>;
|
|
1947
2693
|
/**
|
|
1948
|
-
*
|
|
1949
|
-
* @param symbol
|
|
1950
|
-
* @returns 实时行情指标列表
|
|
2694
|
+
* 获取概念板块成分股实时行情
|
|
2695
|
+
* @param symbol 概念板块代码
|
|
1951
2696
|
*/
|
|
1952
2697
|
getConceptSpot(symbol: string): Promise<ConceptBoardSpot[]>;
|
|
1953
2698
|
/**
|
|
1954
|
-
*
|
|
1955
|
-
* @param symbol
|
|
1956
|
-
* @returns 成分股列表
|
|
2699
|
+
* 获取概念板块成分股列表
|
|
2700
|
+
* @param symbol 概念板块代码
|
|
1957
2701
|
*/
|
|
1958
2702
|
getConceptConstituents(symbol: string): Promise<ConceptBoardConstituent[]>;
|
|
1959
2703
|
/**
|
|
1960
|
-
* 获取概念板块历史 K
|
|
1961
|
-
* @param symbol
|
|
1962
|
-
* @param options
|
|
1963
|
-
* @returns 历史 K 线数据
|
|
2704
|
+
* 获取概念板块历史 K 线
|
|
2705
|
+
* @param symbol 概念板块代码
|
|
2706
|
+
* @param options K 线参数
|
|
1964
2707
|
*/
|
|
1965
2708
|
getConceptKline(symbol: string, options?: ConceptBoardKlineOptions): Promise<ConceptBoardKline[]>;
|
|
1966
2709
|
/**
|
|
1967
|
-
*
|
|
1968
|
-
* @param symbol
|
|
1969
|
-
* @param options
|
|
1970
|
-
* @returns 分时行情数据
|
|
2710
|
+
* 获取概念板块分时/分钟 K 线
|
|
2711
|
+
* @param symbol 概念板块代码
|
|
2712
|
+
* @param options 周期参数(不传周期则返回当日分时)
|
|
1971
2713
|
*/
|
|
1972
2714
|
getConceptMinuteKline(symbol: string, options?: ConceptBoardMinuteKlineOptions): Promise<ConceptBoardMinuteTimeline[] | ConceptBoardMinuteKline[]>;
|
|
1973
2715
|
/**
|
|
1974
|
-
* 获取 A 股历史 K
|
|
2716
|
+
* 获取 A 股历史 K 线(日/周/月,含复权)
|
|
2717
|
+
* @param symbol 股票代码
|
|
2718
|
+
* @param options K 线参数
|
|
1975
2719
|
*/
|
|
1976
2720
|
getHistoryKline(symbol: string, options?: HistoryKlineOptions): Promise<HistoryKline[]>;
|
|
1977
2721
|
/**
|
|
1978
|
-
* 获取 A
|
|
2722
|
+
* 获取 A 股分时/分钟 K 线
|
|
2723
|
+
* @param symbol 股票代码
|
|
2724
|
+
* @param options 周期参数(不传周期则返回当日分时)
|
|
1979
2725
|
*/
|
|
1980
2726
|
getMinuteKline(symbol: string, options?: MinuteKlineOptions): Promise<MinuteTimeline[] | MinuteKline[]>;
|
|
1981
2727
|
/**
|
|
1982
|
-
* 获取港股历史 K
|
|
2728
|
+
* 获取港股历史 K 线
|
|
2729
|
+
* @param symbol 港股代码
|
|
2730
|
+
* @param options K 线参数
|
|
1983
2731
|
*/
|
|
1984
2732
|
getHKHistoryKline(symbol: string, options?: HKKlineOptions): Promise<HKUSHistoryKline[]>;
|
|
1985
2733
|
/**
|
|
1986
|
-
* 获取美股历史 K
|
|
2734
|
+
* 获取美股历史 K 线
|
|
2735
|
+
* @param symbol 美股代码
|
|
2736
|
+
* @param options K 线参数
|
|
1987
2737
|
*/
|
|
1988
2738
|
getUSHistoryKline(symbol: string, options?: USKlineOptions): Promise<HKUSHistoryKline[]>;
|
|
1989
2739
|
/**
|
|
1990
|
-
*
|
|
1991
|
-
* @param keyword
|
|
2740
|
+
* 模糊搜索股票/指数/基金等
|
|
2741
|
+
* @param keyword 关键词(代码 / 名称 / 拼音)
|
|
1992
2742
|
*/
|
|
1993
2743
|
search(keyword: string): Promise<SearchResult[]>;
|
|
1994
2744
|
/**
|
|
1995
|
-
*
|
|
1996
|
-
* @param options
|
|
1997
|
-
*
|
|
1998
|
-
* @example
|
|
1999
|
-
* // 获取全部 A 股(带交易所前缀)
|
|
2000
|
-
* const codes = await sdk.getAShareCodeList();
|
|
2001
|
-
*
|
|
2002
|
-
* @example
|
|
2003
|
-
* // 获取全部 A 股(不带交易所前缀)
|
|
2004
|
-
* const codes = await sdk.getAShareCodeList({ simple: true });
|
|
2005
|
-
*
|
|
2006
|
-
* @example
|
|
2007
|
-
* // 获取科创板股票
|
|
2008
|
-
* const codes = await sdk.getAShareCodeList({ market: 'kc' });
|
|
2009
|
-
*
|
|
2010
|
-
* @example
|
|
2011
|
-
* // 获取创业板股票(不带前缀)
|
|
2012
|
-
* const codes = await sdk.getAShareCodeList({ simple: true, market: 'cy' });
|
|
2745
|
+
* 获取 A 股全量代码列表
|
|
2746
|
+
* @param options 过滤选项;传 `boolean` 兼容旧版「是否包含交易所前缀」用法
|
|
2013
2747
|
*/
|
|
2014
2748
|
getAShareCodeList(options?: GetAShareCodeListOptions | boolean): Promise<string[]>;
|
|
2015
2749
|
/**
|
|
2016
|
-
*
|
|
2017
|
-
* @param options
|
|
2018
|
-
*
|
|
2019
|
-
* @example
|
|
2020
|
-
* // 获取全部美股(带市场前缀)
|
|
2021
|
-
* const codes = await sdk.getUSCodeList();
|
|
2022
|
-
* // ['105.AAPL', '106.BABA', ...]
|
|
2023
|
-
*
|
|
2024
|
-
* @example
|
|
2025
|
-
* // 获取全部美股(不带市场前缀)
|
|
2026
|
-
* const codes = await sdk.getUSCodeList({ simple: true });
|
|
2027
|
-
* // ['AAPL', 'BABA', ...]
|
|
2028
|
-
*
|
|
2029
|
-
* @example
|
|
2030
|
-
* // 筛选纳斯达克股票
|
|
2031
|
-
* const codes = await sdk.getUSCodeList({ market: 'NASDAQ' });
|
|
2032
|
-
* // ['105.AAPL', ...]
|
|
2033
|
-
*
|
|
2034
|
-
* @example
|
|
2035
|
-
* // 筛选纽交所股票
|
|
2036
|
-
* const codes = await sdk.getUSCodeList({ market: 'NYSE' });
|
|
2037
|
-
* // ['106.BABA', ...]
|
|
2750
|
+
* 获取美股全量代码列表
|
|
2751
|
+
* @param options 过滤选项;传 `boolean` 兼容旧版「是否包含市场前缀」用法
|
|
2038
2752
|
*/
|
|
2039
2753
|
getUSCodeList(options?: GetUSCodeListOptions | boolean): Promise<string[]>;
|
|
2040
2754
|
/**
|
|
2041
|
-
*
|
|
2755
|
+
* 获取港股全量代码列表
|
|
2042
2756
|
*/
|
|
2043
2757
|
getHKCodeList(): Promise<string[]>;
|
|
2044
2758
|
/**
|
|
2045
|
-
*
|
|
2046
|
-
* @returns 基金代码数组(6 位代码)
|
|
2047
|
-
*
|
|
2048
|
-
* @example
|
|
2049
|
-
* const codes = await sdk.getFundCodeList();
|
|
2050
|
-
* console.log(codes.length); // 26068
|
|
2759
|
+
* 获取基金全量代码列表
|
|
2051
2760
|
*/
|
|
2052
2761
|
getFundCodeList(): Promise<string[]>;
|
|
2053
2762
|
/**
|
|
2054
|
-
*
|
|
2055
|
-
* @param options
|
|
2056
|
-
*
|
|
2057
|
-
* @example
|
|
2058
|
-
* // 获取全部 A 股行情
|
|
2059
|
-
* const quotes = await sdk.getAllAShareQuotes();
|
|
2060
|
-
*
|
|
2061
|
-
* @example
|
|
2062
|
-
* // 获取科创板行情
|
|
2063
|
-
* const kcQuotes = await sdk.getAllAShareQuotes({ market: 'kc' });
|
|
2064
|
-
*
|
|
2065
|
-
* @example
|
|
2066
|
-
* // 获取创业板行情
|
|
2067
|
-
* const cyQuotes = await sdk.getAllAShareQuotes({ market: 'cy' });
|
|
2763
|
+
* 批量拉取全部 A 股完整行情
|
|
2764
|
+
* @param options 批量请求参数(如批大小、并发等)
|
|
2068
2765
|
*/
|
|
2069
2766
|
getAllAShareQuotes(options?: GetAllAShareQuotesOptions): Promise<FullQuote[]>;
|
|
2070
2767
|
/**
|
|
2071
|
-
*
|
|
2768
|
+
* 批量拉取全部港股行情
|
|
2769
|
+
* @param options 批量请求参数
|
|
2072
2770
|
*/
|
|
2073
2771
|
getAllHKShareQuotes(options?: GetAllAShareQuotesOptions): Promise<HKQuote[]>;
|
|
2074
2772
|
/**
|
|
2075
|
-
*
|
|
2076
|
-
* @param options
|
|
2077
|
-
*
|
|
2078
|
-
* @example
|
|
2079
|
-
* // 获取全部美股行情
|
|
2080
|
-
* const quotes = await sdk.getAllUSShareQuotes();
|
|
2081
|
-
*
|
|
2082
|
-
* @example
|
|
2083
|
-
* // 获取纳斯达克股票行情
|
|
2084
|
-
* const nasdaqQuotes = await sdk.getAllUSShareQuotes({ market: 'NASDAQ' });
|
|
2085
|
-
*
|
|
2086
|
-
* @example
|
|
2087
|
-
* // 获取纽交所股票行情(带进度回调)
|
|
2088
|
-
* const nyseQuotes = await sdk.getAllUSShareQuotes({
|
|
2089
|
-
* market: 'NYSE',
|
|
2090
|
-
* onProgress: (completed, total) => console.log(`${completed}/${total}`)
|
|
2091
|
-
* });
|
|
2773
|
+
* 批量拉取全部美股行情
|
|
2774
|
+
* @param options 批量请求参数
|
|
2092
2775
|
*/
|
|
2093
2776
|
getAllUSShareQuotes(options?: GetAllUSQuotesOptions): Promise<USQuote[]>;
|
|
2094
2777
|
/**
|
|
2095
|
-
*
|
|
2778
|
+
* 按给定代码列表批量拉取完整行情
|
|
2779
|
+
* @param codes 股票代码数组
|
|
2780
|
+
* @param options 批量请求参数
|
|
2096
2781
|
*/
|
|
2097
2782
|
getAllQuotesByCodes(codes: string[], options?: GetAllAShareQuotesOptions): Promise<FullQuote[]>;
|
|
2098
2783
|
/**
|
|
2099
|
-
*
|
|
2100
|
-
* @param params
|
|
2784
|
+
* 直接调用腾讯批量行情原始接口(高级用法)
|
|
2785
|
+
* @param params 拼接后的查询参数(如 `'sh600519,sz000001'`)
|
|
2101
2786
|
*/
|
|
2102
2787
|
batchRaw(params: string): Promise<{
|
|
2103
2788
|
key: string;
|
|
2104
2789
|
fields: string[];
|
|
2105
2790
|
}[]>;
|
|
2106
2791
|
/**
|
|
2107
|
-
*
|
|
2108
|
-
* @returns 交易日期字符串数组,格式如 ['1990-12-19', '1990-12-20', ...]
|
|
2792
|
+
* 获取交易日历(A 股)
|
|
2109
2793
|
*/
|
|
2110
2794
|
getTradingCalendar(): Promise<string[]>;
|
|
2111
2795
|
/**
|
|
2112
|
-
*
|
|
2113
|
-
* @param symbol
|
|
2114
|
-
* @returns 分红派送详情列表,按报告日期降序排列
|
|
2115
|
-
*
|
|
2116
|
-
* @example
|
|
2117
|
-
* // 获取贵州茅台的分红历史
|
|
2118
|
-
* const dividends = await sdk.getDividendDetail('600519');
|
|
2119
|
-
* console.log(dividends[0].dividendPretax); // 每10股派息(税前)
|
|
2796
|
+
* 获取分红配股明细
|
|
2797
|
+
* @param symbol 股票代码
|
|
2120
2798
|
*/
|
|
2121
2799
|
getDividendDetail(symbol: string): Promise<DividendDetail[]>;
|
|
2122
2800
|
/**
|
|
2123
|
-
* 获取国内期货历史 K
|
|
2124
|
-
* @param symbol
|
|
2125
|
-
* @param options
|
|
2126
|
-
* @returns 期货 K 线数据数组
|
|
2127
|
-
*
|
|
2128
|
-
* @example
|
|
2129
|
-
* // 获取螺纹钢主连日K
|
|
2130
|
-
* const klines = await sdk.getFuturesKline('RBM');
|
|
2131
|
-
*
|
|
2132
|
-
* @example
|
|
2133
|
-
* // 获取沪深300期货具体合约周K
|
|
2134
|
-
* const klines = await sdk.getFuturesKline('IF2604', { period: 'weekly' });
|
|
2801
|
+
* 获取国内期货历史 K 线
|
|
2802
|
+
* @param symbol 期货合约代码
|
|
2803
|
+
* @param options K 线参数
|
|
2135
2804
|
*/
|
|
2136
2805
|
getFuturesKline(symbol: string, options?: FuturesKlineOptions): Promise<FuturesKline[]>;
|
|
2137
2806
|
/**
|
|
2138
2807
|
* 获取全球期货实时行情
|
|
2139
|
-
* @param options
|
|
2140
|
-
* @returns 全球期货行情数组
|
|
2141
|
-
*
|
|
2142
|
-
* @example
|
|
2143
|
-
* const quotes = await sdk.getGlobalFuturesSpot();
|
|
2144
|
-
* console.log(quotes[0].name); // "COMEX铜"
|
|
2808
|
+
* @param options 筛选选项
|
|
2145
2809
|
*/
|
|
2146
2810
|
getGlobalFuturesSpot(options?: GlobalFuturesSpotOptions): Promise<GlobalFuturesQuote[]>;
|
|
2147
2811
|
/**
|
|
2148
|
-
* 获取全球期货历史 K
|
|
2149
|
-
* @param symbol
|
|
2150
|
-
* @param options
|
|
2151
|
-
* @returns 期货 K 线数据数组
|
|
2152
|
-
*
|
|
2153
|
-
* @example
|
|
2154
|
-
* const klines = await sdk.getGlobalFuturesKline('HG00Y');
|
|
2812
|
+
* 获取全球期货历史 K 线
|
|
2813
|
+
* @param symbol 期货合约代码
|
|
2814
|
+
* @param options K 线参数
|
|
2155
2815
|
*/
|
|
2156
2816
|
getGlobalFuturesKline(symbol: string, options?: GlobalFuturesKlineOptions): Promise<FuturesKline[]>;
|
|
2157
2817
|
/**
|
|
2158
2818
|
* 获取期货库存品种列表
|
|
2159
|
-
* @returns 品种列表(code + name + marketCode)
|
|
2160
|
-
*
|
|
2161
|
-
* @example
|
|
2162
|
-
* const symbols = await sdk.getFuturesInventorySymbols();
|
|
2163
|
-
* console.log(symbols); // [{code: 'rb', name: '螺纹钢', marketCode: '...'}]
|
|
2164
2819
|
*/
|
|
2165
2820
|
getFuturesInventorySymbols(): Promise<FuturesInventorySymbol[]>;
|
|
2166
2821
|
/**
|
|
2167
|
-
*
|
|
2168
|
-
* @param symbol
|
|
2169
|
-
* @param options
|
|
2170
|
-
* @returns 库存数据数组
|
|
2171
|
-
*
|
|
2172
|
-
* @example
|
|
2173
|
-
* const inventory = await sdk.getFuturesInventory('rb');
|
|
2822
|
+
* 获取指定品种的期货库存历史
|
|
2823
|
+
* @param symbol 品种代码
|
|
2824
|
+
* @param options 查询参数
|
|
2174
2825
|
*/
|
|
2175
2826
|
getFuturesInventory(symbol: string, options?: FuturesInventoryOptions): Promise<FuturesInventory[]>;
|
|
2176
2827
|
/**
|
|
2177
|
-
* 获取 COMEX
|
|
2178
|
-
* @param symbol
|
|
2179
|
-
* @param options
|
|
2180
|
-
* @returns COMEX 库存数据数组
|
|
2181
|
-
*
|
|
2182
|
-
* @example
|
|
2183
|
-
* const goldInventory = await sdk.getComexInventory('gold');
|
|
2828
|
+
* 获取 COMEX 黄金/白银库存
|
|
2829
|
+
* @param symbol `'gold'` 或 `'silver'`
|
|
2830
|
+
* @param options 查询参数
|
|
2184
2831
|
*/
|
|
2185
2832
|
getComexInventory(symbol: 'gold' | 'silver', options?: ComexInventoryOptions): Promise<ComexInventory[]>;
|
|
2186
2833
|
/**
|
|
2187
|
-
*
|
|
2188
|
-
* @param product
|
|
2189
|
-
* @param contract
|
|
2190
|
-
*
|
|
2191
|
-
* @example
|
|
2192
|
-
* const spot = await sdk.getIndexOptionSpot('io', 'io2504');
|
|
2193
|
-
* console.log(spot.calls[0].strikePrice); // 行权价
|
|
2834
|
+
* 获取股指期权 T 型报价
|
|
2835
|
+
* @param product 期权品种
|
|
2836
|
+
* @param contract 合约月份等参数
|
|
2194
2837
|
*/
|
|
2195
2838
|
getIndexOptionSpot(product: IndexOptionProduct, contract: string): Promise<OptionTQuoteResult>;
|
|
2196
2839
|
/**
|
|
2197
|
-
*
|
|
2198
|
-
* @param symbol
|
|
2199
|
-
*
|
|
2200
|
-
* @example
|
|
2201
|
-
* const klines = await sdk.getIndexOptionKline('io2504C3600');
|
|
2840
|
+
* 获取股指期权日 K 线
|
|
2841
|
+
* @param symbol 合约代码
|
|
2202
2842
|
*/
|
|
2203
2843
|
getIndexOptionKline(symbol: string): Promise<OptionKline[]>;
|
|
2204
2844
|
/**
|
|
2205
|
-
*
|
|
2206
|
-
*
|
|
2207
|
-
* @example
|
|
2208
|
-
* const quotes = await sdk.getCFFEXOptionQuotes();
|
|
2209
|
-
* console.log(quotes[0].code); // 'MO2603-P-8200'
|
|
2845
|
+
* 获取中金所期权当日报价(IO/MO 等)
|
|
2846
|
+
* @param options 筛选选项
|
|
2210
2847
|
*/
|
|
2211
2848
|
getCFFEXOptionQuotes(options?: CFFEXOptionQuotesOptions): Promise<CFFEXOptionQuote[]>;
|
|
2212
2849
|
/**
|
|
2213
|
-
*
|
|
2214
|
-
* @param cate
|
|
2215
|
-
*
|
|
2216
|
-
* @example
|
|
2217
|
-
* const info = await sdk.getETFOptionMonths('50ETF');
|
|
2218
|
-
* console.log(info.months); // ['2026-03', '2026-04', ...]
|
|
2850
|
+
* 获取 ETF 期权可用月份
|
|
2851
|
+
* @param cate ETF 期权品种
|
|
2219
2852
|
*/
|
|
2220
2853
|
getETFOptionMonths(cate: ETFOptionCate): Promise<ETFOptionMonth>;
|
|
2221
2854
|
/**
|
|
2222
|
-
*
|
|
2223
|
-
* @param cate
|
|
2224
|
-
* @param month
|
|
2225
|
-
*
|
|
2226
|
-
* @example
|
|
2227
|
-
* const info = await sdk.getETFOptionExpireDay('50ETF', '2026-03');
|
|
2228
|
-
* console.log(info.remainderDays); // 12
|
|
2855
|
+
* 获取 ETF 期权指定月份的合约列表/到期日
|
|
2856
|
+
* @param cate ETF 期权品种
|
|
2857
|
+
* @param month 月份(如 `'202405'`)
|
|
2229
2858
|
*/
|
|
2230
2859
|
getETFOptionExpireDay(cate: ETFOptionCate, month: string): Promise<ETFOptionExpireDay>;
|
|
2231
2860
|
/**
|
|
2232
|
-
*
|
|
2233
|
-
* @param code
|
|
2861
|
+
* 获取 ETF 期权当日分时
|
|
2862
|
+
* @param code 合约代码
|
|
2234
2863
|
*/
|
|
2235
2864
|
getETFOptionMinute(code: string): Promise<OptionMinute[]>;
|
|
2236
2865
|
/**
|
|
2237
|
-
*
|
|
2238
|
-
* @param code
|
|
2866
|
+
* 获取 ETF 期权日 K 线
|
|
2867
|
+
* @param code 合约代码
|
|
2239
2868
|
*/
|
|
2240
2869
|
getETFOptionDailyKline(code: string): Promise<OptionKline[]>;
|
|
2241
2870
|
/**
|
|
2242
|
-
*
|
|
2243
|
-
* @param code
|
|
2871
|
+
* 获取 ETF 期权 5 日分时
|
|
2872
|
+
* @param code 合约代码
|
|
2244
2873
|
*/
|
|
2245
2874
|
getETFOption5DayMinute(code: string): Promise<OptionMinute[]>;
|
|
2246
2875
|
/**
|
|
2247
2876
|
* 获取商品期权 T 型报价
|
|
2248
|
-
* @param variety
|
|
2249
|
-
* @param contract
|
|
2250
|
-
*
|
|
2251
|
-
* @example
|
|
2252
|
-
* const spot = await sdk.getCommodityOptionSpot('au', 'au2506');
|
|
2877
|
+
* @param variety 品种
|
|
2878
|
+
* @param contract 合约
|
|
2253
2879
|
*/
|
|
2254
2880
|
getCommodityOptionSpot(variety: string, contract: string): Promise<OptionTQuoteResult>;
|
|
2255
2881
|
/**
|
|
2256
|
-
*
|
|
2257
|
-
* @param symbol
|
|
2882
|
+
* 获取商品期权日 K 线
|
|
2883
|
+
* @param symbol 合约代码
|
|
2258
2884
|
*/
|
|
2259
2885
|
getCommodityOptionKline(symbol: string): Promise<OptionKline[]>;
|
|
2260
2886
|
/**
|
|
2261
2887
|
* 获取期权龙虎榜
|
|
2262
|
-
* @param symbol
|
|
2263
|
-
* @param date
|
|
2264
|
-
*
|
|
2265
|
-
* @example
|
|
2266
|
-
* const lhb = await sdk.getOptionLHB('510050', '2022-01-21');
|
|
2888
|
+
* @param symbol 合约代码
|
|
2889
|
+
* @param date 日期 `YYYY-MM-DD`
|
|
2267
2890
|
*/
|
|
2268
2891
|
getOptionLHB(symbol: string, date: string): Promise<OptionLHBItem[]>;
|
|
2269
2892
|
/**
|
|
2270
|
-
*
|
|
2893
|
+
* 获取带技术指标的 K 线(A 股 / 港股 / 美股自动识别)
|
|
2894
|
+
* @param symbol 股票代码
|
|
2895
|
+
* @param options 配置(市场、周期、复权、日期范围、指标列表等)
|
|
2896
|
+
* @see {@link KlineWithIndicatorsOptions}
|
|
2897
|
+
*/
|
|
2898
|
+
getKlineWithIndicators(symbol: string, options?: KlineWithIndicatorsOptions): Promise<KlineWithIndicators<HistoryKline | HKUSHistoryKline>[]>;
|
|
2899
|
+
/**
|
|
2900
|
+
* 获取个股资金流历史(日 / 周 / 月)
|
|
2901
|
+
* @param symbol 股票代码(支持带或不带 sh/sz/bj 前缀)
|
|
2902
|
+
* @param options 周期选项
|
|
2903
|
+
*/
|
|
2904
|
+
getIndividualFundFlow(symbol: string, options?: FundFlowOptions): Promise<StockFundFlowDaily[]>;
|
|
2905
|
+
/** 获取大盘资金流(上证 + 深证综合) */
|
|
2906
|
+
getMarketFundFlow(): Promise<MarketFundFlow[]>;
|
|
2907
|
+
/**
|
|
2908
|
+
* 获取个股资金流排名(沪深北 A 股全市场)
|
|
2909
|
+
* @param options 排名周期:'today' | '3day' | '5day' | '10day'
|
|
2910
|
+
*/
|
|
2911
|
+
getFundFlowRank(options?: FundFlowRankOptions): Promise<FundFlowRankItem[]>;
|
|
2912
|
+
/**
|
|
2913
|
+
* 获取板块资金流排名(行业 / 概念 / 地域)
|
|
2914
|
+
* @param options 排名周期 + 板块类型
|
|
2915
|
+
*/
|
|
2916
|
+
getSectorFundFlowRank(options?: FundFlowRankOptions): Promise<SectorFundFlowItem[]>;
|
|
2917
|
+
/**
|
|
2918
|
+
* 获取单个板块的历史资金流
|
|
2919
|
+
* @param symbol 板块编号(如 'BK0438' 或全前缀 '90.BK0438')
|
|
2920
|
+
* @param options 周期选项
|
|
2921
|
+
*/
|
|
2922
|
+
getSectorFundFlowHistory(symbol: string, options?: FundFlowOptions): Promise<StockFundFlowDaily[]>;
|
|
2923
|
+
/**
|
|
2924
|
+
* 获取北向 / 南向资金分时数据
|
|
2925
|
+
* @param direction 方向:'north' (北向,默认) 或 'south' (南向)
|
|
2926
|
+
*/
|
|
2927
|
+
getNorthboundMinute(direction?: NorthboundDirection): Promise<NorthboundMinuteItem[]>;
|
|
2928
|
+
/** 获取沪深港通市场资金流向汇总(北向 + 南向 + 港股通拆分) */
|
|
2929
|
+
getNorthboundFlowSummary(): Promise<NorthboundFlowSummary[]>;
|
|
2930
|
+
/**
|
|
2931
|
+
* 获取北向 / 沪股通 / 深股通持股个股排行
|
|
2932
|
+
* @param options 市场(沪/深/全部) + 周期
|
|
2933
|
+
*/
|
|
2934
|
+
getNorthboundHoldingRank(options?: NorthboundHoldingRankOptions): Promise<NorthboundHoldingRankItem[]>;
|
|
2935
|
+
/**
|
|
2936
|
+
* 获取北向 / 南向资金历史
|
|
2937
|
+
* @param direction 方向
|
|
2938
|
+
* @param options 起止日期
|
|
2939
|
+
*/
|
|
2940
|
+
getNorthboundHistory(direction?: NorthboundDirection, options?: NorthboundHistoryOptions): Promise<NorthboundHistoryItem[]>;
|
|
2941
|
+
/**
|
|
2942
|
+
* 获取个股的北向持仓历史
|
|
2943
|
+
* @param symbol 股票代码
|
|
2944
|
+
* @param options 起止日期
|
|
2945
|
+
*/
|
|
2946
|
+
getNorthboundIndividual(symbol: string, options?: NorthboundHistoryOptions): Promise<NorthboundIndividualItem[]>;
|
|
2947
|
+
/**
|
|
2948
|
+
* 获取涨停股池(涨停 / 昨日涨停 / 强势 / 次新 / 炸板 / 跌停)
|
|
2949
|
+
* @param type 池子类型,默认 'zt'
|
|
2950
|
+
* @param date 交易日 YYYYMMDD 或 YYYY-MM-DD(默认今天)
|
|
2951
|
+
*/
|
|
2952
|
+
getZTPool(type?: ZTPoolType, date?: string): Promise<ZTPoolItem[]>;
|
|
2953
|
+
/**
|
|
2954
|
+
* 获取个股盘口异动(共 22 种异动类型)
|
|
2955
|
+
* @param type 异动类型,默认 'large_buy'
|
|
2271
2956
|
*/
|
|
2272
|
-
|
|
2957
|
+
getStockChanges(type?: StockChangeType): Promise<StockChangeItem[]>;
|
|
2958
|
+
/** 获取板块异动详情(当日板块异动汇总) */
|
|
2959
|
+
getBoardChanges(): Promise<BoardChangeItem[]>;
|
|
2273
2960
|
/**
|
|
2274
|
-
*
|
|
2961
|
+
* 获取龙虎榜详情
|
|
2962
|
+
* @param options 起止日期 YYYYMMDD
|
|
2275
2963
|
*/
|
|
2276
|
-
|
|
2964
|
+
getDragonTigerDetail(options: DragonTigerDateOptions): Promise<DragonTigerDetailItem[]>;
|
|
2277
2965
|
/**
|
|
2278
|
-
*
|
|
2966
|
+
* 获取个股上榜统计
|
|
2967
|
+
* @param period 统计周期(默认近一月)
|
|
2279
2968
|
*/
|
|
2280
|
-
|
|
2969
|
+
getDragonTigerStockStats(period?: DragonTigerPeriod): Promise<DragonTigerStockStatItem[]>;
|
|
2281
2970
|
/**
|
|
2282
|
-
*
|
|
2971
|
+
* 获取机构买卖统计
|
|
2972
|
+
* @param options 起止日期 YYYYMMDD
|
|
2283
2973
|
*/
|
|
2284
|
-
|
|
2974
|
+
getDragonTigerInstitution(options: DragonTigerDateOptions): Promise<DragonTigerInstitutionItem[]>;
|
|
2285
2975
|
/**
|
|
2286
|
-
*
|
|
2976
|
+
* 获取营业部排行
|
|
2977
|
+
* @param period 统计周期
|
|
2287
2978
|
*/
|
|
2288
|
-
|
|
2979
|
+
getDragonTigerBranchRank(period?: DragonTigerPeriod): Promise<DragonTigerBranchItem[]>;
|
|
2289
2980
|
/**
|
|
2290
|
-
*
|
|
2981
|
+
* 获取个股某日上榜席位明细(买入榜 + 卖出榜合并)
|
|
2982
|
+
* @param symbol 股票代码
|
|
2983
|
+
* @param date 上榜日期 YYYYMMDD 或 YYYY-MM-DD
|
|
2291
2984
|
*/
|
|
2292
|
-
|
|
2985
|
+
getDragonTigerStockSeatDetail(symbol: string, date: string): Promise<DragonTigerSeatItem[]>;
|
|
2986
|
+
/** 获取大宗交易市场每日统计 */
|
|
2987
|
+
getBlockTradeMarketStat(): Promise<BlockTradeMarketStatItem[]>;
|
|
2293
2988
|
/**
|
|
2294
|
-
*
|
|
2989
|
+
* 获取大宗交易明细
|
|
2990
|
+
* @param options 起止日期
|
|
2295
2991
|
*/
|
|
2296
|
-
|
|
2992
|
+
getBlockTradeDetail(options?: BlockTradeDateOptions): Promise<BlockTradeDetailItem[]>;
|
|
2297
2993
|
/**
|
|
2298
|
-
*
|
|
2994
|
+
* 获取大宗交易每日统计(按股票汇总)
|
|
2995
|
+
* @param options 起止日期
|
|
2299
2996
|
*/
|
|
2300
|
-
|
|
2997
|
+
getBlockTradeDailyStat(options?: BlockTradeDateOptions): Promise<BlockTradeDailyStatItem[]>;
|
|
2998
|
+
/** 获取融资融券账户统计 */
|
|
2999
|
+
getMarginAccountInfo(): Promise<MarginAccountItem[]>;
|
|
2301
3000
|
/**
|
|
2302
|
-
*
|
|
3001
|
+
* 获取融资融券标的明细
|
|
3002
|
+
* @param date 指定交易日 YYYY-MM-DD(默认服务端最新交易日)
|
|
2303
3003
|
*/
|
|
2304
|
-
|
|
2305
|
-
/** 市场类型,不传则自动识别 */
|
|
2306
|
-
market?: MarketType;
|
|
2307
|
-
/** K 线周期 */
|
|
2308
|
-
period?: 'daily' | 'weekly' | 'monthly';
|
|
2309
|
-
/** 复权类型 */
|
|
2310
|
-
adjust?: '' | 'qfq' | 'hfq';
|
|
2311
|
-
/** 开始日期 YYYYMMDD */
|
|
2312
|
-
startDate?: string;
|
|
2313
|
-
/** 结束日期 YYYYMMDD */
|
|
2314
|
-
endDate?: string;
|
|
2315
|
-
/** 技术指标配置 */
|
|
2316
|
-
indicators?: IndicatorOptions;
|
|
2317
|
-
}): Promise<KlineWithIndicators<HistoryKline | HKUSHistoryKline>[]>;
|
|
3004
|
+
getMarginTargetList(date?: string): Promise<MarginTargetItem[]>;
|
|
2318
3005
|
}
|
|
2319
3006
|
|
|
2320
|
-
export { type AShareMarket, type ATROptions, type BIASOptions, type BOLLOptions, type CCIOptions, type CFFEXOptionQuote, type CFFEXOptionQuotesOptions, type ComexInventory, type ComexInventoryOptions, type ConceptBoard, type ConceptBoardConstituent, type ConceptBoardKline, type ConceptBoardKlineOptions, type ConceptBoardMinuteKline, type ConceptBoardMinuteKlineOptions, type ConceptBoardMinuteTimeline, type ConceptBoardSpot, type DMIOptions$1 as DMIOptions, type DMIResult$1 as DMIResult, type DividendDetail, type ETFOptionCate, type ETFOptionExpireDay, type ETFOptionMonth, type FullQuote, type FundFlow, type FundQuote, type FuturesExchange, type FuturesInventory, type FuturesInventoryOptions, type FuturesInventorySymbol, type FuturesKline, type FuturesKlineOptions, type GetAShareCodeListOptions, type GetAllAShareQuotesOptions, type GlobalFuturesKlineOptions, type GlobalFuturesQuote, type GlobalFuturesSpotOptions, type HKQuote, type HKUSHistoryKline, type HistoryKline, HttpError, type IndexOptionProduct, type IndicatorOptions, type IndustryBoard, type IndustryBoardConstituent, type IndustryBoardKline, type IndustryBoardKlineOptions, type IndustryBoardMinuteKline, type IndustryBoardMinuteKlineOptions, type IndustryBoardMinuteTimeline, type IndustryBoardSpot, type JsonpOptions, type KCOptions$1 as KCOptions, type KCResult$1 as KCResult, type KDJOptions, type KlineWithIndicators, type MACDOptions, type MAOptions, type MarketType, type MinuteKline, type MinuteTimeline, type OBVOptions$1 as OBVOptions, type OBVResult$1 as OBVResult, type OptionKline, type OptionLHBItem, type OptionMinute, type OptionTQuote, type OptionTQuoteResult, type PanelLargeOrder, type ProviderName, type ProviderRequestPolicy, type ROCOptions$1 as ROCOptions, type ROCResult$1 as ROCResult, type RSIOptions, type RequestClientOptions, type RetryOptions, type SAROptions$1 as SAROptions, type SARResult$1 as SARResult, type SearchResult, type SimpleQuote, StockSDK, type TodayTimeline, type TodayTimelineResponse, type USQuote, type WROptions, addIndicators, asyncPool, calcATR, calcBIAS, calcBOLL, calcCCI, calcDMI, calcEMA, calcKC, calcKDJ, calcMA, calcMACD, calcOBV, calcROC, calcRSI, calcSAR, calcSMA, calcWMA, calcWR, chunkArray, decodeGBK, StockSDK as default, extractJsonFromJsonp, jsonpRequest, parseResponse, safeNumber, safeNumberOrNull };
|
|
3007
|
+
export { type AShareMarket, type ATROptions, type BIASOptions, type BOLLOptions, type BlockTradeDailyStatItem, type BlockTradeDateOptions, type BlockTradeDetailItem, type BlockTradeMarketStatItem, type BoardChangeItem, type CCIOptions, type CFFEXOptionQuote, type CFFEXOptionQuotesOptions, type ComexInventory, type ComexInventoryOptions, type ConceptBoard, type ConceptBoardConstituent, type ConceptBoardKline, type ConceptBoardKlineOptions, type ConceptBoardMinuteKline, type ConceptBoardMinuteKlineOptions, type ConceptBoardMinuteTimeline, type ConceptBoardSpot, type DMIOptions$1 as DMIOptions, type DMIResult$1 as DMIResult, type DatacenterQuery, type DatacenterResult, type DividendDetail, type DragonTigerBranchItem, type DragonTigerDateOptions, type DragonTigerDetailItem, type DragonTigerInstitutionItem, type DragonTigerPeriod, type DragonTigerSeatItem, type DragonTigerStockStatItem, type ETFOptionCate, type ETFOptionExpireDay, type ETFOptionMonth, type FullQuote, type FundFlow, type FundFlowOptions, type FundFlowRankItem, type FundFlowRankOptions, type FundQuote, type FuturesExchange, type FuturesInventory, type FuturesInventoryOptions, type FuturesInventorySymbol, type FuturesKline, type FuturesKlineOptions, type GetAShareCodeListOptions, type GetAllAShareQuotesOptions, type GlobalFuturesKlineOptions, type GlobalFuturesQuote, type GlobalFuturesSpotOptions, type HKQuote, type HKUSHistoryKline, type HistoryKline, HttpError, INDICATOR_REGISTRY, type IndexOptionProduct, type IndicatorKey, type IndicatorOptions, type IndustryBoard, type IndustryBoardConstituent, type IndustryBoardKline, type IndustryBoardKlineOptions, type IndustryBoardMinuteKline, type IndustryBoardMinuteKlineOptions, type IndustryBoardMinuteTimeline, type IndustryBoardSpot, type JsonpOptions, type KCOptions$1 as KCOptions, type KCResult$1 as KCResult, type KDJOptions, type KlineWithIndicators, type MACDOptions, type MAOptions, type MarginAccountItem, type MarginTargetItem, type MarketFundFlow, type MarketType, type MinuteKline, type MinuteTimeline, type NorthboundDirection, type NorthboundFlowSummary, type NorthboundHistoryItem, type NorthboundHistoryOptions, type NorthboundHoldingRankItem, type NorthboundHoldingRankOptions, type NorthboundIndividualItem, type NorthboundMarket, type NorthboundMinuteItem, type NorthboundRankPeriod, type OBVOptions$1 as OBVOptions, type OBVResult$1 as OBVResult, type OptionKline, type OptionLHBItem, type OptionMinute, type OptionTQuote, type OptionTQuoteResult, type PanelLargeOrder, type ProviderName, type ProviderRequestPolicy, type ROCOptions$1 as ROCOptions, type ROCResult$1 as ROCResult, type RSIOptions, type RequestClientOptions, type RequestError, type RetryOptions, type SAROptions$1 as SAROptions, type SARResult$1 as SARResult, SdkError, type SearchResult, type SearchResultType, type SectorFundFlowItem, type SimpleQuote, type StockChangeItem, type StockChangeType, type StockFundFlowDaily, StockSDK, type TodayTimeline, type TodayTimelineResponse, type USQuote, type WROptions, type ZTPoolItem, type ZTPoolType, addIndicators, asyncPool, buildIndicatorContext, calcATR, calcBIAS, calcBOLL, calcCCI, calcDMI, calcEMA, calcKC, calcKDJ, calcMA, calcMACD, calcOBV, calcROC, calcRSI, calcSAR, calcSMA, calcWMA, calcWR, chunkArray, decodeGBK, StockSDK as default, estimateIndicatorLookback, extractJsonFromJsonp, getEnabledIndicatorKeys, getSdkErrorCode, jsonpRequest, parseResponse, safeNumber, safeNumberOrNull };
|