Skip to content

Commit 51c0057

Browse files
docs example result
1 parent a960ec9 commit 51c0057

File tree

15 files changed

+145
-13
lines changed

15 files changed

+145
-13
lines changed

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,17 @@ class SmaCross(Strategy):
9494
bt = Backtest(GOOG, SmaCross, commission=.002, exclusive_orders=True)
9595
stats = bt.run()
9696
bt.plot()
97+
print(f"\r\nOverview:\r\n{stats}\r\n")
98+
print(f"\r\nEquity:\r\n{stats['_equity_curve']}\r\n")
99+
print(f"\r\nTrades:\r\n{stats['_trades']}\r\n")
97100
```
98101

99102
Results in:
100103

101104
[![Backtesting HTML result](https://raw.githubusercontent.com/LUCIT-Systems-and-Development/lucit-backtesting/master/images/example_html_result.png)](https://lucit-backtesting.docs.lucit.tech/_static/example_result.html)
102105

103106
```
107+
Overview:
104108
Start 2004-08-19 00:00:00
105109
End 2013-03-01 00:00:00
106110
Duration 3116 days 00:00:00
@@ -133,6 +137,35 @@ _strategy SmaCross(n1=10, n2=20)
133137
_equity_curve Equ...
134138
_trades Size EntryB...
135139
dtype: object
140+
141+
Equity:
142+
Equity DrawdownPct DrawdownDuration
143+
Date
144+
2023-01-02 13:03:00 10000.00000 0.000000 NaT
145+
2023-01-02 13:04:00 10000.00000 0.000000 NaT
146+
2023-01-02 13:05:00 10000.00000 0.000000 NaT
147+
2023-01-02 13:06:00 10000.00000 0.000000 NaT
148+
2023-01-02 13:07:00 10000.00000 0.000000 NaT
149+
... ... ... ...
150+
2024-01-01 00:55:00 11585.32229 0.050322 NaT
151+
2024-01-01 00:56:00 11585.32229 0.050322 NaT
152+
2024-01-01 00:57:00 11585.32229 0.050322 NaT
153+
2024-01-01 00:58:00 11585.32229 0.050322 NaT
154+
2024-01-01 00:59:00 11585.32229 0.050322 51 days 18:57:00
155+
156+
Trades:
157+
Size EntryBar ExitBar EntryPrice ExitPrice PnL ReturnPct EntryTime ExitTime Tag Duration
158+
0 6 23305 23305 1524.62018 1517.480252 -42.839567 -0.004683 2023-01-18 17:28:00 2023-01-18 17:28:00 None 0 days 00:00:00
159+
1 6 23308 23568 1522.60415 1521.180000 -8.544900 -0.000935 2023-01-18 17:31:00 2023-01-18 21:51:00 None 0 days 04:20:00
160+
2 6 23569 32957 1525.95417 1543.780000 106.954980 0.011682 2023-01-18 21:52:00 2023-01-25 10:20:00 None 6 days 12:28:00
161+
3 6 32958 40820 1546.69621 1542.810000 -23.317260 -0.002513 2023-01-25 10:21:00 2023-01-30 21:23:00 None 5 days 11:02:00
162+
4 6 40821 43959 1550.01614 1690.310000 841.763160 0.090511 2023-01-30 21:24:00 2023-02-02 01:42:00 None 2 days 04:18:00
163+
.. ... ... ... ... ... ... ... ... ... ... ...
164+
78 5 488520 488665 2205.67724 2184.630000 -105.236200 -0.009542 2023-12-11 19:03:00 2023-12-11 21:28:00 None 0 days 02:25:00
165+
79 5 488666 488673 2192.94917 2185.350000 -37.995850 -0.003465 2023-12-11 21:29:00 2023-12-11 21:36:00 None 0 days 00:07:00
166+
80 5 488674 489911 2191.03344 2187.110000 -19.617200 -0.001791 2023-12-11 21:37:00 2023-12-12 18:14:00 None 0 days 20:37:00
167+
81 5 489912 503782 2188.65633 2305.250000 582.968350 0.053272 2023-12-12 18:15:00 2023-12-22 09:25:00 None 9 days 15:10:00
168+
82 5 514701 517609 2277.31150 2259.124026 -90.937372 -0.007986 2023-12-29 23:24:00 2023-12-31 23:52:00 None 2 days 00:28:00
136169
```
137170

138171
## Bugs

dev/sphinx/source/readme.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,17 @@ class SmaCross(Strategy):
9494
bt = Backtest(GOOG, SmaCross, commission=.002, exclusive_orders=True)
9595
stats = bt.run()
9696
bt.plot()
97+
print(f"\r\nOverview:\r\n{stats}\r\n")
98+
print(f"\r\nEquity:\r\n{stats['_equity_curve']}\r\n")
99+
print(f"\r\nTrades:\r\n{stats['_trades']}\r\n")
97100
```
98101

