From c88630c4d6dbf9aa90b8bea25e5849be5dd19bdb Mon Sep 17 00:00:00 2001 From: jindaxiang Date: Wed, 16 Oct 2024 22:02:22 +0800 Subject: [PATCH 1/2] fix: fix futures_hold_pos_sina --- .../futures_derivative/futures_cot_sina.py | 10 ++--- docs/data/futures/futures.md | 44 +++++++++---------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/akshare/futures_derivative/futures_cot_sina.py b/akshare/futures_derivative/futures_cot_sina.py index 85d2027fae6..05a2ed47340 100644 --- a/akshare/futures_derivative/futures_cot_sina.py +++ b/akshare/futures_derivative/futures_cot_sina.py @@ -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 """ @@ -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, :] @@ -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) diff --git a/docs/data/futures/futures.md b/docs/data/futures/futures.md index b84c4b4ecd3..85066a82c02 100644 --- a/docs/data/futures/futures.md +++ b/docs/data/futures/futures.md @@ -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 ``` #### 现期图 From 4aa32f1168acff7c4ae9e9123ec5d059ed320464 Mon Sep 17 00:00:00 2001 From: jindaxiang Date: Wed, 16 Oct 2024 22:02:43 +0800 Subject: [PATCH 2/2] feat: add version 1.14.98 --- akshare/__init__.py | 3 ++- docs/changelog.md | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/akshare/__init__.py b/akshare/__init__.py index 1574c3435d5..4e3cf1e68c3 100644 --- a/akshare/__init__.py +++ b/akshare/__init__.py @@ -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 diff --git a/docs/changelog.md b/docs/changelog.md index 776b130ba18..2f069404002 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -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 接口 @@ -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