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

腾讯日线修正 #7

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions Ashare.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ def get_price_day_tx(code, end_date='', count=10, frequency='1d'): #日线
URL=f'http://web.ifzq.gtimg.cn/appstock/app/fqkline/get?param={code},{unit},,{end_date},{count},qfq'
st= json.loads(requests.get(URL).content); ms='qfq'+unit; stk=st['data'][code]
buf=stk[ms] if ms in stk else stk[unit] #指数返回不是qfqday,是day
buf = [item[:6] for item in buf] # 去掉第七行cqr数据(例如hk00002)
df=pd.DataFrame(buf,columns=['time','open','close','high','low','volume'],dtype='float')
df.time=pd.to_datetime(df.time); df.set_index(['time'], inplace=True); df.index.name='' #处理索引
return df
Expand Down