99102
Results in:
100103

101104
[![Backtesting HTML result](https://raw.githubusercontent.com/LUCIT-Systems-and-Development/lucit-backtesting/master/images/example_html_result.png)](https://lucit-backtesting.docs.lucit.tech/_static/example_result.html)
102105

103106
```
107+
Overview:
104108
Start 2004-08-19 00:00:00
105109
End 2013-03-01 00:00:00
106110
Duration 3116 days 00:00:00
@@ -133,6 +137,35 @@ _strategy SmaCross(n1=10, n2=20)
133137
_equity_curve Equ...
134138
_trades Size EntryB...
135139
dtype: object
140+
141+
Equity:
142+
Equity DrawdownPct DrawdownDuration
143+
Date
144+
2023-01-02 13:03:00 10000.00000 0.000000 NaT
145+
2023-01-02 13:04:00 10000.00000 0.000000 NaT
146+
2023-01-02 13:05:00 10000.00000 0.000000 NaT
147+
2023-01-02 13:06:00 10000.00000 0.000000 NaT
148+
2023-01-02 13:07:00 10000.00000 0.000000 NaT
149+
... ... ... ...
150+
2024-01-01 00:55:00 11585.32229 0.050322 NaT
151+
2024-01-01 00:56:00 11585.32229 0.050322 NaT
152+
2024-01-01 00:57:00 11585.32229 0.050322 NaT
153+
2024-01-01 00:58:00 11585.32229 0.050322 NaT
154+
2024-01-01 00:59:00 11585.32229 0.050322 51 days 18:57:00
155+
156+
Trades:
157+
Size EntryBar ExitBar EntryPrice ExitPrice PnL ReturnPct EntryTime ExitTime Tag Duration
158+
0 6 23305 23305 1524.62018 1517.480252 -42.839567 -0.004683 2023-01-18 17:28:00 2023-01-18 17:28:00 None 0 days 00:00:00
159+
1 6 23308 23568 1522.60415 1521.180000 -8.544900 -0.000935 2023-01-18 17:31:00 2023-01-18 21:51:00 None 0 days 04:20:00
160+
2 6 23569 32957 1525.95417 1543.780000 106.954980 0.011682 2023-01-18 21:52:00 2023-01-25 10:20:00 None 6 days 12:28:00
161+
3 6 32958 40820 1546.69621 1542.810000 -23.317260 -0.002513 2023-01-25 10:21:00 2023-01-30 21:23:00 None 5 days 11:02:00
162+
4 6 40821 43959 1550.01614 1690.310000 841.763160 0.090511 2023-01-30 21:24:00 2023-02-02 01:42:00 None 2 days 04:18:00
163+
.. ... ... ... ... ... ... ... ... ... ... ...
164+
78 5 488520 488665 2205.67724 2184.630000 -105.236200 -0.009542 2023-12-11 19:03:00 2023-12-11 21:28:00 None 0 days 02:25:00
165+
79 5 488666 488673 2192.94917 2185.350000 -37.995850 -0.003465 2023-12-11 21:29:00 2023-12-11 21:36:00 None 0 days 00:07:00
166+
80 5 488674 489911 2191.03344 2187.110000 -19.617200 -0.001791 2023-12-11 21:37:00 2023-12-12 18:14:00 None 0 days 20:37:00
167+
81 5 489912 503782 2188.65633 2305.250000 582.968350 0.053272 2023-12-12 18:15:00 2023-12-22 09:25:00 None 9 days 15:10:00
168+
82 5 514701 517609 2277.31150 2259.124026 -90.937372 -0.007986 2023-12-29 23:24:00 2023-12-31 23:52:00 None 2 days 00:28:00
136169
```
137170

138171
## Bugs

docs/_modules/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ <h3>Navigation</h3>
249249
<a href="https://docs.lucit.tech">Index of all LUCIT Software Documentation</a><br />
250250
&copy; <a href="/license.html">Copyright</a> 2024-2024, LUCIT Systems and Development. All Rights Reserved..
251251
See <a href="/license.html">License</a> for more information.<br />
252-
Last updated on Jun 07 2024 at 10:42 (CET).
252+
Last updated on Jun 07 2024 at 10:51 (CET).
253253
<a href="https://github.com/LUCIT-Systems-and-Development/lucit-backtesting/issues/new/choose">Found a bug</a>?
254254
<br />
255255
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.2.6.

docs/_sources/readme.md.txt

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,17 @@ class SmaCross(Strategy):
9494
bt = Backtest(GOOG, SmaCross, commission=.002, exclusive_orders=True)
9595
stats = bt.run()
9696
bt.plot()
97+
print(f"\r\nOverview:\r\n{stats}\r\n")
98+
print(f"\r\nEquity:\r\n{stats['_equity_curve']}\r\n")
99+
print(f"\r\nTrades:\r\n{stats['_trades']}\r\n")
97100
```
98101

99102
Results in:
100103

101104
[![Backtesting HTML result](https://raw.githubusercontent.com/LUCIT-Systems-and-Development/lucit-backtesting/master/images/example_html_result.png)](https://lucit-backtesting.docs.lucit.tech/_static/example_result.html)
102105

103106
```
107+
Overview:
104108
Start 2004-08-19 00:00:00
105109
End 2013-03-01 00:00:00
106110
Duration 3116 days 00:00:00
@@ -133,6 +137,35 @@ _strategy SmaCross(n1=10, n2=20)
133137
_equity_curve Equ...
134138
_trades Size EntryB...
135139
dtype: object
140+
141+
Equity:
142+
Equity DrawdownPct DrawdownDuration
143+
Date
144+
2023-01-02 13:03:00 10000.00000 0.000000 NaT
145+
2023-01-02 13:04:00 10000.00000 0.000000 NaT
146+
2023-01-02 13:05:00 10000.00000 0.000000 NaT
147+
2023-01-02 13:06:00 10000.00000 0.000000 NaT
148+
2023-01-02 13:07:00 10000.00000 0.000000 NaT
149+
... ... ... ...
150+
2024-01-01 00:55:00 11585.32229 0.050322 NaT
151+
2024-01-01 00:56:00 11585.32229 0.050322 NaT
152+
2024-01-01 00:57:00 11585.32229 0.050322 NaT
153+
2024-01-01 00:58:00 11585.32229 0.050322 NaT
154+
2024-01-01 00:59:00 11585.32229 0.050322 51 days 18:57:00
155+
156+
Trades:
157+
Size EntryBar ExitBar EntryPrice ExitPrice PnL ReturnPct EntryTime ExitTime Tag Duration
158+
0 6 23305 23305 1524.62018 1517.480252 -42.839567 -0.004683 2023-01-18 17:28:00 2023-01-18 17:28:00 None 0 days 00:00:00
159+
1 6 23308 23568 1522.60415 1521.180000 -8.544900 -0.000935 2023-01-18 17:31:00 2023-01-18 21:51:00 None 0 days 04:20:00
160+
2 6 23569 32957 1525.95417 1543.780000 106.954980 0.011682 2023-01-18 21:52:00 2023-01-25 10:20:00 None 6 days 12:28:00
161+
3 6 32958 40820 1546.69621 1542.810000 -23.317260 -0.002513 2023-01-25 10:21:00 2023-01-30 21:23:00 None 5 days 11:02:00
162+
4 6 40821 43959 1550.01614 1690.310000 841.763160 0.090511 2023-01-30 21:24:00 2023-02-02 01:42:00 None 2 days 04:18:00
163+
.. ... ... ... ... ... ... ... ... ... ... ...
164+
78 5 488520 488665 2205.67724 2184.630000 -105.236200 -0.009542 2023-12-11 19:03:00 2023-12-11 21:28:00 None 0 days 02:25:00
165+
79 5 488666 488673 2192.94917 2185.350000 -37.995850 -0.003465 2023-12-11 21:29:00 2023-12-11 21:36:00 None 0 days 00:07:00
166+
80 5 488674 489911 2191.03344 2187.110000 -19.617200 -0.001791 2023-12-11 21:37:00 2023-12-12 18:14:00 None 0 days 20:37:00
167+
81 5 489912 503782 2188.65633 2305.250000 582.968350 0.053272 2023-12-12 18:15:00 2023-12-22 09:25:00 None 9 days 15:10:00
168+
82 5 514701 517609 2277.31150 2259.124026 -90.937372 -0.007986 2023-12-29 23:24:00 2023-12-31 23:52:00 None 2 days 00:28:00
136169
```
137170

138171
## Bugs

docs/changelog.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ <h3>Navigation</h3>
510510
<a href="https://docs.lucit.tech">Index of all LUCIT Software Documentation</a><br />
511511
&copy; <a href="/license.html">Copyright</a> 2024-2024, LUCIT Systems and Development. All Rights Reserved..
512512
See <a href="/license.html">License</a> for more information.<br />
513-
Last updated on Jun 07 2024 at 10:42 (CET).
513+
Last updated on Jun 07 2024 at 10:51 (CET).
514514
<a href="https://github.com/LUCIT-Systems-and-Development/lucit-backtesting/issues/new/choose">Found a bug</a>?
515515
<br />
516516
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.2.6.

docs/code_of_conduct.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ <h3>Navigation</h3>
399399
<a href="https://docs.lucit.tech">Index of all LUCIT Software Documentation</a><br />
400400
&copy; <a href="/license.html">Copyright</a> 2024-2024, LUCIT Systems and Development. All Rights Reserved..
401401
See <a href="/license.html">License</a> for more information.<br />
402-
Last updated on Jun 07 2024 at 10:42 (CET).
402+
Last updated on Jun 07 2024 at 10:51 (CET).
403403
<a href="https://github.com/LUCIT-Systems-and-Development/lucit-backtesting/issues/new/choose">Found a bug</a>?
404404
<br />
405405
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.2.6.

docs/contributing.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ <h3>Navigation</h3>
377377
<a href="https://docs.lucit.tech">Index of all LUCIT Software Documentation</a><br />
378378
&copy; <a href="/license.html">Copyright</a> 2024-2024, LUCIT Systems and Development. All Rights Reserved..
379379
See <a href="/license.html">License</a> for more information.<br />
380-
Last updated on Jun 07 2024 at 10:42 (CET).
380+
Last updated on Jun 07 2024 at 10:51 (CET).
381381
<a href="https://github.com/LUCIT-Systems-and-Development/lucit-backtesting/issues/new/choose">Found a bug</a>?
382382
<br />
383383
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.2.6.

docs/genindex.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ <h3>Navigation</h3>
569569
<a href="https://docs.lucit.tech">Index of all LUCIT Software Documentation</a><br />
570570
&copy; <a href="/license.html">Copyright</a> 2024-2024, LUCIT Systems and Development. All Rights Reserved..
571571
See <a href="/license.html">License</a> for more information.<br />
572-
Last updated on Jun 07 2024 at 10:42 (CET).
572+
Last updated on Jun 07 2024 at 10:51 (CET).
573573
<a href="https://github.com/LUCIT-Systems-and-Development/lucit-backtesting/issues/new/choose">Found a bug</a>?
574574
<br />
575575
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.2.6.

docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ <h3>Navigation</h3>
417417
<a href="https://docs.lucit.tech">Index of all LUCIT Software Documentation</a><br />
418418
&copy; <a href="/license.html">Copyright</a> 2024-2024, LUCIT Systems and Development. All Rights Reserved..
419419
See <a href="/license.html">License</a> for more information.<br />
420-
Last updated on Jun 07 2024 at 10:42 (CET).
420+
Last updated on Jun 07 2024 at 10:51 (CET).
421421
<a href="https://github.com/LUCIT-Systems-and-Development/lucit-backtesting/issues/new/choose">Found a bug</a>?
422422
<br />
423423
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.2.6.

docs/license.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,7 @@ <h3>Navigation</h3>
967967
<a href="https://docs.lucit.tech">Index of all LUCIT Software Documentation</a><br />
968968
&copy; <a href="/license.html">Copyright</a> 2024-2024, LUCIT Systems and Development. All Rights Reserved..
969969
See <a href="/license.html">License</a> for more information.<br />
970-
Last updated on Jun 07 2024 at 10:42 (CET).
970+
Last updated on Jun 07 2024 at 10:51 (CET).
971971
<a href="https://github.com/LUCIT-Systems-and-Development/lucit-backtesting/issues/new/choose">Found a bug</a>?
972972
<br />
973973
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.2.6.

docs/py-modindex.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ <h3>Navigation</h3>
277277
<a href="https://docs.lucit.tech">Index of all LUCIT Software Documentation</a><br />
278278
&copy; <a href="/license.html">Copyright</a> 2024-2024, LUCIT Systems and Development. All Rights Reserved..
279279
See <a href="/license.html">License</a> for more information.<br />
280-
Last updated on Jun 07 2024 at 10:42 (CET).
280+
Last updated on Jun 07 2024 at 10:51 (CET).
281281
<a href="https://github.com/LUCIT-Systems-and-Development/lucit-backtesting/issues/new/choose">Found a bug</a>?
282282
<br />
283283
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.2.6.

0 commit comments

Comments
 (0)