Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #5247

Merged
merged 2 commits into from
Oct 16, 2024
Merged

Dev #5247

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion akshare/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2908,9 +2908,10 @@
1.14.95 fix: fix stock_zt_pool_sub_new_em interface
1.14.96 fix: fix stock_zt_pool_sub_new_em interface
1.14.97 fix: fix stock_profile_cninfo interface
1.14.98 fix: fix futures_hold_pos_sina interface
"""

__version__ = "1.14.97"
__version__ = "1.14.98"
__author__ = "AKFamily"

import sys
Expand Down
10 changes: 5 additions & 5 deletions akshare/futures_derivative/futures_cot_sina.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
Date: 2024/6/3 15:30
Date: 2024/10/16 21:30
Desc: 新浪财经-期货-成交持仓
https://vip.stock.finance.sina.com.cn/q/view/vFutures_Positions_cjcc.php
"""
Expand Down Expand Up @@ -29,7 +29,7 @@ def futures_hold_pos_sina(
"""
date = "-".join([date[:4], date[4:6], date[6:]])
url = "https://vip.stock.finance.sina.com.cn/q/view/vFutures_Positions_cjcc.php"
params = {"symbol": contract, "date": date}
params = {"t_breed": contract, "t_date": date}
r = requests.get(url, params=params)
if symbol == "成交量":
temp_df = pd.read_html(StringIO(r.text))[2].iloc[:-1, :]
Expand Down Expand Up @@ -59,16 +59,16 @@ def futures_hold_pos_sina(

if __name__ == "__main__":
futures_hold_pos_sina_df = futures_hold_pos_sina(
symbol="成交量", contract="PTA2407", date="20240531"
symbol="成交量", contract="OI2501", date="20241016"
)
print(futures_hold_pos_sina_df)

futures_hold_pos_sina_df = futures_hold_pos_sina(
symbol="多单持仓", contract="IC2403", date="20240223"
symbol="多单持仓", contract="OI2501", date="20241016"
)
print(futures_hold_pos_sina_df)

futures_hold_pos_sina_df = futures_hold_pos_sina(
symbol="空单持仓", contract="IC2403", date="20240223"
symbol="空单持仓", contract="OI2501", date="20241016"
)
print(futures_hold_pos_sina_df)
6 changes: 6 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@

## 更新说明详情

1.14.98 fix: fix futures_hold_pos_sina interface

1. 修复 futures_hold_pos_sina 接口

1.14.97 fix: fix stock_profile_cninfo interface

1. 修复 stock_profile_cninfo 接口
Expand Down Expand Up @@ -4638,6 +4642,8 @@

## 版本更新说明

1.14.98 fix: fix futures_hold_pos_sina interface

1.14.97 fix: fix stock_profile_cninfo interface

1.14.96 fix: fix stock_zt_pool_sub_new_em interface
Expand Down
44 changes: 22 additions & 22 deletions docs/data/futures/futures.md
Original file line number Diff line number Diff line change
Expand Up @@ -2241,34 +2241,34 @@ print(futures_stock_shfe_js_df)
```python
import akshare as ak

futures_hold_pos_sina_df = ak.futures_hold_pos_sina(symbol="成交量", contract="IC2403", date="20240223")
futures_hold_pos_sina_df = ak.futures_hold_pos_sina(symbol="成交量", contract="OI2501", date="20241016")
print(futures_hold_pos_sina_df)
```

数据示例

```
名次 会员简称 成交量 比上交易增减
0 1 中信期货 25596 2663
1 2 国泰君安 19699 1110
2 3 东证期货 11802 2200
3 4 海通期货 8968 397
4 5 华闻期货 5607 -88
5 6 国信期货 5171 -423
6 7 银河期货 4670 718
7 8 永安期货 3771 246
8 9 东兴期货 3344 -44
9 10 广发期货 2912 594
10 11 华泰期货 2812 -447
11 12 中信建投 2490 1
12 13 兴证期货 2293 204
13 14 申银万国 2271 77
14 15 光大期货 1965 -320
15 16 五矿期货 1707 -204
16 17 国联期货 1584 -46
17 18 浙商期货 1565 434
18 19 中泰期货 1391 -66
19 20 方正中期 1361 -64
名次 会员简称 成交量 比上交易增减
0 1 中信期货(代客) 78197 -15458.0
1 2 东证期货(代客) 67129 -6540.0
2 3 国泰君安(代客) 53632 -12474.0
3 4 银河期货(代客) 21916 -10902.0
4 5 华闻期货(代客) 21807 -4777.0
5 6 徽商期货(代客) 21615 -7861.0
6 7 海通期货(代客) 18847 -4165.0
7 8 中信建投(代客) 15285 -2470.0
8 9 华泰期货(代客) 14610 -3036.0
9 10 南华期货(代客) 11990 -554.0
10 11 华西期货(代客) 11324 -795.0
11 12 方正中期(代客) 10958 -4512.0
12 13 瑞达期货(代客) 9038 -2121.0
13 14 国金期货(代客) 9026 3334.0
14 15 广发期货(代客) 8775 -5333.0
15 16 中辉期货(代客) 7746 -4127.0
16 17 国投安信期货(代客) 7739 1295.0
17 18 安粮期货(代客) 7671 -1946.0
18 19 东吴期货(代客) 7639 -4308.0
19 20 东方财富(代客) 7220 -1248.0
```

#### 现期图
Expand Down