Skip to content

Commit

Permalink
Merge branch 'alphabacktest' to release version 0.20
Browse files Browse the repository at this point in the history
  • Loading branch information
brillliantz committed Oct 19, 2017
2 parents cdd3738 + bff86be commit e25c902
Show file tree
Hide file tree
Showing 47 changed files with 1,676 additions and 1,044 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ $ pip install jaqs --upgrade
Quickstart
==========

参见 `user guide <doc/source/user_guide.rst>`__
参见 `入门指南 <doc/source/user_guide.rst>`__

更多的示例保存在 ``jaqs/examples``

Expand Down
11 changes: 9 additions & 2 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@

# DataView
-[] when fetching data, cache fetched data. So if fail, we do not need to fetch all data again.
-[] if data of some symbols is missing, dv.data_d or dv.data_q will be wrong
-[] '&&' operator can not be True in isOps2()
-[x] if data of some symbols is missing, dv.data_d or dv.data_q will be wrong
-[x] '&&' operator can not be True in isOps2()
-[] when should it fetches price_adj

# Code Improvement of DataView
-[] improve get, get_quarter_ts methods.
Expand All @@ -57,3 +58,9 @@

# Analyze
-[] jinja2 search path does not work on Windows

# on branch alphabacktest
-[x] register signal function, no activation needed
-[x] limit reachers: in re_balance_plan_after_open, set weights to zero
-[x] index members: in re_balance_plan_before_open, set weights to zero
-[x] stock selection: use StockSelector class.
68 changes: 63 additions & 5 deletions doc/Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,76 @@
# Minimal makefile for Sphinx documentation
# Makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS = -v # verbose output
SPHINXBUILD = python -msphinx
SPHINXPROJ = quantOS
SPHINXBUILD = sphinx-build
SOURCEDIR = source
PAPER =
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
# User-friendly check for sphinx-build
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
endif

# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(SOURCEDIR)
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .

.PHONY: help
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " applehelp to make an Apple Help Book"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " texinfo to make Texinfo files"
@echo " info to make Texinfo files and run them through makeinfo"
@echo " gettext to make PO message catalogs"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " xml to make Docutils-native XML files"
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
@echo " coverage to run coverage check of the documentation (if enabled)"

