资源简介
开源ZipLine本身只支持美股,这是本地化了一下。。
通过本地股票数据接口,可以实现回测策略的编写和图形化输出,
需要有python下pandas和matplot等金融分析相应工具基础
通过本地股票数据接口,可以实现回测策略的编写和图形化输出,
需要有python下pandas和matplot等金融分析相应工具基础
代码片段和文件信息
#!/usr/bin/env python
#
# Copyright 2014 Quantopian Inc.
#
# Licensed under the Apache License Version 2.0 (the “License“);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing software
# distributed under the License is distributed on an “AS IS“ BASIS
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import print_function
import os
import re
import sys
from operator import lt gt eq le ge
from os.path import (
abspath
dirname
join
)
from distutils.version import StrictVersion
from setuptools import (
Extension
find_packages
setup
)
import versioneer
class LazyBuildExtCommandClass(dict):
“““
Lazy command class that defers operations requiring Cython and numpy until
they‘ve actually been downloaded and installed by setup_requires.
“““
def __contains__(self key):
return (
key == ‘build_ext‘
or super(LazyBuildExtCommandClass self).__contains__(key)
)
def __setitem__(self key value):
if key == ‘build_ext‘:
raise Assertionerror(“build_ext overridden!“)
super(LazyBuildExtCommandClass self).__setitem__(key value)
def __getitem__(self key):
if key != ‘build_ext‘:
return super(LazyBuildExtCommandClass self).__getitem__(key)
from Cython.Distutils import build_ext as cython_build_ext
import numpy
# Cython_build_ext isn‘t a new-style class in Py2.
class build_ext(cython_build_ext object):
“““
Custom build_ext command that lazily adds numpy‘s include_dir to
extensions.
“““
def build_extensions(self):
“““
Lazily append numpy‘s include directory to Extension includes.
This is done here rather than at module scope because setup.py
may be run before numpy has been installed in which case
importing numpy and calling ‘numpy.get_include()‘ will fail.
“““
numpy_incl = numpy.get_include()
for ext in self.extensions:
ext.include_dirs.append(numpy_incl)
super(build_ext self).build_extensions()
return build_ext
ext_modules = [
Extension(‘zipline.assets._assets‘ [‘zipline/assets/_assets.pyx‘])
Extension(‘zipline.lib.adjustment‘ [‘zipline/lib/adjustment.pyx‘])
Extension(
‘zipline.lib._float64window‘ [‘zipline/lib/_float64window.pyx‘]
)
Extension(‘zipline.lib._int64window‘ [‘zipline/lib/_int64window.pyx‘])
Extension(‘zipline.lib._uint8window‘ [‘zipline/lib/_uint8window.pyx‘])
Extension(‘zipl
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-04-14 04:33 zipline-chinese-version_1.1\
文件 663 2017-04-14 04:33 zipline-chinese-version_1.1\AUTHORS
文件 11358 2017-04-14 04:33 zipline-chinese-version_1.1\LICENSE
文件 201 2017-04-14 04:33 zipline-chinese-version_1.1\MANIFEST.in
文件 3517 2017-04-14 04:33 zipline-chinese-version_1.1\README.rst
文件 344 2017-04-14 04:33 zipline-chinese-version_1.1\Vagrantfile
文件 4677 2017-04-14 04:33 zipline-chinese-version_1.1\appveyor.yml
目录 0 2017-04-14 04:33 zipline-chinese-version_1.1\ci\
目录 0 2017-04-14 04:33 zipline-chinese-version_1.1\ci\appveyor\
文件 3111 2017-04-14 04:33 zipline-chinese-version_1.1\ci\appveyor\install.ps1
文件 3600 2017-04-14 04:33 zipline-chinese-version_1.1\ci\appveyor\run_with_env.cmd
文件 72 2017-04-14 04:33 zipline-chinese-version_1.1\ci\appveyor\vcvars64.bat
文件 1779 2017-04-14 04:33 zipline-chinese-version_1.1\ci\make_conda_packages.py
目录 0 2017-04-14 04:33 zipline-chinese-version_1.1\conda\
文件 701 2017-04-14 04:33 zipline-chinese-version_1.1\conda\README.md
目录 0 2017-04-14 04:33 zipline-chinese-version_1.1\conda\bcolz\
文件 236 2017-04-14 04:33 zipline-chinese-version_1.1\conda\bcolz\bld.bat
文件 275 2017-04-14 04:33 zipline-chinese-version_1.1\conda\bcolz\build.sh
文件 1498 2017-04-14 04:33 zipline-chinese-version_1.1\conda\bcolz\me
目录 0 2017-04-14 04:33 zipline-chinese-version_1.1\conda\cyordereddict\
文件 236 2017-04-14 04:33 zipline-chinese-version_1.1\conda\cyordereddict\bld.bat
文件 219 2017-04-14 04:33 zipline-chinese-version_1.1\conda\cyordereddict\build.sh
文件 1461 2017-04-14 04:33 zipline-chinese-version_1.1\conda\cyordereddict\me
目录 0 2017-04-14 04:33 zipline-chinese-version_1.1\conda\logbook\
文件 236 2017-04-14 04:33 zipline-chinese-version_1.1\conda\logbook\bld.bat
文件 219 2017-04-14 04:33 zipline-chinese-version_1.1\conda\logbook\build.sh
文件 1350 2017-04-14 04:33 zipline-chinese-version_1.1\conda\logbook\me
目录 0 2017-04-14 04:33 zipline-chinese-version_1.1\conda\numexpr\
文件 236 2017-04-14 04:33 zipline-chinese-version_1.1\conda\numexpr\bld.bat
文件 219 2017-04-14 04:33 zipline-chinese-version_1.1\conda\numexpr\build.sh
文件 339 2017-04-14 04:33 zipline-chinese-version_1.1\conda\numexpr\me
............此处省略421个文件信息
评论
共有 条评论