债券数据
# 可转债数据
# 获取可转债信息
xtdata.get_cb_info(bond_code)
1
释义
- 查询可转债信息
参数
bond_code
- str 可转债代码
返回
dict
示例:
xtdata.get_cb_info("123219.SZ")
1
{'bondCode': '123219.SZ',
'bondName': '宇瞳转债',
'stockCode': '300790.SZ',
'stockName': '宇瞳光学',
'bondMaturity': 6.0,
'bondParvalue': 100.0,
'bondIssuePrice': 100.0,
'bondIssueSize': 600000000.0,
'bondValueDate': '20230811',
'bondMaturityDate': '20290811',
'bondCouponRate': 0.3,
'bondAddRate': 1.3396846364605e-311,
'bondListDate': '20230829',
'delistDate': '20290810',
'convStartDate': '20240219',
'convEndDate': '20290810',
'firstConvPrice': 15.29,
'bondConvPrice': 15.32,
'forceRedeemTradeDate': '0',
'forceRedeemConvDate': '0',
'forceRedeemPrice': 0.0,
'triggerForceRedeemPrice': 19.916,
'triggerRepurchasePrice': 10.724,
'expireRedeemPrice': 0.0,
'termYear': 6.0,
'interestType': 0.0}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# 获取可转债合约信息
xtdata.get_instrument_detail(bond_code)
1
示例:
xtdata.get_instrument_detail('123219.SZ')
1
{'ExchangeID': 'SZ',
'InstrumentID': '123219',
'InstrumentName': '宇瞳转债',
'ProductID': '',
'ProductName': '',
'ExchangeCode': '123219',
'UniCode': '123219',
'CreateDate': '0',
'OpenDate': '20230829',
'ExpireDate': 99999999,
'PreClose': 122.828,
'SettlementPrice': 122.828,
'UpStopPrice': 147.394,
'DownStopPrice': 98.262,
'FloatVolume': 6000000.0,
'TotalVolume': 6000000.0,
'LongMarginRatio': 1.7976931348623157e+308,
'ShortMarginRatio': 1.7976931348623157e+308,
'PriceTick': 0.001,
'VolumeMultiple': 1,
'MainContract': 2147483647,
'LastVolume': 2147483647,
'InstrumentStatus': 0,
'IsTrading': False,
'IsRecent': False,
'ProductTradeQuota': 1,
'ContractTradeQuota': 0,
'ProductOpenInterestQuota': 14592,
'ContractOpenInterestQuota': 0}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# 获取可转债行情
get_market_data_ex(field_list=[], stock_list=[], period='1d', start_time='', end_time='', count=-1, dividend_type='none', fill_data=True)
1
示例:
xtdata.subscribe_quote('rb2401.SF','1d','','',-1)
time.sleep(1) # 等待订阅完成
xtdata.get_market_data_ex([],['rb2401.SF'],period='tick')
1
2
3
2
3
{'123219.SZ': time open high low close volume \
20230829 1693238400000 119.500 127.500 118.401 122.545 825773
20230830 1693324800000 122.550 136.880 122.550 128.647 1781805
20230831 1693411200000 131.910 132.400 126.506 127.647 401098
20230901 1693497600000 128.120 129.147 126.400 127.164 163762
20230904 1693756800000 127.300 128.990 125.666 128.900 104830
20230905 1693843200000 128.500 131.366 128.160 129.700 89200
20230906 1693929600000 129.500 130.388 128.416 129.500 50785
20230907 1694016000000 129.630 130.600 125.800 127.087 46492
20230908 1694102400000 126.805 127.800 125.217 126.236 32745
20230911 1694361600000 127.495 127.495 124.720 126.000 38422
20230912 1694448000000 126.800 127.795 126.100 126.620 43037
20230913 1694534400000 126.998 126.998 124.182 124.903 19158
20230914 1694620800000 125.199 125.199 122.978 123.265 17911
20230915 1694707200000 123.168 124.376 122.640 123.118 33887
20230918 1694966400000 123.220 123.739 122.250 123.500 21458
20230919 1695052800000 123.550 123.610 122.000 122.792 9598
20230920 1695139200000 122.544 122.854 120.402 120.800 12394
20230921 1695225600000 120.545 121.584 120.426 121.013 16437
20230922 1695312000000 121.166 123.800 120.621 123.700 46821
20230925 1695571200000 123.900 123.916 122.313 122.451 20178
20230926 1695657600000 122.451 122.819 121.759 122.436 13035
20230927 1695744000000 122.436 123.900 122.222 122.828 9887
20230928 1695830400000 123.300 124.959 122.811 124.939 18952
amount settelementPrice openInterest preClose suspendFlag
20230829 1.021795e+09 0.0 15 100.000 0
20230830 2.329051e+09 0.0 15 122.545 0
20230831 5.158821e+08 0.0 15 128.647 0
20230901 2.089726e+08 0.0 15 127.647 0
20230904 1.336979e+08 0.0 15 127.164 0
20230905 1.156935e+08 0.0 15 128.900 0
20230906 6.582121e+07 0.0 15 129.700 0
20230907 5.957335e+07 0.0 15 129.500 0
20230908 4.127845e+07 0.0 15 127.087 0
20230911 4.834130e+07 0.0 15 126.236 0
20230912 5.461135e+07 0.0 15 126.000 0
20230913 2.398361e+07 0.0 15 126.620 0
20230914 2.218917e+07 0.0 15 124.903 0
20230915 4.185095e+07 0.0 15 123.265 0
20230918 2.640396e+07 0.0 15 123.118 0
20230919 1.178017e+07 0.0 15 123.500 0
20230920 1.505502e+07 0.0 15 122.792 0
20230921 1.988447e+07 0.0 15 120.800 0
20230922 5.749531e+07 0.0 15 121.013 0
20230925 2.478661e+07 0.0 15 123.700 0
20230926 1.594149e+07 0.0 15 122.451 0
20230927 1.215194e+07 0.0 15 122.436 0
20230928 2.353592e+07 0.0 15 122.828 0 }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
上次更新: 2023/10/12, 10:46:32