.PHONY: clean
clean:
rm -rf $(BUILDDIR)/*

# @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: html
html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."

.PHONY: dirhtml
dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."

.PHONY: help Makefile
.PHONY: singlehtml
singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
Expand Down
4 changes: 2 additions & 2 deletions doc/base_data.md
Original file line number Diff line number Diff line change
Expand Up @@ -664,8 +664,8 @@ df, msg = api.query(
| ebitda | double | 息税折旧摊销前利润 |
| net\_profit\_after\_ded\_nr\_lp | double | 扣除非经常性损益后净利润 |
| net\_profit\_under\_intl\_acc\_sta | double | 国际会计准则净利润 |
| s\_fa\_eps\_basic | double | 基本每股收益 |
| s\_fa\_eps\_diluted | double | 稀释每股收益 |
| eps\_basic | double | 基本每股收益 |
| eps\_diluted | double | 稀释每股收益 |
| insurance\_expense | double | 保险业务支出 |
| spe\_bal\_oper\_profit | double | 营业利润差额(特殊报表科目) |
| tot\_bal\_oper\_profit | double | 营业利润差额(合计平衡项目) |
Expand Down
9 changes: 5 additions & 4 deletions doc/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,19 @@

打开上面的网址,选择相应的操作系统,确定要按照的Python版本,一般建议用Python 2.7。

![](img/anac.png)
![](https://github.com/quantOS-org/jaqs/blob/master/doc/img/anac.png)


下载完成以后,按照图形界面步骤完成安装。在默认情况下,Anaconda会自动设置PATH环境。

安装完成后,windows下我们可以在系统菜单中看如下程序目录:

![](img/anac_m.png)
![](https://github.com/quantOS-org/jaqs/blob/master/doc/img/anac_m.png)


在cmd里执行ipyhont命令,可以调出IPython调试器。

![](img/anac_ipython.png)
![](https://github.com/quantOS-org/jaqs/blob/master/doc/img/anac_ipython.png)


2、安装依赖包
Expand Down Expand Up @@ -79,4 +80,4 @@ git clone [https://github.com/quantOS-org/jaqs.git](https://github.com/quantOS-o

完成安装以后,执行import确认安装是否成功。

![](img/jaqs_test.png)
![](https://github.com/quantOS-org/jaqs/blob/master/doc/img/jaqs_test.png)
28 changes: 28 additions & 0 deletions doc/source/api_reference.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
API说明文档
============

行情数据API文档
---------------
.. toctree::
:maxdepth: 2

market_data


参考数据API文档
---------------
.. toctree::
:maxdepth: 2

base_data


Other Important APIs
--------------------

.. toctree::
:maxdepth: 2

jaqs.data
jaqs.trade
jaqs.util
4 changes: 2 additions & 2 deletions doc/source/base_data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1037,9 +1037,9 @@
+--------------------------------------+----------+---------------------------------------+
| net\_profit\_under\_intl\_acc\_sta | double | 国际会计准则净利润 |
+--------------------------------------+----------+---------------------------------------+
| s\_fa\_eps\_basic | double | 基本每股收益 |
| eps\_basic | double | 基本每股收益 |
+--------------------------------------+----------+---------------------------------------+
| s\_fa\_eps\_diluted | double | 稀释每股收益 |
| eps\_diluted | double | 稀释每股收益 |
+--------------------------------------+----------+---------------------------------------+
| insurance\_expense | double | 保险业务支出 |
+--------------------------------------+----------+---------------------------------------+
Expand Down
27 changes: 14 additions & 13 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# jaqs documentation build configuration file, created by
# JAQS documentation build configuration file, created by
# sphinx-quickstart on Wed Sep 6 21:30:13 2017.
#
# This file is execfile()d with the current directory set to its
Expand All @@ -19,6 +19,7 @@
import os
import sys
sys.path.insert(0, os.path.abspath('../..'))
import jaqs


# -- General configuration ------------------------------------------------
Expand All @@ -32,11 +33,11 @@
# ones.
# sys.path.insert(0, os.path.abspath('../extentions/numpydoc'))
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.napoleon',#'numpydoc',
'sphinx.ext.imgmath',
'sphinx.ext.intersphinx', 'sphinx.ext.coverage',
'sphinx.ext.imgmath',
'sphinx.ext.intersphinx', 'sphinx.ext.coverage',
'sphinx.ext.doctest',
#'sphinx.ext.autosummary',
#'sphinx.ext.coverage',
# 'sphinx.ext.autosummary',
# 'sphinx.ext.coverage',
]
# autosummary_generate = True

Expand Down Expand Up @@ -65,7 +66,7 @@
master_doc = 'index'

# General information about the project.
project = u'jaqs'
project = u'JAQS'
copyright = u'2017, quantOS.org'
author = u'quantOS.org'

Expand All @@ -76,9 +77,9 @@
# built documents.
#
# The short X.Y version.
version = u''
version = jaqs.__version__
# The full version, including alpha/beta/rc tags.
release = u''
release = u'' + jaqs.__version__

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down Expand Up @@ -135,7 +136,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['static']
html_static_path = ['../img']

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
Expand All @@ -156,7 +157,7 @@
# -- Options for HTMLHelp output ------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'jaqs'
htmlhelp_basename = 'JAQS'


# -- Options for LaTeX output ---------------------------------------------
Expand All @@ -183,7 +184,7 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'jaqs.tex', u'jaqs Documentation',
(master_doc, 'jaqs.tex', u'JAQS Documentation',
u'brillliantz', 'manual'),
]

Expand All @@ -193,7 +194,7 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'jaqs', u'jaqs Documentation',
(master_doc, 'jaqs', u'JAQS Documentation',
[author], 1)
]

Expand All @@ -204,7 +205,7 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'jaqs', u'jaqs Documentation',
(master_doc, 'jaqs', u'JAQS Documentation',
author, 'jaqs', 'One line description of project.',
'Miscellaneous'),
]
Expand Down
54 changes: 39 additions & 15 deletions doc/source/index.rst
Original file line number Diff line number Diff line change
@@ -1,25 +1,49 @@
.. aaaaasdf documentation master file, created by
sphinx-quickstart on Sun Oct 15 14:52:17 2017.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.

.. include:: ../../README.rst
JAQS: Just Another Quant System.
==========================================================

在这里,你将可以获得:

Contents
====================================
- 使用数据API,轻松获取研究数据
- 根据策略模板,编写自己的量化策略
- 使用回测框架,对策略进行回测和验证

查看代码,请点击\ `GitHub <http://github.com/quantOS-org/jaqs>`__\

Install Guide
-------------

A detailed step-by-step description of installation.

.. toctree::
:maxdepth: 1
:maxdepth: 2

install


User Guide
-------------

一个简洁清晰的入门指南, 涵盖各个功能模块.

.. toctree::
:maxdepth: 2

user_guide
jaqs


.. Indices and tables
.. ==================
..
.. * :ref:`genindex`
.. * :ref:`modindex`
.. * :ref:`search`
API Refrence
-------------

If you want to know about package hierarchy, specific class / function...

.. toctree::
:maxdepth: 2

api_reference


License
-------

Apache 2.0许可协议。版权所有(c)2017 quantOS-org(量化开源会)。
8 changes: 4 additions & 4 deletions doc/source/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ git clone

|image3|

.. |image0| image:: img/anac.png
.. |image1| image:: img/anac_m.png
.. |image2| image:: img/anac_ipython.png
.. |image3| image:: img/jaqs_test.png
.. |image0| image:: https://github.com/quantOS-org/jaqs/blob/master/doc/img/anac.png
.. |image1| image:: https://github.com/quantOS-org/jaqs/blob/master/doc/img/anac_m.png
.. |image2| image:: https://github.com/quantOS-org/jaqs/blob/master/doc/img/anac_ipython.png
.. |image3| image:: https://github.com/quantOS-org/jaqs/blob/master/doc/img/jaqs_test.png

0 comments on commit e25c902

Please sign in to comment.