Skip to content

Commit

Permalink
- change : 完成 readme
Browse files Browse the repository at this point in the history
  • Loading branch information
lamter committed Mar 13, 2016
1 parent 4e837e4 commit ecf600f
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 11 deletions.
44 changes: 42 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ quotation = easyquotation.use('tencent') # or qq
quotation.all
```

#### 更新股票代码

```
easyquotation.update_stock_codes()
```

#### 选择 leverfun 免费十档行情

```
Expand Down Expand Up @@ -205,8 +211,42 @@ ptype: 溢价计算方式,price=现价,buy=买一,sell=卖一

对应的分级 A 数据

#### 更新股票代码

##### 指数ETF查询接口

**TIP :** 尚未包含黄金ETF和货币ETF

*[集思录ETF源网页](https://www.jisilu.cn/data/etf/#tlink_2)*

```
easyquotation.update_stock_codes()
quotation.etfindex()
```

**return**

```
{
"510050": {
"fund_id": "510050", # 代码
"fund_nm": "50ETF", # 名称
"price": "2.066", # 现价
"increase_rt": "0.34%", # 涨幅
"volume": "71290.96", # 成交额(万元)
"index_nm": "上证50", # 指数
"pe": "9.038", # 指数PE
"pb": "1.151", # 指数PB
"index_increase_rt": "0.45%", # 指数涨幅
"estimate_value": "2.0733", # 估值
"fund_nav": "2.0730", # 净值
"nav_dt": "2016-03-11", # 净值日期
"discount_rt": "-0.34%", # 溢价率
"creation_unit": "90", # 最小申赎单位(万份)
"amount": "1315800", # 份额
"unit_total": "271.84", # 规模(亿元)
"index_id": "000016", # 指数代码
"last_time": "15:00:00", # 价格最后时间(未确定)
"last_est_time": "23:50:02", # 估值最后时间(未确定)
}
}
```

13 changes: 4 additions & 9 deletions easyquotation/jsl.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,15 +194,10 @@ def fundarb(self, jsl_username, jsl_password, avolume=100, bvolume=100, ptype='p
return self.__fundarb


def etfindex(self, fields=[], min_volume=0, min_discount=0, forever=False):
"""以字典形式返回 指数ETF 数据
:param fields:利率范围,形如['+3.0%', '6.0%']
:param min_volume:最小交易量,单位万元
:param min_discount:最小折价率, 单位%
:param forever: 是否选择永续品种,默认 False
# >>> Jsl().etfindex()
def etfindex(self):
"""
以字典形式返回 指数ETF 数据
:return:
"""
# 添加当前的ctime
self.__etf_index_url = self.__etf_index_url.format(ctime=int(time.time()))
Expand Down

0 comments on commit ecf600f

Please sign in to comment.