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

update of xueqiu API paramters #186

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

cqzhao
Copy link
Contributor

@cqzhao cqzhao commented Jul 9, 2024

修改了max_drawdown算法,加快计算速度。
修改了雪球API接口参数

@@ -0,0 +1,46 @@
import logging
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

请在 pr 中删除该 debug 文件

@@ -1004,7 +1009,8 @@ def update(self):
df = df.iloc[::-1] ## reverse the time order
df = df[df["date"].isin(opendate)]
df = df.reset_index(drop=True)
df = df[df["date"] <= yesterdayobj()]
#df = df[df["date"] <= yesterdayobj()]
df = df[df["date"] <= today_obj()]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

info 文件里的改动我建议在 PR 里去掉,因为为了开发方便,依赖于”数据只更新到昨天”逻辑的地方非常多,不确定只单独将这一个地方改到可以更新当日数据会不会出其他潜在 issue

lastrow = tmpprice.iloc[iid]
newhigh = tmpprice.loc[tmpprice.loc[:,'drawdown']>=-0.0001,:]
beginrow = newhigh.loc[newhigh['date']<=lastrow['date'],:].iloc[-1]
return beginrow['date'],lastrow['date'],lastrow['drawdown']
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个计算的是单日回撤而不是一个时间段的最大回撤?drawdown 列的定义是 L222,计算的是相较前一日的回撤百分比或0(当日新高)。那返回的某一列的 drawdown 值似乎对应了单日回撤?

@@ -162,7 +162,7 @@ def get_historical_fromxq(code, count, type_="before", full=False):
url.format(
code=code, tomorrow=int(tomorrow_ts() * 1000), count=count, type_=type_
),
cookies={"xq_a_token": get_token()},
cookies={"xq_a_token": get_token()[0],"u":get_token()[1]},
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

该文件中还涉及雪球实时数据和 bar 数据函数的爬取,是否也应该更新 cookies 添加 “u”

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants