Skip to content

Commit 7abfa6a

Browse files
CI: Update docs for 0.3.2 (4f21a65)
1 parent 843bcc3 commit 7abfa6a

File tree

9 files changed

+10237
-11486
lines changed

9 files changed

+10237
-11486
lines changed

β€Ždoc/backtesting/backtesting.htmlβ€Ž

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="utf-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
6-
<meta name="generator" content="pdoc 0.9.2" />
6+
<meta name="generator" content="pdoc 0.10.0" />
77
<title>backtesting.backtesting API documentation</title>
88
<meta name="description" content="Core framework data structures.
99
Objects from this module can also be imported from the top-level
@@ -684,12 +684,12 @@ <h4><code><a title="backtesting.backtesting.Trade" href="#backtesting.backtestin
684684
</main>
685685
<footer id="footer">
686686
<p>
687-
<a href="https://kernc.github.io/backtesting.py/"><cite>backtesting</cite> 0.3.1</a>
687+
<a href="https://kernc.github.io/backtesting.py/"><cite>backtesting</cite> 0.3.2</a>
688688
<span style="color:#ddd">&#21328;</span>
689689
</p>
690690
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
691691
<script>hljs.configure({languages: ['python']}); hljs.initHighlightingOnLoad()</script>
692-
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.9.2</a>.</p>
692+
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
693693
</footer>
694694
<script>window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;ga('create','UA-43663477-4','auto');ga('require','cleanUrlTracker',{indexFilename:'index.html',trailingSlash:'add'});ga('require','outboundLinkTracker',{events:['click','auxclick','contextmenu']});ga('require', 'maxScrollTracker');ga('require', 'pageVisibilityTracker');ga('send', 'pageview');setTimeout(function(){ga('send','event','pageview','view')},15000);</script><script async src='https://www.google-analytics.com/analytics.js'></script><script async src='https://cdnjs.cloudflare.com/ajax/libs/autotrack/2.4.1/autotrack.js'></script></body>
695695
</html>

β€Ždoc/backtesting/index.htmlβ€Ž

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="utf-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
6-
<meta name="generator" content="pdoc 0.9.2" />
6+
<meta name="generator" content="pdoc 0.10.0" />
77
<title>backtesting API documentation</title>
88
<meta name="description" content="Manuals …" />
99
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
@@ -130,12 +130,12 @@ <h1>Index</h1>
130130
</main>
131131
<footer id="footer">
132132
<p>
133-
<a href="https://kernc.github.io/backtesting.py/"><cite>backtesting</cite> 0.3.1</a>
133+
<a href="https://kernc.github.io/backtesting.py/"><cite>backtesting</cite> 0.3.2</a>
134134
<span style="color:#ddd">&#21328;</span>
135135
</p>
136136
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
137137
<script>hljs.configure({languages: ['python']}); hljs.initHighlightingOnLoad()</script>
138-
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.9.2</a>.</p>
138+
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
139139
</footer>
140140
<script>window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;ga('create','UA-43663477-4','auto');ga('require','cleanUrlTracker',{indexFilename:'index.html',trailingSlash:'add'});ga('require','outboundLinkTracker',{events:['click','auxclick','contextmenu']});ga('require', 'maxScrollTracker');ga('require', 'pageVisibilityTracker');ga('send', 'pageview');setTimeout(function(){ga('send','event','pageview','view')},15000);</script><script async src='https://www.google-analytics.com/analytics.js'></script><script async src='https://cdnjs.cloudflare.com/ajax/libs/autotrack/2.4.1/autotrack.js'></script></body>
141141
</html>

