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

call to QA_fetch_get_stock_day cause TypeError #1061

Open
zillionare opened this issue Mar 24, 2019 · 1 comment
Open

call to QA_fetch_get_stock_day cause TypeError #1061

zillionare opened this issue Mar 24, 2019 · 1 comment

Comments

@zillionare
Copy link

问题反馈

您使用的QUANTAXIS版本号是什么?

1.2.8 dev-1


您的系统信息(包括系统版本,系统架构(32/64),内存大小等等)


ubuntu 64 bit



您的系统环境是什么?

- monodb
- python3.7
- docker(无)

您需要反馈的问题

start = arrow.get('20190201 09:30', 'YYYYMMDD HH:mm')
end = arrow.get('20190322 15:30', 'YYYYMMDD HH:mm')

#get_bars_by_time_range('000001', start, end, '30m')
qa.QAFetch.QATdx.QA_fetch_get_stock_day('000001', start.datetime, end.datetime)

raise the following error:

Tushare内置的pytdx版本和QUANTAXIS使用的pytdx 版本不同, 请重新安装pytdx以解决此问题
pip uninstall pytdx
pip install pytdx


感谢您的反馈 如有意见和建议,请在此说明:

after tracing down, I found it's not pytdx version issue. It's caused by type of parameter start, end.

Required type of start/end is str, however I passed datetime.date in. 

Three suggestions:

1. add type notation to the parameter
2. change the type to datetime.datetime or Arrow
3. check paramter right after the function is entered, then raise right Exception


您的联系方式(QQ/EMAIL)


THANKS
by yutiansut
2017.12

@yutiansut
Copy link
Owner

@hbaaron pytdx只查版本是无法查出来的 因为tushare的安装包里面有一份没有版本号的pytdx代码 因此会直接覆盖pytdx代码而不覆盖版本号 所以解决方案是卸了pytdx再次安装

至于日期的标准化以及 annotation 这个后面会加入

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

2 participants