Skip to content

Commit

Permalink
#update for spinx doc
Browse files Browse the repository at this point in the history
  • Loading branch information
yutiansut committed May 7, 2018
1 parent afbe711 commit 9891316
Show file tree
Hide file tree
Showing 186 changed files with 51,379 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = QUANTAXIS
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
Binary file added _build/doctrees/QUANTAXIS_Trade/README.doctree
Binary file not shown.
Binary file added _build/doctrees/README.doctree
Binary file not shown.
Binary file added _build/doctrees/environment.pickle
Binary file not shown.
Binary file added _build/doctrees/index.doctree
Binary file not shown.
Binary file added _build/doctrees/source/QUANTAXIS.QAARP.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added _build/doctrees/source/QUANTAXIS.QACmd.doctree
Binary file not shown.
Binary file added _build/doctrees/source/QUANTAXIS.QAData.doctree
Binary file not shown.
Binary file not shown.
Binary file added _build/doctrees/source/QUANTAXIS.QAEngine.doctree
Binary file not shown.
Binary file added _build/doctrees/source/QUANTAXIS.QAFetch.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added _build/doctrees/source/QUANTAXIS.QASU.doctree
Binary file not shown.
Binary file added _build/doctrees/source/QUANTAXIS.QAUtil.doctree
Binary file not shown.
Binary file added _build/doctrees/source/QUANTAXIS.QAWeb.doctree
Binary file not shown.
Binary file added _build/doctrees/source/QUANTAXIS.doctree
Binary file not shown.
Binary file added _build/doctrees/source/modules.doctree
Binary file not shown.
4 changes: 4 additions & 0 deletions _build/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 18e9302a06caccca0fbd1c9498c2e667
tags: 645f666f9bcd5a90fca523b33c5a78b7
Empty file added _build/html/.nojekyll
Empty file.
208 changes: 208 additions & 0 deletions _build/html/QUANTAXIS_Trade/README.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="python">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>QUANTAXIS quantitative financial strategy framework &#8212; QUANTAXIS 1.0 documentation</title>
<link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript" src="../_static/documentation_options.js"></script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />

<link rel="stylesheet" href="../_static/custom.css" type="text/css" />


<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />

</head><body>


<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">

