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

网易财经的数据源失效 可以手动换数据源吗 #133

Open
Ccptsoap opened this issue Jun 20, 2021 · 6 comments
Open

网易财经的数据源失效 可以手动换数据源吗 #133

Ccptsoap opened this issue Jun 20, 2021 · 6 comments

Comments

@Ccptsoap
Copy link

我的代码:

import xalpha as xa  
import pandas as pd

# 基础信息  
yfdlc = xa.fundinfo('005827')  
yfdlc.info()  
cyb = xa.indexinfo('005827')  

# 定投策略
cyb.bcmkset(xa.cashinfo())  
cyb.total_annualized_returns('2015-06-01'), cyb.algorithm_volatility('2015-06-01')  
autoc = xa.policy.scheduled(cyb, 1000, pd.date_range('2011-01-01', '2015-01-01', freq='W-THU'))  
cybt = xa.trade(cyb, autoc.status)  
print(cybt)

后半段报错:
image

经过测试, 前半段基础信息是从天天基金获取的, 后半段定投策略来自163网易财经, 但网易财经的接口失效了.

已经尝试过但无效的办法:

  1. 开关梯子
  2. 拔插网线
  3. 手机热点
  4. 切换发行版\Git Clone版
@lillsi
Copy link

lillsi commented Jun 21, 2021

昨晚我也一样,返回504,今天在公司试,又好了

@lillsi
Copy link

lillsi commented Jun 21, 2021

希望可以有一个换数据源的配置

@Ccptsoap
Copy link
Author

昨晚我也一样,返回504,今天在公司试,又好了

今天细看了一下, indexinfo() 只能获取指数, 比如中证500指 创业板指啥的.
获取基金的话用 fundinfo() , 比如诺安成长混合, 易方达蓝筹这些.
只不过定投的示例里用指数, 所以以为是从 indexinfo() 获取数据.

@refraction-ray
Copy link
Owner

我暂时在我的网络环境没发现网易数据源存在问题。换数据源的话,可以考虑使用 xa.vinfo("SH000905", start="2018-01-01") 这个应该是默认雪球的源

@cqzhao
Copy link
Contributor

cqzhao commented Jan 26, 2023

我去年用的没问题,今年测试了一下,网易的源失效了。

@refraction-ray
Copy link
Owner

我去年用的没问题,今年测试了一下,网易的源失效了。

测试了一下,似乎指数 api 已失效,会返回网易财经首页

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

No branches or pull requests

4 participants