β€Ždoc/backtesting/lib.htmlβ€Ž

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="utf-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
6-
<meta name="generator" content="pdoc 0.9.2" />
6+
<meta name="generator" content="pdoc 0.10.0" />
77
<title>backtesting.lib API documentation</title>
88
<meta name="description" content="Collection of common building blocks, helper auxiliary functions and
99
composable strategy classes for reuse …" />
@@ -49,7 +49,7 @@ <h2 class="section-title" id="header-variables">Global variables</h2>
4949
<dd>
5050
<div class="desc"><p>Dictionary of rules for aggregating resampled OHLCV data frames,
5151
e.g.</p>
52-
<pre><code>df.resample('4H', label='right').agg(OHLCV_AGG)
52+
<pre><code>df.resample('4H', label='right').agg(OHLCV_AGG).dropna()
5353
</code></pre></div>
5454
</dd>
5555
<dt id="backtesting.lib.TRADES_AGG"><code class="name">var <span class="ident">TRADES_AGG</span></code></dt>
@@ -75,6 +75,22 @@ <h2 class="section-title" id="header-functions">Functions</h2>
7575
3
7676
</code></pre></div>
7777
</dd>
78+
<dt id="backtesting.lib.compute_stats"><code class="name flex">
79+
<span>def <span class="ident">compute_stats</span></span>(<span>*, stats, data, trades=None, risk_free_rate=0.0)</span>
80+
</code></dt>
81+
<dd>
82+
<div class="desc"><p>(Re-)compute strategy performance metrics.</p>
83+
<p><code>stats</code> is the statistics series as returned by <code><a title="backtesting.backtesting.Backtest.run" href="backtesting.html#backtesting.backtesting.Backtest.run">Backtest.run()</a></code>.
84+
<code>data</code> is OHLC data as passed to the <code><a title="backtesting.backtesting.Backtest" href="backtesting.html#backtesting.backtesting.Backtest">Backtest</a></code>
85+
the <code>stats</code> were obtained in.
86+
<code>trades</code> can be a dataframe subset of <code>stats._trades</code> (e.g. only long trades).
87+
You can also tune <code>risk_free_rate</code>, used in calculation of Sharpe and Sortino ratios.</p>
88+
<pre><code>&gt;&gt;&gt; stats = Backtest(GOOG, MyStrategy).run()
89+
&gt;&gt;&gt; only_long_trades = stats._trades[stats._trades.Size &gt; 0]
90+
&gt;&gt;&gt; long_stats = compute_stats(stats=stats, trades=only_long_trades,
91+
... data=GOOG, risk_free_rate=.02)
92+
</code></pre></div>
93+
</dd>
7894
<dt id="backtesting.lib.cross"><code class="name flex">
7995
<span>def <span class="ident">cross</span></span>(<span>series1, series2)</span>
8096
</code></dt>
@@ -355,6 +371,7 @@ <h1>Index</h1>
355371
<li><h3><a href="#header-functions">Functions</a></h3>
356372
<ul class="two-column">
357373
<li><code><a title="backtesting.lib.barssince" href="#backtesting.lib.barssince">barssince</a></code></li>
374+
<li><code><a title="backtesting.lib.compute_stats" href="#backtesting.lib.compute_stats">compute_stats</a></code></li>
358375
<li><code><a title="backtesting.lib.cross" href="#backtesting.lib.cross">cross</a></code></li>
359376
<li><code><a title="backtesting.lib.crossover" href="#backtesting.lib.crossover">crossover</a></code></li>
360377
<li><code><a title="backtesting.lib.plot_heatmaps" href="#backtesting.lib.plot_heatmaps">plot_heatmaps</a></code></li>
@@ -385,12 +402,12 @@ <h4><code><a title="backtesting.lib.TrailingStrategy" href="#backtesting.lib.Tra
385402
</main>
386403
<footer id="footer">
387404
<p>
388-
<a href="https://kernc.github.io/backtesting.py/"><cite>backtesting</cite> 0.3.1</a>
405+
<a href="https://kernc.github.io/backtesting.py/"><cite>backtesting</cite> 0.3.2</a>
389406
<span style="color:#ddd">&#21328;</span>
390407
</p>
391408
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
392409
<script>hljs.configure({languages: ['python']}); hljs.initHighlightingOnLoad()</script>
393-
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.9.2</a>.</p>
410+
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
394411
</footer>
395412
<script>window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;ga('create','UA-43663477-4','auto');ga('require','cleanUrlTracker',{indexFilename:'index.html',trailingSlash:'add'});ga('require','outboundLinkTracker',{events:['click','auxclick','contextmenu']});ga('require', 'maxScrollTracker');ga('require', 'pageVisibilityTracker');ga('send', 'pageview');setTimeout(function(){ga('send','event','pageview','view')},15000);</script><script async src='https://www.google-analytics.com/analytics.js'></script><script async src='https://cdnjs.cloudflare.com/ajax/libs/autotrack/2.4.1/autotrack.js'></script></body>
396413
</html>

β€Ždoc/backtesting/test/index.htmlβ€Ž

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="utf-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
6-
<meta name="generator" content="pdoc 0.9.2" />
6+
<meta name="generator" content="pdoc 0.10.0" />
77
<title>backtesting.test API documentation</title>
88
<meta name="description" content="Data and utilities for testing." />
99
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
@@ -99,12 +99,12 @@ <h1>Index</h1>
9999
</main>
100100
<footer id="footer">
101101
<p>
102-
<a href="https://kernc.github.io/backtesting.py/"><cite>backtesting</cite> 0.3.1</a>
102+
<a href="https://kernc.github.io/backtesting.py/"><cite>backtesting</cite> 0.3.2</a>
103103
<span style="color:#ddd">&#21328;</span>
104104
</p>
105105
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
106106
<script>hljs.configure({languages: ['python']}); hljs.initHighlightingOnLoad()</script>
107-
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.9.2</a>.</p>
107+
<p>Generated by <a href="https://pdoc3.github.io/pdoc" title="pdoc: Python API documentation generator"><cite>pdoc</cite> 0.10.0</a>.</p>
108108
</footer>
109109
<script>window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;ga('create','UA-43663477-4','auto');ga('require','cleanUrlTracker',{indexFilename:'index.html',trailingSlash:'add'});ga('require','outboundLinkTracker',{events:['click','auxclick','contextmenu']});ga('require', 'maxScrollTracker');ga('require', 'pageVisibilityTracker');ga('send', 'pageview');setTimeout(function(){ga('send','event','pageview','view')},15000);</script><script async src='https://www.google-analytics.com/analytics.js'></script><script async src='https://cdnjs.cloudflare.com/ajax/libs/autotrack/2.4.1/autotrack.js'></script></body>
110110
</html>

0 commit comments

Comments
Β (0)