Skip to content

Commit

Permalink
update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
albertandking committed Feb 24, 2020
1 parent 548217f commit 1874cb1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
1 change: 1 addition & 0 deletions .dmypy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"pid": 1296, "connection_name": "\\\\.\\pipe\\dmypy-VkLvS1pP.pipe"}
5 changes: 4 additions & 1 deletion akshare/futures/cot.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,10 @@ def _table_cut_cal(table_cut, symbol):


if __name__ == '__main__':
get_dce_rank_table_df = get_czce_rank_table(date='20200131')
get_dce_rank_table_df = get_czce_rank_table(date='20200213')
print(get_dce_rank_table_df)
get_cffex_rank_table_df = get_cffex_rank_table(date='20200213')
print(get_cffex_rank_table_df)
# for k, v in dfs.items():
# print(type(v['long_open_interest'].tolist()[-1]))
# get_rank_sum("20180301")
13 changes: 11 additions & 2 deletions docs/source/data/futures/futures.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,13 +323,14 @@ ak.get_receipt(start_day="20180712", end_day="20180719", vars_list=["CU", "NI"])

#### 现货价格和基差

基差是商品期货非常重要的基本面因素. 这里提供两种获取基差的方法:
基差是商品期货非常重要的基本面因素, AkShare 在这里提供两种获取基差的方法:

获取当天的基差数据

```python
import akshare as ak
ak.get_spot_price("20180712")
get_spot_price_df = ak.get_spot_price("20180712")
print(get_spot_price_df)
```

返回值分别为品种、现货价格、最近交割合约、最近交割合约价格、主力合约、主力合约价格、最近合约基差值、主力合约基差值、最近合约基差率、主力合约基差率.
Expand Down Expand Up @@ -362,6 +363,14 @@ ak.get_czce_rank_table()
ak.get_shfe_rank_table()
```

代码示例:

```python
import akshare as ak
get_dce_rank_table_df = ak.get_czce_rank_table(date='20200213')
print(get_dce_rank_table_df)
```

注意:

1. 因为每个交易所公布的持仓排名不同: 大连所只公布品种的总持仓排名;
Expand Down

0 comments on commit 1874cb1

Please sign in to comment.