<div class="section" id="quantaxis-quantitative-financial-strategy-framework">
<h1>QUANTAXIS quantitative financial strategy framework<a class="headerlink" href="#quantaxis-quantitative-financial-strategy-framework" title="Permalink to this headline">¶</a></h1>
<p>QUANTAXIS quantitative framework to achieve the stock and futures market, the whole species back to the test.Through the distributed crawler for data capture, to build a response to the data cleaning and market push engine to build a multi-language open response frame. And build interactive visualization of clients and websites.</p>
<a class="reference external image-reference" href="https://waffle.io/yutiansut/QUANTAXIS"><img alt="'Stories in Ready'" src="https://badge.waffle.io/yutiansut/QUANTAXIS.svg?label=ready&amp;title=Ready" /></a>
<div class="section" id="x-release-note">
<h2>0.4.x Release Note<a class="headerlink" href="#x-release-note" title="Permalink to this headline">¶</a></h2>
<p>QUANTAXIS Quantitative Financial Strategy Framework is a quantitative analysis solution for small and medium-sized strategy teams.We can quickly implement scene-oriented customization solutions with highly decoupled modularity and standardized protocols. QUANTAXIS is a progressive open Framework, you can according to their own needs, the introduction of their own data, analysis programs, visualization process, you can also RESTful interface, the rapid realization of multi-LAN / WAN collaboration.</p>
<p>QUANTAXIS and many excellent domestic quantitative platform is the difference, QA more concerned about the user experience and the actual situation, for the user needs will be more optimized, so will pay more attention to openness, the introduction of custom convenience, and the team Collaborative details are handled, such as custom data introductions, custom policy chart comparison, custom risk and policy portfolio management, and so on.</p>
<ul class="simple">
<li>Welcome group discussion: [group link] (<a class="reference external" href="https://jq.qq.com/?_wv=1027&amp;k=4CEKGzn">https://jq.qq.com/?_wv=1027&amp;k=4CEKGzn</a>)</li>
<li>For more information, see <a class="reference external" href="https://github.com/yutiansut/QUANTAXIS/blob/0.4-beta/update_log.md">https://github.com/yutiansut/QUANTAXIS/blob/0.4-beta/update_log.md</a></li>
<li>If you have any questions, you can send [issue] (<a class="reference external" href="https://github.com/yutiansut/QUANTAXIS/issues">https://github.com/yutiansut/QUANTAXIS/issues</a>) on github, or contact us at QQ 279336410, QQ group 563280067</li>
</ul>
<hr class="docutils" />
<p>More info on <a class="reference external" href="https://github.com/yutiansut/quantaxis">https://github.com/yutiansut/quantaxis</a></p>
<p>An EXAMPLE of QUANTAXIS BACKTEST like that below:</p>
<div class="code python highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">QUANTAXIS</span> <span class="k">as</span> <span class="nn">QA</span>
<span class="kn">from</span> <span class="nn">QUANTAXIS</span> <span class="k">import</span> <span class="n">QA_Backtest_stock_day</span> <span class="k">as</span> <span class="n">QB</span>


<span class="sd">&quot;&quot;&quot;</span>
<span class="sd">Written Before:</span>
<span class="sd">===============QUANTAXIS BACKTEST STOCK_DAY&#39;s Constant</span>
<span class="sd">Constant:</span>
<span class="sd">QB.account.message</span>
<span class="sd">QB.account.cash</span>
<span class="sd">QB.account.hold</span>
<span class="sd">QB.account.history</span>
<span class="sd">QB.account.assets</span>
<span class="sd">QB.account.detail</span>
<span class="sd">QB.account.init_assest</span>



<span class="sd">QB.strategy_stock_list</span>
<span class="sd">QB.strategy_start_date</span>
<span class="sd">QB.strategy_end_date</span>


<span class="sd">QB.today</span>

<span class="sd">QB.benchmark_code</span>




<span class="sd">Function:</span>
<span class="sd">get the market data (based on gap):</span>
<span class="sd">QB.QA_backtest_get_market_data(QB,code,QB.today)</span>
<span class="sd">get the market data as you want:</span>
<span class="sd">QA.QA_fetch_stock_day(code,start,end,model)</span>


<span class="sd">Order :</span>
<span class="sd">QB.QA_backtest_send_order(QB, code,amount,towards,order: dict)</span>

<span class="sd">order has three model:</span>
<span class="sd">1.Limited order order[&#39;order_model&#39;]=0 or l,L</span>
<span class="sd">attention: this model should have a order[&#39;price&#39;] key</span>
<span class="sd">order[&#39;price&#39;]=xxxx</span>

<span class="sd">2.Market order order[&#39;order_model&#39;]=1 or m,M,market,Market</span>
<span class="sd">3.Strict model order[&#39;order_model&#39;]=2 or s,S</span>
<span class="sd"> which is buy in the highest price or sell in the lowest price</span>

<span class="sd">Query the hold amount</span>

<span class="sd">QB.QA_backtest_hold_amount(QB,code)</span>


<span class="sd">&quot;&quot;&quot;</span>


<span class="nd">@QB</span><span class="o">.</span><span class="n">backtest_init</span>
<span class="k">def</span> <span class="nf">init</span><span class="p">():</span>
<span class="c1">#</span>
<span class="n">QB</span><span class="o">.</span><span class="n">setting</span><span class="o">.</span><span class="n">QA_util_sql_mongo_ip</span><span class="o">=</span><span class="s1">&#39;127.0.0.1&#39;</span>

<span class="n">QB</span><span class="o">.</span><span class="n">account</span><span class="o">.</span><span class="n">init_assest</span><span class="o">=</span><span class="mi">2500000</span>
<span class="n">QB</span><span class="o">.</span><span class="n">benchmark_code</span><span class="o">=</span><span class="s1">&#39;hs300&#39;</span>

<span class="n">QB</span><span class="o">.</span><span class="n">strategy_stock_list</span><span class="o">=</span><span class="p">[</span><span class="s1">&#39;000001&#39;</span><span class="p">,</span><span class="s1">&#39;000002&#39;</span><span class="p">,</span><span class="s1">&#39;600010&#39;</span><span class="p">,</span><span class="s1">&#39;601801&#39;</span><span class="p">,</span><span class="s1">&#39;603111&#39;</span><span class="p">]</span>
<span class="n">QB</span><span class="o">.</span><span class="n">strategy_start_date</span><span class="o">=</span><span class="s1">&#39;2017-03-01&#39;</span>
<span class="n">QB</span><span class="o">.</span><span class="n">strategy_end_date</span><span class="o">=</span><span class="s1">&#39;2017-07-01&#39;</span>

<span class="nd">@QB</span><span class="o">.</span><span class="n">before_backtest</span>
<span class="k">def</span> <span class="nf">before_backtest</span><span class="p">():</span>
<span class="k">global</span> <span class="n">risk_position</span>
<span class="n">QA</span><span class="o">.</span><span class="n">QA_util_log_info</span><span class="p">(</span><span class="n">QB</span><span class="o">.</span><span class="n">account</span><span class="o">.</span><span class="n">message</span><span class="p">)</span>



<span class="nd">@QB</span><span class="o">.</span><span class="n">load_strategy</span>
<span class="k">def</span> <span class="nf">strategy</span><span class="p">():</span>
<span class="c1">#print(QB.account.message)</span>
<span class="c1">#print(QB.account.cash)</span>
<span class="c1">#input()</span>

<span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="n">QB</span><span class="o">.</span><span class="n">strategy_stock_list</span><span class="p">:</span>
<span class="n">QA</span><span class="o">.</span><span class="n">QA_util_log_info</span><span class="p">(</span><span class="n">QB</span><span class="o">.</span><span class="n">QA_backtest_get_market_data</span><span class="p">(</span><span class="n">QB</span><span class="p">,</span><span class="n">item</span><span class="p">,</span><span class="n">QB</span><span class="o">.</span><span class="n">today</span><span class="p">))</span>
<span class="k">if</span> <span class="n">QB</span><span class="o">.</span><span class="n">QA_backtest_hold_amount</span><span class="p">(</span><span class="n">QB</span><span class="p">,</span><span class="n">item</span><span class="p">)</span><span class="o">==</span><span class="mi">0</span><span class="p">:</span>
<span class="n">QB</span><span class="o">.</span><span class="n">QA_backtest_send_order</span><span class="p">(</span><span class="n">QB</span><span class="p">,</span><span class="n">item</span><span class="p">,</span><span class="mi">10000</span><span class="p">,</span><span class="mi">1</span><span class="p">,{</span><span class="s1">&#39;order_model&#39;</span><span class="p">:</span><span class="s1">&#39;Market&#39;</span><span class="p">})</span>


<span class="k">else</span><span class="p">:</span>
<span class="c1">#print(QB.QA_backtest_hold_amount(QB,item))</span>
<span class="n">QB</span><span class="o">.</span><span class="n">QA_backtest_send_order</span><span class="p">(</span><span class="n">QB</span><span class="p">,</span><span class="n">item</span><span class="p">,</span><span class="mi">10000</span><span class="p">,</span><span class="o">-</span><span class="mi">1</span><span class="p">,{</span><span class="s1">&#39;order_model&#39;</span><span class="p">:</span><span class="s1">&#39;Market&#39;</span><span class="p">})</span>

<span class="nd">@QB</span><span class="o">.</span><span class="n">end_backtest</span>
<span class="k">def</span> <span class="nf">after_backtest</span><span class="p">():</span>
<span class="k">pass</span>
</pre></div>
</div>
</div>
</div>


</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="../index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">QUANTAXIS quantitative financial strategy framework</a><ul>
<li><a class="reference internal" href="#x-release-note">0.4.x Release Note</a></li>
</ul>
</li>
</ul>
<div class="relations">
<h3>Related Topics</h3>
<ul>
<li><a href="../index.html">Documentation overview</a><ul>
</ul></li>
</ul>
</div>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/QUANTAXIS_Trade/README.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy;2018, yutiansut.

|
Powered by <a href="http://sphinx-doc.org/">Sphinx 1.7.2</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.10</a>

|
<a href="../_sources/QUANTAXIS_Trade/README.rst.txt"
rel="nofollow">Page source</a>
</div>




</body>
</html>
Loading

0 comments on commit 9891316

Please sign in to comment.