Zipline是一个python算法(股票)交易的库,它是一个为反向测试的事件驱动系统。
当前被用在作为反向测试和实时交易引擎Quantopian的产品中,此产品是免费、以交易为中心,
构建运行交易策略的平台。
安装:
用如下脚本很简单。
pip install zipline
Zipline会依赖CPython,numpy,LAPACK,需要也提前安装。
快速开始:
使用的样例在zipline/examples目录下。
下面的代码实现了简单移动平均线算法。
# Compute averages
# data.history() has to be called with the same params
# from above and returns a pandas dataframe.
short_mavg = data.history(context.asset, 'price', bar_count=100, frequency="1d").mean()
long_mavg = data.history(context.asset, 'price', bar_count=300, frequency="1d").mean()
特点:
容易使用,即装即用,集成PyData,涵盖统计及机器学习库。
github地址是https://github.com/quantopian/zipline
声明:我要去上班所有作品(图文、音视频)均由用户自行上传分享,仅供网友学习交流,版权归原作者所有,原文出处。若您的权利被侵害,请联系删除。
本文标题:(python股票全套系统)(用python做进销存系统)
本文链接:https://www.51qsb.cn/article/16197.html