akquant-lwc 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- akquant_lwc/__init__.py +39 -0
- akquant_lwc/_app_js.py +965 -0
- akquant_lwc/_normalize.py +294 -0
- akquant_lwc/_patch.py +129 -0
- akquant_lwc/_sections.py +1378 -0
- akquant_lwc/_tables.py +121 -0
- akquant_lwc/_template.py +421 -0
- akquant_lwc/assets/lightweight-charts.standalone.production.js +7 -0
- akquant_lwc/report.py +294 -0
- akquant_lwc/server.py +201 -0
- akquant_lwc-0.1.0.dist-info/METADATA +147 -0
- akquant_lwc-0.1.0.dist-info/RECORD +14 -0
- akquant_lwc-0.1.0.dist-info/WHEEL +4 -0
- akquant_lwc-0.1.0.dist-info/licenses/LICENSE +21 -0
akquant_lwc/__init__.py
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"""akquant-lwc: TradingView Lightweight Charts reporting plugin for AKQuant.
|
|
2
|
+
|
|
3
|
+
A drop-in, plotly-free replacement of AKQuant's built-in HTML backtest
|
|
4
|
+
report, powered by TradingView Lightweight Charts (vendored, works offline).
|
|
5
|
+
|
|
6
|
+
Usage with AKQuant::
|
|
7
|
+
|
|
8
|
+
import akquant_lwc # patches BacktestResult on import
|
|
9
|
+
|
|
10
|
+
result = run_backtest(...)
|
|
11
|
+
result.report_lwc(market_data={"600000": df}, show=True)
|
|
12
|
+
result.serve_review(market_data={"600000": df}, port=8765)
|
|
13
|
+
|
|
14
|
+
The module-level functions accept any duck-typed result object (anything
|
|
15
|
+
exposing ``trades_df`` / ``equity_curve`` / ``metrics`` / ``trade_metrics``),
|
|
16
|
+
so the plugin also works without the patch or with akquant not installed::
|
|
17
|
+
|
|
18
|
+
from akquant_lwc import plot_report, serve_review
|
|
19
|
+
|
|
20
|
+
plot_report(result, market_data={"600000": df}, filename="report.html")
|
|
21
|
+
serve_review(result, market_data={"600000": df})
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
from ._patch import patch_result_methods
|
|
25
|
+
from .report import build_app_data, plot_report, render_html
|
|
26
|
+
from .server import serve_review
|
|
27
|
+
|
|
28
|
+
__version__ = "0.1.0"
|
|
29
|
+
|
|
30
|
+
__all__ = [
|
|
31
|
+
"build_app_data",
|
|
32
|
+
"patch_result_methods",
|
|
33
|
+
"plot_report",
|
|
34
|
+
"render_html",
|
|
35
|
+
"serve_review",
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
# Auto-patch BacktestResult on import (idempotent, skipped without akquant).
|
|
39
|
+
patch_result_methods()
|