Giter VIP home page Giter VIP logo

easyhistory's People

Contributors

chuihero avatar daycount avatar fuxiao511 avatar shidenggui avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

easyhistory's Issues

day.py 185行这里有个bug

end_quarter = 5 if str(year) != str(now_year) else math.ceil(now_month / 12) + 1
应该为
end_quarter = 5 if str(year) != str(now_year) else math.ceil(now_month / 3) + 1
bug导致init时取不全数据。
我fork的版本已经改的面目全非了, 就不提交pr了。

'gbk' codec can't decode byte 0x8e in position 38: illegal multibyte sequence'gbk' codec can't decode byte 0x8e in position 38

这其实不是easyhistory的错,是request包 内会读取本地用户目录的 .netrc或 _netrc文件内用户名和密码,试图自动完成网站认证过程,但是这个文件是utf8编码的,默认使用当前系统编码gbk去读取,就产生错误,在request项目内,关于 netrce的 issure一大堆,其中 option to disable .netrc #2773

我现在暂时解决办法是,主动传入用户和密码,这样就不会读取netrc文件了,诸如:
dom = PyQuery(url, auth=('user', 'pass'))
rep = requests.get(url, params, timeout=3, headers=headers, auth=('user', 'pass'))

官方似乎推荐设置 trust_env=false 来解决

内存泄露?

感觉有内存泄露之处,取几十只股票的历史数据就看着python消耗的内存涨了3个G,也许是rqalpha的问题:

objgraph.show_growth()
weakref 8820 +1

for i in stock_codes[:20]:
try:
df = easyhistory.history(i[:-5])
except Exception as e:
pass

objgraph.show_growth()
list 469391 +433451
Instrument 193160 +183502
...

行情下载时有时会出现IndexError: list index out of range

最后两行错误是:
File "/home/user/easyhistory/easyhistory/day.py", line 43, in update_single_code
self.store.write(stock_code, updated_data)
File "/home/user/easyhistory/easyhistory/store.py", line 43, in write
updated_data_start_date = updated_data[0][0]
IndexError: list index out of range

然后程序就退出了

初始化日线历史数据出错

File "E:\同步文件夹\02学习资料\Python\easyhistory-master\easyhistory\api.py", line 6, in init
return Day(path=path, export='csv').init(export)

TypeError: init() takes 1 positional argument but 2 were given

前复权调整问题

前复权只需要对价格进行调整,不需要对成交量/额进行调整

以000039的4月1日数据为例,raw_data的成交量/额/复权因子如下:

17566666 264585488 23.302

data中对这两项都做了复权处理,结果如下,是错的:

753869.45 11354625.7 23.302

bundle path 不存在 这个要在哪设置

File "C:\Python\Python36\lib\site-packages\easyhistory\api.py", line 26, in history
d = BaseDataSource(os.path.expanduser(bundle_path))
�[36m | | -> '~/.rqalpha/bundle'�[m
�[36m | -> <module 'os' from 'C:\Python\Python36\lib\os.py'>�[m
�[36m -> <class 'rqalpha.data.base_data_source.BaseDataSource'>�[m
File "C:\Python\Python36\lib\site-packages\rqalpha\data\base_data_source.py", line 44, in init
�[33;1mraise�[m �[35;1mRuntimeError�[m(�[31m'bundle path {} not exist'�[m.format(os.path.abspath))
�[36m -> <module 'os' from 'C:\Python\Python36\lib\os.py'>�[m
RuntimeError: bundle path <function abspath at 0x0000023827DD59D8> not exist

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.