Skip to content

Commit 0009698

Browse files
author
uname-yang
committed
release 0.1.5 kline with period
1 parent e880f4d commit 0009698

File tree

5 files changed

+21
-7
lines changed

5 files changed

+21
-7
lines changed

README.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,12 +252,25 @@ ball.pankou('SZ002027')
252252

253253
### K线
254254

255-
获取K线数据。第二参数可制定从现在到N天前,默认100.
255+
获取K线数据。
256+
257+
第二参数可指定period,默认day;第三参数可指定count,默认284。
258+
259+
```
260+
原K线接口中 https://stock.xueqiu.com/v5/stock/chart/kline.json?symbol=SH600219&begin=1747625277024&period=day&type=before&count=-284&indicator=kline,pe,pb,ps,pcf,market_capital,agt,ggt,balance 的 period 会根据不同的类型返回不同周期的K线
261+
262+
日K:day
263+
周K:week
264+
月K:month
265+
60分K:60m
266+
30分K:30m
267+
1分K:1m
268+
```
256269

257270
```python
258271
import pysnowball as ball
259272
ball.kline('SZ002027')
260-
ball.kline('SZ002027', 300)
273+
ball.kline('SZ002027','day', 30)
261274
```
262275

263276
[结果显示](APIs/realtime_kline.md)

pysnowball/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
from pysnowball.user import(watch_list, watch_stock)
2424

25-
from pysnowball.cube import(nav_daily, rebalancing_history)
25+
from pysnowball.cube import(nav_daily, rebalancing_history, rebalancing_current, quote_current)
2626

2727
from pysnowball.bond import(convertible_bond)
2828

pysnowball/api_ref.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737

3838
# kline
3939

40-
kline = "https://stock.xueqiu.com/v5/stock/chart/kline.json?symbol={}&begin={}&period=day&type=before&count=-{}&indicator=kline,pe,pb,ps,pcf,market_capital,agt,ggt,balance"
40+
kline = "https://stock.xueqiu.com/v5/stock/chart/kline.json?symbol={}&begin={}&period={}&type=before&count=-{}&indicator=kline,pe,pb,ps,pcf,market_capital,agt,ggt,balance"
41+
# /v5/stock/chart/kline.json?symbol=SH600219&begin=1747625277024&period=day&type=before&count=-284&indicator=kline,pe,pb,ps,pcf,market_capital,agt,ggt,balance
4142

4243
# user
4344
watch_list = "https://stock.xueqiu.com/v5/stock/portfolio/list.json?system=true"

pysnowball/realtime.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ def pankou(symbol):
1818
return utls.fetch(url)
1919

2020

21-
def kline(symbol, days=100):
22-
return utls.fetch(api_ref.kline.format(symbol, int(time.time()*1000), days))
21+
def kline(symbol,period='day',count=284):
22+
return utls.fetch(api_ref.kline.format(symbol, int(time.time()*1000), period, count))

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def read_install_requires():
7575

7676
setuptools.setup(
7777
name="pysnowball",
78-
version="0.1.3",
78+
version="0.1.5",
7979
author="Yang Yu",
8080
author_email="yang.lights@hotmail.com",
8181
description="xueqiu api python client | 集成雪球API",

0 commit comments

Comments
 (0)