fa-quant 1.2.1__tar.gz → 1.3.0__tar.gz
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.
- {fa_quant-1.2.1 → fa_quant-1.3.0}/.gitignore +1 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/CHANGELOG.md +61 -1
- fa_quant-1.3.0/PKG-INFO +283 -0
- fa_quant-1.3.0/README.md +224 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/pyproject.toml +6 -2
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/quant/__main__.py +15 -3
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/quant/data/cache.py +4 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/quant/mcp.py +1 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/quant/runner/config.py +15 -3
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/quant/validation/__init__.py +10 -2
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/quant/validation/gate.py +47 -5
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/quant/validation/walkforward.py +18 -9
- fa_quant-1.2.1/PKG-INFO +0 -236
- fa_quant-1.2.1/README.md +0 -177
- {fa_quant-1.2.1 → fa_quant-1.3.0}/LICENSE +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/agents/equity/daily_investment_system/factor_scoring.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/agents/equity/daily_investment_system/settlement_ledger.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/__init__.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/agents/__init__.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/agents/claude/__init__.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/agents/gpt/__init__.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/agents/grok/__init__.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/dl/__init__.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/dl/models/__init__.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/dl/models/baseline_model.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/dl/preprocessing/__init__.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/dl/preprocessing/data_windowing.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/harness/__init__.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/harness/__main__.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/harness/audit.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/harness/equity_policy.toml +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/harness/fingerprint.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/harness/gates.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/harness/handlers.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/harness/helpers.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/harness/kernels.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/harness/ledger.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/harness/lifecycle.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/harness/manifest.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/harness/market_calendar.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/harness/mcp.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/harness/policy.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/harness/runner.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/harness/schema.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/harness/scoring.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/harness/skills.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/quant/__init__.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/quant/backtest/__init__.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/quant/backtest/config.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/quant/backtest/costs.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/quant/backtest/engine.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/quant/backtest/metrics.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/quant/backtest/result.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/quant/data/__init__.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/quant/data/bars.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/quant/data/providers.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/quant/data/quality.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/quant/data/synthetic.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/quant/execution/__init__.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/quant/execution/alpaca.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/quant/execution/broker.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/quant/execution/ibkr.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/quant/execution/journal.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/quant/execution/paper.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/quant/execution/reconcile.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/quant/portfolio.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/quant/quant_policy.toml +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/quant/risk/__init__.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/quant/risk/killswitch.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/quant/risk/limits.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/quant/risk/orders.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/quant/risk/pretrade.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/quant/risk/state.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/quant/runner/__init__.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/quant/runner/promotion.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/quant/runner/report.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/quant/runner/session.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/quant/strategies/__init__.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/quant/strategies/base.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/quant/strategies/benchmarks.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/quant/strategies/momentum.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/quant/strategies/registry.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/quant/strategies/research.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/quant/strategies/trend.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/quant/validation/bootstrap.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/quant/validation/certificate.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/quant/validation/overfitting.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/quant/validation/stress.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/rl/__init__.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/rl/agent.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/rl/environment.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/rl/trainer.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/trading/__init__.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/trading/autotrain/__init__.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/trading/autotrain/training.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/trading/backtest.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/trading/config/__init__.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/trading/config/config.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/trading/marketdata/__init__.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/trading/marketdata/yahoodownloader.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/trading/model/__init__.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/trading/model/models.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/trading/preprocessing/__init__.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/trading/preprocessing/data.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/trading/preprocessing/preprocessors.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/trading/utils/__init__.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/trading/utils/gpu_config.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/trading/utils/main.py +0 -0
- {fa_quant-1.2.1 → fa_quant-1.3.0}/src/financial_agent/trading/utils/setup_gpu_for_notebooks.py +0 -0
|
@@ -5,6 +5,65 @@ and [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [1.3.0] - 2026-10-28
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- Research CLI commands honor `--provider yahoo` when `--csv-dir` is also set.
|
|
13
|
+
- Non-object cache metadata raises a data error instead of an uncaught attribute error.
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- A documentation site at <https://bichengwang.github.io/financial-agent/>, built
|
|
18
|
+
with MkDocs Material and deployed from `main` by the Pages workflow: on push,
|
|
19
|
+
and within 30 minutes of an auto-merge, whose `GITHUB_TOKEN` push starts no
|
|
20
|
+
workflows. It serves the README, `docs/` (quant guides, releasing, equity research
|
|
21
|
+
reports), the quant evidence reports and this changelog. Repository links that
|
|
22
|
+
aren't site pages open on GitHub. Pull requests that touch these files run a
|
|
23
|
+
strict build. Preview locally with
|
|
24
|
+
`uv run --only-group docs mkdocs serve`.
|
|
25
|
+
- Two agent skills for the quant platform, discoverable through `.agents/skills/`:
|
|
26
|
+
`quant-strategy-research` (backtest, validate and certify a strategy, read the
|
|
27
|
+
eight promotion checks, write dated evidence) and `quant-paper-operations`
|
|
28
|
+
(dry-run and scheduled paper sessions, status and live readiness, and the
|
|
29
|
+
kill/unkill incident runbook). Neither can enable live trading.
|
|
30
|
+
- Contributor and security docs: `CONTRIBUTING.md` (setup, checks, quant and
|
|
31
|
+
pull request rules), `SECURITY.md` (private vulnerability reporting, now enabled),
|
|
32
|
+
`CODE_OF_CONDUCT.md`, issue forms for bugs and features, and a pull request
|
|
33
|
+
template. The README shows CI, PyPI, Python, docs and license badges.
|
|
34
|
+
- `[promotion] disclosed_trials` lists every variant tried when the certified
|
|
35
|
+
grid is narrower, e.g. one frozen identity. DSR then deflates by all of them:
|
|
36
|
+
their count and the variance of their full-period Sharpes on the certified
|
|
37
|
+
data. The certificate records `n_trials` and `trial_sharpe_variance` in its
|
|
38
|
+
diagnostics; certificates without a disclosure are unchanged. The disclosure
|
|
39
|
+
must list each grid variant once. `evaluate_promotion` takes it as the
|
|
40
|
+
keyword `disclosed_trials`.
|
|
41
|
+
|
|
42
|
+
### Changed
|
|
43
|
+
|
|
44
|
+
- The `Documentation` project URL and the README link to the site.
|
|
45
|
+
- The Alpaca and IBKR example configs freeze the certified identity
|
|
46
|
+
(`target_vol=0.12, max_weight=0.25`): it is the configured strategy and the
|
|
47
|
+
only grid variant, with the four searched variants disclosed. A
|
|
48
|
+
re-certification can no longer switch parameters and restart paper evidence.
|
|
49
|
+
Pass the four-variant `--grid` to rerun the original search.
|
|
50
|
+
- The README opens with the current paper-to-live status, installs from PyPI,
|
|
51
|
+
compares the four-variant and frozen-identity gate results, lists the live
|
|
52
|
+
gate's conditions and documents the scheduler wrapper.
|
|
53
|
+
- Saved notebooks shrank from 10.9 MB to 3.1 MB without re-execution: training
|
|
54
|
+
logs keep their first and last 40 lines, very long printed lines are clipped,
|
|
55
|
+
and plots are 256-colour PNGs. Each cut is marked in the output.
|
|
56
|
+
- GitHub language statistics exclude `.ipynb` files (`linguist-documentation`),
|
|
57
|
+
so the repository reports as Python rather than Jupyter Notebook.
|
|
58
|
+
- The notebooks README lists each notebook and how to run it.
|
|
59
|
+
|
|
60
|
+
### Removed
|
|
61
|
+
|
|
62
|
+
- Six research notebooks: the three AI4Finance FinRL tutorial copies in
|
|
63
|
+
`archive/`, the upstream `Crypto_Binance_Historical_Data` tutorial, and
|
|
64
|
+
`multistock_variant_2` and `this_works_1_18`, which largely duplicate
|
|
65
|
+
`multistock_docker`. They remain in git history.
|
|
66
|
+
|
|
8
67
|
## [1.2.1] - 2026-10-20
|
|
9
68
|
|
|
10
69
|
### Added
|
|
@@ -140,7 +199,8 @@ and [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
140
199
|
PBO and degradation slope remain not applicable; multi-variant calculations
|
|
141
200
|
and every promotion threshold are unchanged.
|
|
142
201
|
|
|
143
|
-
[Unreleased]: https://github.com/BichengWang/financial-agent/compare/v1.
|
|
202
|
+
[Unreleased]: https://github.com/BichengWang/financial-agent/compare/v1.3.0...HEAD
|
|
203
|
+
[1.3.0]: https://github.com/BichengWang/financial-agent/compare/v1.2.1...v1.3.0
|
|
144
204
|
[1.2.1]: https://github.com/BichengWang/financial-agent/compare/v1.2.0...v1.2.1
|
|
145
205
|
[1.2.0]: https://github.com/BichengWang/financial-agent/compare/v1.1.1...v1.2.0
|
|
146
206
|
[1.1.1]: https://github.com/BichengWang/financial-agent/compare/v1.1.0...v1.1.1
|
fa_quant-1.3.0/PKG-INFO
ADDED
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: fa-quant
|
|
3
|
+
Version: 1.3.0
|
|
4
|
+
Import-Name: financial_agent
|
|
5
|
+
Summary: Risk-managed systematic ETF trading, statistical validation, and financial research
|
|
6
|
+
Project-URL: Homepage, https://github.com/BichengWang/financial-agent
|
|
7
|
+
Project-URL: Repository, https://github.com/BichengWang/financial-agent
|
|
8
|
+
Project-URL: Documentation, https://bichengwang.github.io/financial-agent/
|
|
9
|
+
Project-URL: Issues, https://github.com/BichengWang/financial-agent/issues
|
|
10
|
+
Project-URL: Changelog, https://github.com/BichengWang/financial-agent/blob/main/CHANGELOG.md
|
|
11
|
+
Author-email: "Bicheng (Kenneth)" <31808103+BichengWang@users.noreply.github.com>
|
|
12
|
+
License-Expression: MIT
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Keywords: backtesting,portfolio,reinforcement-learning,risk-management,systematic-trading
|
|
15
|
+
Classifier: Development Status :: 4 - Beta
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: Operating System :: POSIX
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Topic :: Office/Business :: Financial :: Investment
|
|
21
|
+
Requires-Python: >=3.12
|
|
22
|
+
Requires-Dist: gymnasium
|
|
23
|
+
Requires-Dist: numpy<2.0,>=1.24.0
|
|
24
|
+
Requires-Dist: pandas<3,>=2.0
|
|
25
|
+
Requires-Dist: requests<3,>=2.32
|
|
26
|
+
Requires-Dist: yfinance
|
|
27
|
+
Provides-Extra: all
|
|
28
|
+
Requires-Dist: beautifulsoup4; extra == 'all'
|
|
29
|
+
Requires-Dist: ipython; extra == 'all'
|
|
30
|
+
Requires-Dist: keras-nightly; extra == 'all'
|
|
31
|
+
Requires-Dist: matplotlib; extra == 'all'
|
|
32
|
+
Requires-Dist: notebook; extra == 'all'
|
|
33
|
+
Requires-Dist: pyfolio-reloaded; extra == 'all'
|
|
34
|
+
Requires-Dist: scikit-learn; extra == 'all'
|
|
35
|
+
Requires-Dist: seaborn; extra == 'all'
|
|
36
|
+
Requires-Dist: stable-baselines3; extra == 'all'
|
|
37
|
+
Requires-Dist: stockstats; extra == 'all'
|
|
38
|
+
Requires-Dist: tensorflow; extra == 'all'
|
|
39
|
+
Provides-Extra: dev
|
|
40
|
+
Requires-Dist: black>=22.0.0; extra == 'dev'
|
|
41
|
+
Requires-Dist: flake8>=6.0.0; extra == 'dev'
|
|
42
|
+
Requires-Dist: mypy>=1.0.0; extra == 'dev'
|
|
43
|
+
Requires-Dist: pytest-cov; extra == 'dev'
|
|
44
|
+
Requires-Dist: pytest-custom-exit-code; extra == 'dev'
|
|
45
|
+
Requires-Dist: pytest>=7.0.0; extra == 'dev'
|
|
46
|
+
Provides-Extra: dl
|
|
47
|
+
Requires-Dist: ipython; extra == 'dl'
|
|
48
|
+
Requires-Dist: keras-nightly; extra == 'dl'
|
|
49
|
+
Requires-Dist: matplotlib; extra == 'dl'
|
|
50
|
+
Requires-Dist: scikit-learn; extra == 'dl'
|
|
51
|
+
Requires-Dist: seaborn; extra == 'dl'
|
|
52
|
+
Requires-Dist: tensorflow; extra == 'dl'
|
|
53
|
+
Provides-Extra: notebooks
|
|
54
|
+
Requires-Dist: ipython; extra == 'notebooks'
|
|
55
|
+
Requires-Dist: matplotlib; extra == 'notebooks'
|
|
56
|
+
Requires-Dist: notebook; extra == 'notebooks'
|
|
57
|
+
Requires-Dist: seaborn; extra == 'notebooks'
|
|
58
|
+
Provides-Extra: research
|
|
59
|
+
Requires-Dist: openpyxl<4,>=3.1; extra == 'research'
|
|
60
|
+
Provides-Extra: rl
|
|
61
|
+
Requires-Dist: beautifulsoup4; extra == 'rl'
|
|
62
|
+
Requires-Dist: matplotlib; extra == 'rl'
|
|
63
|
+
Requires-Dist: pyfolio-reloaded; extra == 'rl'
|
|
64
|
+
Requires-Dist: scikit-learn; extra == 'rl'
|
|
65
|
+
Requires-Dist: stable-baselines3; extra == 'rl'
|
|
66
|
+
Requires-Dist: stockstats; extra == 'rl'
|
|
67
|
+
Requires-Dist: tensorflow; extra == 'rl'
|
|
68
|
+
Description-Content-Type: text/markdown
|
|
69
|
+
|
|
70
|
+
# financial-agent
|
|
71
|
+
|
|
72
|
+
[](https://github.com/BichengWang/financial-agent/actions/workflows/python-quality.yml)
|
|
73
|
+
[](https://pypi.org/project/fa-quant/)
|
|
74
|
+
[](https://www.python.org/)
|
|
75
|
+
[](https://bichengwang.github.io/financial-agent/)
|
|
76
|
+
[](https://github.com/BichengWang/financial-agent/blob/v1.3.0/LICENSE)
|
|
77
|
+
|
|
78
|
+
A Python platform for systematic ETF trading that has to earn its way to capital:
|
|
79
|
+
cost-aware backtests, a statistical promotion gate, journaled paper trading and
|
|
80
|
+
explicitly gated Alpaca and IBKR execution. It also holds an equity-research
|
|
81
|
+
harness and separate RL/deep-learning research stacks. The platform is **beta**:
|
|
82
|
+
live performance is unproven, and neither a historical pass nor paper results
|
|
83
|
+
guarantee profit.
|
|
84
|
+
|
|
85
|
+
**Docs:** <https://bichengwang.github.io/financial-agent/> has the quant guides,
|
|
86
|
+
evidence reports, equity research and changelog.
|
|
87
|
+
|
|
88
|
+
## Status (2026-10-28)
|
|
89
|
+
|
|
90
|
+
| Stage | State |
|
|
91
|
+
|---|---|
|
|
92
|
+
| Research gate | `trend_vol_target` passes all eight checks with its frozen identity `target_vol=0.12, max_weight=0.25` (data through 2026-10-27, DSR 0.994) |
|
|
93
|
+
| Paper evidence | Alpaca paper sessions scheduled weekdays before the open: first session 2026-10-29, first orders 2026-11-02; 0 of 20 clean sessions |
|
|
94
|
+
| Live | Not authorized. Earliest decision 2026-11-25, if no paper session halts |
|
|
95
|
+
|
|
96
|
+
The [paper-to-live plan](https://github.com/BichengWang/financial-agent/blob/v1.3.0/plan/2026-10-18-quant-paper-to-live.md) tracks the
|
|
97
|
+
remaining steps and decisions.
|
|
98
|
+
|
|
99
|
+
## Quickstart (offline, five minutes)
|
|
100
|
+
|
|
101
|
+
```sh
|
|
102
|
+
pip install fa-quant
|
|
103
|
+
fa-quant demo --sessions 25 --state-dir /tmp/fa-quant-demo
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Or from a clone, with [uv](https://docs.astral.sh/uv/getting-started/installation/)
|
|
107
|
+
(Python 3.12 is pinned by `.python-version`):
|
|
108
|
+
|
|
109
|
+
```sh
|
|
110
|
+
uv sync --locked
|
|
111
|
+
uv run fa-quant demo
|
|
112
|
+
uv run fa-quant --help
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
The demo runs backtest, validation, certification, local paper sessions and
|
|
116
|
+
status on seeded synthetic data with a planted trend, without network access.
|
|
117
|
+
Its numbers show the software working, not market performance.
|
|
118
|
+
|
|
119
|
+
The PyPI distribution is `fa-quant`; it installs the `fa-quant` command and the
|
|
120
|
+
`financial_agent` import package. The unrelated `financial-agent` PyPI project is
|
|
121
|
+
not this one. Python 3.12 is tested; on 3.13+ the NumPy `<2` pin builds NumPy
|
|
122
|
+
from source. Examples, docs and evidence live in this repository. Optional `rl`,
|
|
123
|
+
`dl`, `notebooks` and `research` extras add the heavier research stacks;
|
|
124
|
+
`uv sync --locked --all-extras` installs everything.
|
|
125
|
+
|
|
126
|
+
## Real-data research
|
|
127
|
+
|
|
128
|
+
The example universe is SPY, QQQ, IWM, EFA, EEM, TLT, IEF, LQD, GLD, DBC and VNQ
|
|
129
|
+
with weekly next-open fills, whole shares, a 2% cash buffer and 2 bps half-spread
|
|
130
|
+
plus 3 bps slippage per side. Downloads are cached under gitignored `var/`. Use
|
|
131
|
+
the latest completed session as the inclusive end:
|
|
132
|
+
|
|
133
|
+
```sh
|
|
134
|
+
uv run fa-quant backtest --config examples/quant/paper.toml --end 2026-10-27 --json
|
|
135
|
+
uv run fa-quant validate --config examples/quant/paper.toml --end 2026-10-27 --json
|
|
136
|
+
uv run fa-quant certify --config examples/quant/paper.toml --end 2026-10-27 \
|
|
137
|
+
--output var/quant-paper/certificate.json
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
`validate` and `certify` exit 2 when any check fails; a failed certificate can be
|
|
141
|
+
saved but never authorizes trading. With `--config`, all settings come from the
|
|
142
|
+
TOML. See [strategy research](https://github.com/BichengWang/financial-agent/blob/v1.3.0/docs/quant/strategy-research.md) for grids,
|
|
143
|
+
disclosed trials and how to read each statistic.
|
|
144
|
+
|
|
145
|
+
### Results
|
|
146
|
+
|
|
147
|
+
The [committed evidence](https://github.com/BichengWang/financial-agent/blob/v1.3.0/reports/quant/2026-10-default-strategy-evidence.md)
|
|
148
|
+
covers 2006-02-06 through 2026-10-12. Full-period backtests at default
|
|
149
|
+
parameters:
|
|
150
|
+
|
|
151
|
+
| Strategy | CAGR | Net Sharpe | Max drawdown | Turnover/year |
|
|
152
|
+
|---|---:|---:|---:|---:|
|
|
153
|
+
| Trend vol target | 5.625% | 0.740 | 16.533% | 14.375× |
|
|
154
|
+
| Dual momentum | 11.100% | 0.754 | 26.397% | 10.550× |
|
|
155
|
+
| SPY buy-and-hold | 11.122% | 0.652 | 54.299% | 0.048× |
|
|
156
|
+
| 60/40 SPY/IEF | 8.212% | 0.785 | 31.979% | 0.206× |
|
|
157
|
+
|
|
158
|
+
The trend strategy's promotion gate (walk-forward out-of-sample, 3,528 sessions):
|
|
159
|
+
|
|
160
|
+
| Protocol | Data | OOS Sharpe | DSR | OOS max drawdown | PBO | Verdict |
|
|
161
|
+
|---|---|---:|---:|---:|---:|---|
|
|
162
|
+
| Four-variant search | 2006-02-06 to 2026-10-12 | 0.729 | 0.996 | 17.1% | 0.650 | Pass; selects 0.12 / 0.25 |
|
|
163
|
+
| Frozen 0.12 / 0.25, four trials disclosed | 2006-03-01 to 2026-10-27 | 0.704 | 0.994 | 13.7% | n/a | Pass |
|
|
164
|
+
|
|
165
|
+
PBO 0.650 means picking the in-sample winner added no reliable value, and the
|
|
166
|
+
choice switched 6 times in 13 folds. So the selected identity is now frozen:
|
|
167
|
+
re-certification can no longer switch parameters and restart the paper clock.
|
|
168
|
+
DSR still deflates by all four variants tried. The frozen row's walk-forward
|
|
169
|
+
returns aren't out-of-sample for the choice of identity, which used the same
|
|
170
|
+
history; the freeze stabilizes the identity, it doesn't strengthen the
|
|
171
|
+
statistical case.
|
|
172
|
+
|
|
173
|
+
Dual momentum and 60/40 also pass all eight checks as single pre-registered
|
|
174
|
+
variants; SPY fails the 25% OOS drawdown limit. Statistical passes don't override
|
|
175
|
+
execution limits: dual momentum's three 33.3% slots and the concentrated
|
|
176
|
+
benchmarks exceed the 30% per-name cap. The equity `research_forecast` signal
|
|
177
|
+
[fails its real-ledger gate](https://github.com/BichengWang/financial-agent/blob/v1.3.0/reports/quant/research-forecast-validation.md) for
|
|
178
|
+
lack of history. No parameter or threshold was tuned to pass.
|
|
179
|
+
|
|
180
|
+
## Paper trading
|
|
181
|
+
|
|
182
|
+
Put Alpaca **paper** keys in the environment as `APCA_API_KEY_ID` and
|
|
183
|
+
`APCA_API_SECRET_KEY`, never in TOML, git or shell history. Preview, run and
|
|
184
|
+
inspect before the opening auction (orders must go out before 09:25 New York
|
|
185
|
+
time):
|
|
186
|
+
|
|
187
|
+
```sh
|
|
188
|
+
uv run fa-quant run --config examples/quant/paper.toml --dry-run
|
|
189
|
+
uv run fa-quant run --config examples/quant/paper.toml
|
|
190
|
+
uv run fa-quant status --config examples/quant/paper.toml
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
For unattended runs, schedule
|
|
194
|
+
[`deploy/quant/run-session.py`](https://github.com/BichengWang/financial-agent/blob/v1.3.0/deploy/quant/run-session.py) with the launchd,
|
|
195
|
+
cron or systemd templates beside it. It loads keys from a `chmod 600` env file,
|
|
196
|
+
passes the exit code through and posts a sanitized alert to
|
|
197
|
+
`FA_QUANT_ALERT_WEBHOOK` when a session halts. `status` reports live readiness:
|
|
198
|
+
clean sessions, halts, slippage against the allowance and certificate age. See
|
|
199
|
+
the [daily schedule](https://github.com/BichengWang/financial-agent/blob/v1.3.0/docs/quant/operations.md#daily-schedule).
|
|
200
|
+
|
|
201
|
+
IBKR uses the locally running Client Portal Gateway with a daily browser login.
|
|
202
|
+
Copy [ibkr-paper.toml](https://github.com/BichengWang/financial-agent/blob/v1.3.0/examples/quant/ibkr-paper.toml), set your USD paper account
|
|
203
|
+
ID and gateway port, and follow the
|
|
204
|
+
[gateway setup](https://github.com/BichengWang/financial-agent/blob/v1.3.0/docs/quant/operations.md#ibkr-client-portal-gateway). TLS
|
|
205
|
+
verification can be disabled only on loopback, and order questions halt unless
|
|
206
|
+
their message IDs are explicitly allowed.
|
|
207
|
+
|
|
208
|
+
## Live gate
|
|
209
|
+
|
|
210
|
+
Every live session re-checks all of these:
|
|
211
|
+
|
|
212
|
+
- `mode = "live"` in a separate TOML and `FA_QUANT_ALLOW_LIVE=1` in the
|
|
213
|
+
environment.
|
|
214
|
+
- A passing certificate at most 90 days old for exactly the configured strategy
|
|
215
|
+
and parameters.
|
|
216
|
+
- At least 20 distinct clean paper sessions with the same broker and identity,
|
|
217
|
+
with fills, no halts or reconciliation breaks in that window, and mean
|
|
218
|
+
slippage within twice the modeled cost.
|
|
219
|
+
|
|
220
|
+
Configs can tighten runtime risk limits, never loosen them. The MCP server
|
|
221
|
+
exposes research and paper previews only and can't place orders. The kill switch
|
|
222
|
+
persists and blocks new submissions, but doesn't cancel orders or liquidate.
|
|
223
|
+
Read [safety and go-live steps](https://github.com/BichengWang/financial-agent/blob/v1.3.0/docs/quant/safety.md) before changing mode and
|
|
224
|
+
[operations](https://github.com/BichengWang/financial-agent/blob/v1.3.0/docs/quant/operations.md) for kill/unkill and incidents.
|
|
225
|
+
|
|
226
|
+
## Equity research and RL
|
|
227
|
+
|
|
228
|
+
The [native ticker workflow](https://github.com/BichengWang/financial-agent/blob/v1.3.0/docs/research/README.md) combines sourced evidence,
|
|
229
|
+
Decimal arithmetic, optional earnings/DCF/comps models and structural audits;
|
|
230
|
+
[retained research](https://github.com/BichengWang/financial-agent/blob/v1.3.0/docs/research/index.md) remains provisional. The
|
|
231
|
+
[daily equity workflow](https://github.com/BichengWang/financial-agent/blob/v1.3.0/agents/equity/daily_investment_system/main.md) produces
|
|
232
|
+
dated source/prediction packages. The harness provides deterministic report
|
|
233
|
+
checks and ledger audits:
|
|
234
|
+
|
|
235
|
+
```sh
|
|
236
|
+
uv run python -m financial_agent.harness --help
|
|
237
|
+
uv run python -m financial_agent.harness audit --output-dir agents/equity/output
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
Generic RL supplies tabular Q-learning, GridWorld, Gymnasium wrappers and bounded
|
|
241
|
+
training loops; [examples](https://github.com/BichengWang/financial-agent/blob/v1.3.0/example/rl/) show the APIs and
|
|
242
|
+
[notebooks](https://github.com/BichengWang/financial-agent/blob/v1.3.0/notebooks/README.md) keep historical outputs. The FinRL-derived
|
|
243
|
+
`trading/` and TensorFlow `dl/` stacks are experimental: nothing reaches capital
|
|
244
|
+
unless it implements `Strategy` and passes the same gates. The historical
|
|
245
|
+
autotrain entrypoint is not turnkey.
|
|
246
|
+
|
|
247
|
+
## Repository map
|
|
248
|
+
|
|
249
|
+
| Path | Purpose |
|
|
250
|
+
|---|---|
|
|
251
|
+
| [src/financial_agent/quant](https://github.com/BichengWang/financial-agent/blob/v1.3.0/src/financial_agent/quant/) | Data, strategies, backtest, validation, risk, execution, runner and CLI/MCP |
|
|
252
|
+
| [docs/quant](https://github.com/BichengWang/financial-agent/blob/v1.3.0/docs/quant/) | [Architecture](https://github.com/BichengWang/financial-agent/blob/v1.3.0/docs/quant/architecture.md), safety, operations, strategy guide |
|
|
253
|
+
| [examples/quant](https://github.com/BichengWang/financial-agent/blob/v1.3.0/examples/quant/) / [deploy/quant](https://github.com/BichengWang/financial-agent/blob/v1.3.0/deploy/quant/) | Paper configs, scheduler wrapper and launchd/cron/systemd templates |
|
|
254
|
+
| [reports/quant](https://github.com/BichengWang/financial-agent/blob/v1.3.0/reports/quant/) | Dated strategy and research-forecast evidence |
|
|
255
|
+
| [tests/quant](https://github.com/BichengWang/financial-agent/blob/v1.3.0/tests/quant/) | Deterministic offline regression tests |
|
|
256
|
+
| [plan](https://github.com/BichengWang/financial-agent/blob/v1.3.0/plan/) | Dated design plans and the paper-to-live roadmap |
|
|
257
|
+
| [src/financial_agent/harness](https://github.com/BichengWang/financial-agent/blob/v1.3.0/src/financial_agent/harness/) | Equity schemas, gates, kernels and policy |
|
|
258
|
+
| [agents/equity](https://github.com/BichengWang/financial-agent/blob/v1.3.0/agents/equity/) / [skills](https://github.com/BichengWang/financial-agent/blob/v1.3.0/skills/) | Daily/native equity workflows and agent skills, including quant research and paper operations |
|
|
259
|
+
| [src/financial_agent/rl](https://github.com/BichengWang/financial-agent/blob/v1.3.0/src/financial_agent/rl/) / [example/rl](https://github.com/BichengWang/financial-agent/blob/v1.3.0/example/rl/) | Generic RL APIs and examples |
|
|
260
|
+
| [src/financial_agent/trading](https://github.com/BichengWang/financial-agent/blob/v1.3.0/src/financial_agent/trading/) / [src/financial_agent/dl](https://github.com/BichengWang/financial-agent/blob/v1.3.0/src/financial_agent/dl/) | Experimental financial RL and prediction research |
|
|
261
|
+
| [notebooks](https://github.com/BichengWang/financial-agent/blob/v1.3.0/notebooks/) | Saved research outputs; avoid incidental reruns |
|
|
262
|
+
|
|
263
|
+
## Limitations
|
|
264
|
+
|
|
265
|
+
- Yahoo's adjusted OHLCV is revised retrospectively and isn't raw auction data;
|
|
266
|
+
paper slippage is measured against those adjusted opens.
|
|
267
|
+
- The fixed ETF universe carries selection bias. Simulations omit taxes, cash
|
|
268
|
+
interest, capacity, market impact and exact corporate-action accounting.
|
|
269
|
+
- Statistics describe this historical sample, not future profitability.
|
|
270
|
+
- The scheduled runner doesn't monitor intraday loss or guarantee fills;
|
|
271
|
+
reference-price limits don't remove gap risk.
|
|
272
|
+
- State and journal hashes are integrity checks, not signatures. The runner
|
|
273
|
+
targets macOS and Linux.
|
|
274
|
+
|
|
275
|
+
## Contributing and security
|
|
276
|
+
|
|
277
|
+
See [CONTRIBUTING.md](https://github.com/BichengWang/financial-agent/blob/v1.3.0/CONTRIBUTING.md) for setup, checks and pull request rules,
|
|
278
|
+
and the [code of conduct](https://github.com/BichengWang/financial-agent/blob/v1.3.0/CODE_OF_CONDUCT.md). Report vulnerabilities privately as
|
|
279
|
+
described in [SECURITY.md](https://github.com/BichengWang/financial-agent/blob/v1.3.0/SECURITY.md).
|
|
280
|
+
|
|
281
|
+
## License
|
|
282
|
+
|
|
283
|
+
[MIT](https://github.com/BichengWang/financial-agent/blob/v1.3.0/LICENSE). Software is provided as is, without warranty.
|
fa_quant-1.3.0/README.md
ADDED
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
# financial-agent
|
|
2
|
+
|
|
3
|
+
[](https://github.com/BichengWang/financial-agent/actions/workflows/python-quality.yml)
|
|
4
|
+
[](https://pypi.org/project/fa-quant/)
|
|
5
|
+
[](https://www.python.org/)
|
|
6
|
+
[](https://bichengwang.github.io/financial-agent/)
|
|
7
|
+
[](LICENSE)
|
|
8
|
+
|
|
9
|
+
A Python platform for systematic ETF trading that has to earn its way to capital:
|
|
10
|
+
cost-aware backtests, a statistical promotion gate, journaled paper trading and
|
|
11
|
+
explicitly gated Alpaca and IBKR execution. It also holds an equity-research
|
|
12
|
+
harness and separate RL/deep-learning research stacks. The platform is **beta**:
|
|
13
|
+
live performance is unproven, and neither a historical pass nor paper results
|
|
14
|
+
guarantee profit.
|
|
15
|
+
|
|
16
|
+
**Docs:** <https://bichengwang.github.io/financial-agent/> has the quant guides,
|
|
17
|
+
evidence reports, equity research and changelog.
|
|
18
|
+
|
|
19
|
+
```mermaid
|
|
20
|
+
flowchart LR
|
|
21
|
+
R[Research: data + Strategy] --> B[Backtest: next-bar fills + costs]
|
|
22
|
+
B --> V[Validate + certify: OOS, DSR, CSCV, bootstrap, stress]
|
|
23
|
+
V --> P[Paper: journal + reconciliation]
|
|
24
|
+
P --> L[Live: fresh certificate + paper evidence + human opt-in]
|
|
25
|
+
K[Risk limits + persistent kill switch] --- P
|
|
26
|
+
K --- L
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Status (2026-10-28)
|
|
30
|
+
|
|
31
|
+
| Stage | State |
|
|
32
|
+
|---|---|
|
|
33
|
+
| Research gate | `trend_vol_target` passes all eight checks with its frozen identity `target_vol=0.12, max_weight=0.25` (data through 2026-10-27, DSR 0.994) |
|
|
34
|
+
| Paper evidence | Alpaca paper sessions scheduled weekdays before the open: first session 2026-10-29, first orders 2026-11-02; 0 of 20 clean sessions |
|
|
35
|
+
| Live | Not authorized. Earliest decision 2026-11-25, if no paper session halts |
|
|
36
|
+
|
|
37
|
+
The [paper-to-live plan](plan/2026-10-18-quant-paper-to-live.md) tracks the
|
|
38
|
+
remaining steps and decisions.
|
|
39
|
+
|
|
40
|
+
## Quickstart (offline, five minutes)
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
pip install fa-quant
|
|
44
|
+
fa-quant demo --sessions 25 --state-dir /tmp/fa-quant-demo
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Or from a clone, with [uv](https://docs.astral.sh/uv/getting-started/installation/)
|
|
48
|
+
(Python 3.12 is pinned by `.python-version`):
|
|
49
|
+
|
|
50
|
+
```sh
|
|
51
|
+
uv sync --locked
|
|
52
|
+
uv run fa-quant demo
|
|
53
|
+
uv run fa-quant --help
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
The demo runs backtest, validation, certification, local paper sessions and
|
|
57
|
+
status on seeded synthetic data with a planted trend, without network access.
|
|
58
|
+
Its numbers show the software working, not market performance.
|
|
59
|
+
|
|
60
|
+
The PyPI distribution is `fa-quant`; it installs the `fa-quant` command and the
|
|
61
|
+
`financial_agent` import package. The unrelated `financial-agent` PyPI project is
|
|
62
|
+
not this one. Python 3.12 is tested; on 3.13+ the NumPy `<2` pin builds NumPy
|
|
63
|
+
from source. Examples, docs and evidence live in this repository. Optional `rl`,
|
|
64
|
+
`dl`, `notebooks` and `research` extras add the heavier research stacks;
|
|
65
|
+
`uv sync --locked --all-extras` installs everything.
|
|
66
|
+
|
|
67
|
+
## Real-data research
|
|
68
|
+
|
|
69
|
+
The example universe is SPY, QQQ, IWM, EFA, EEM, TLT, IEF, LQD, GLD, DBC and VNQ
|
|
70
|
+
with weekly next-open fills, whole shares, a 2% cash buffer and 2 bps half-spread
|
|
71
|
+
plus 3 bps slippage per side. Downloads are cached under gitignored `var/`. Use
|
|
72
|
+
the latest completed session as the inclusive end:
|
|
73
|
+
|
|
74
|
+
```sh
|
|
75
|
+
uv run fa-quant backtest --config examples/quant/paper.toml --end 2026-10-27 --json
|
|
76
|
+
uv run fa-quant validate --config examples/quant/paper.toml --end 2026-10-27 --json
|
|
77
|
+
uv run fa-quant certify --config examples/quant/paper.toml --end 2026-10-27 \
|
|
78
|
+
--output var/quant-paper/certificate.json
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
`validate` and `certify` exit 2 when any check fails; a failed certificate can be
|
|
82
|
+
saved but never authorizes trading. With `--config`, all settings come from the
|
|
83
|
+
TOML. See [strategy research](docs/quant/strategy-research.md) for grids,
|
|
84
|
+
disclosed trials and how to read each statistic.
|
|
85
|
+
|
|
86
|
+
### Results
|
|
87
|
+
|
|
88
|
+
The [committed evidence](reports/quant/2026-10-default-strategy-evidence.md)
|
|
89
|
+
covers 2006-02-06 through 2026-10-12. Full-period backtests at default
|
|
90
|
+
parameters:
|
|
91
|
+
|
|
92
|
+
| Strategy | CAGR | Net Sharpe | Max drawdown | Turnover/year |
|
|
93
|
+
|---|---:|---:|---:|---:|
|
|
94
|
+
| Trend vol target | 5.625% | 0.740 | 16.533% | 14.375× |
|
|
95
|
+
| Dual momentum | 11.100% | 0.754 | 26.397% | 10.550× |
|
|
96
|
+
| SPY buy-and-hold | 11.122% | 0.652 | 54.299% | 0.048× |
|
|
97
|
+
| 60/40 SPY/IEF | 8.212% | 0.785 | 31.979% | 0.206× |
|
|
98
|
+
|
|
99
|
+
The trend strategy's promotion gate (walk-forward out-of-sample, 3,528 sessions):
|
|
100
|
+
|
|
101
|
+
| Protocol | Data | OOS Sharpe | DSR | OOS max drawdown | PBO | Verdict |
|
|
102
|
+
|---|---|---:|---:|---:|---:|---|
|
|
103
|
+
| Four-variant search | 2006-02-06 to 2026-10-12 | 0.729 | 0.996 | 17.1% | 0.650 | Pass; selects 0.12 / 0.25 |
|
|
104
|
+
| Frozen 0.12 / 0.25, four trials disclosed | 2006-03-01 to 2026-10-27 | 0.704 | 0.994 | 13.7% | n/a | Pass |
|
|
105
|
+
|
|
106
|
+
PBO 0.650 means picking the in-sample winner added no reliable value, and the
|
|
107
|
+
choice switched 6 times in 13 folds. So the selected identity is now frozen:
|
|
108
|
+
re-certification can no longer switch parameters and restart the paper clock.
|
|
109
|
+
DSR still deflates by all four variants tried. The frozen row's walk-forward
|
|
110
|
+
returns aren't out-of-sample for the choice of identity, which used the same
|
|
111
|
+
history; the freeze stabilizes the identity, it doesn't strengthen the
|
|
112
|
+
statistical case.
|
|
113
|
+
|
|
114
|
+
Dual momentum and 60/40 also pass all eight checks as single pre-registered
|
|
115
|
+
variants; SPY fails the 25% OOS drawdown limit. Statistical passes don't override
|
|
116
|
+
execution limits: dual momentum's three 33.3% slots and the concentrated
|
|
117
|
+
benchmarks exceed the 30% per-name cap. The equity `research_forecast` signal
|
|
118
|
+
[fails its real-ledger gate](reports/quant/research-forecast-validation.md) for
|
|
119
|
+
lack of history. No parameter or threshold was tuned to pass.
|
|
120
|
+
|
|
121
|
+
## Paper trading
|
|
122
|
+
|
|
123
|
+
Put Alpaca **paper** keys in the environment as `APCA_API_KEY_ID` and
|
|
124
|
+
`APCA_API_SECRET_KEY`, never in TOML, git or shell history. Preview, run and
|
|
125
|
+
inspect before the opening auction (orders must go out before 09:25 New York
|
|
126
|
+
time):
|
|
127
|
+
|
|
128
|
+
```sh
|
|
129
|
+
uv run fa-quant run --config examples/quant/paper.toml --dry-run
|
|
130
|
+
uv run fa-quant run --config examples/quant/paper.toml
|
|
131
|
+
uv run fa-quant status --config examples/quant/paper.toml
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
For unattended runs, schedule
|
|
135
|
+
[`deploy/quant/run-session.py`](deploy/quant/run-session.py) with the launchd,
|
|
136
|
+
cron or systemd templates beside it. It loads keys from a `chmod 600` env file,
|
|
137
|
+
passes the exit code through and posts a sanitized alert to
|
|
138
|
+
`FA_QUANT_ALERT_WEBHOOK` when a session halts. `status` reports live readiness:
|
|
139
|
+
clean sessions, halts, slippage against the allowance and certificate age. See
|
|
140
|
+
the [daily schedule](docs/quant/operations.md#daily-schedule).
|
|
141
|
+
|
|
142
|
+
IBKR uses the locally running Client Portal Gateway with a daily browser login.
|
|
143
|
+
Copy [ibkr-paper.toml](examples/quant/ibkr-paper.toml), set your USD paper account
|
|
144
|
+
ID and gateway port, and follow the
|
|
145
|
+
[gateway setup](docs/quant/operations.md#ibkr-client-portal-gateway). TLS
|
|
146
|
+
verification can be disabled only on loopback, and order questions halt unless
|
|
147
|
+
their message IDs are explicitly allowed.
|
|
148
|
+
|
|
149
|
+
## Live gate
|
|
150
|
+
|
|
151
|
+
Every live session re-checks all of these:
|
|
152
|
+
|
|
153
|
+
- `mode = "live"` in a separate TOML and `FA_QUANT_ALLOW_LIVE=1` in the
|
|
154
|
+
environment.
|
|
155
|
+
- A passing certificate at most 90 days old for exactly the configured strategy
|
|
156
|
+
and parameters.
|
|
157
|
+
- At least 20 distinct clean paper sessions with the same broker and identity,
|
|
158
|
+
with fills, no halts or reconciliation breaks in that window, and mean
|
|
159
|
+
slippage within twice the modeled cost.
|
|
160
|
+
|
|
161
|
+
Configs can tighten runtime risk limits, never loosen them. The MCP server
|
|
162
|
+
exposes research and paper previews only and can't place orders. The kill switch
|
|
163
|
+
persists and blocks new submissions, but doesn't cancel orders or liquidate.
|
|
164
|
+
Read [safety and go-live steps](docs/quant/safety.md) before changing mode and
|
|
165
|
+
[operations](docs/quant/operations.md) for kill/unkill and incidents.
|
|
166
|
+
|
|
167
|
+
## Equity research and RL
|
|
168
|
+
|
|
169
|
+
The [native ticker workflow](docs/research/README.md) combines sourced evidence,
|
|
170
|
+
Decimal arithmetic, optional earnings/DCF/comps models and structural audits;
|
|
171
|
+
[retained research](docs/research/index.md) remains provisional. The
|
|
172
|
+
[daily equity workflow](agents/equity/daily_investment_system/main.md) produces
|
|
173
|
+
dated source/prediction packages. The harness provides deterministic report
|
|
174
|
+
checks and ledger audits:
|
|
175
|
+
|
|
176
|
+
```sh
|
|
177
|
+
uv run python -m financial_agent.harness --help
|
|
178
|
+
uv run python -m financial_agent.harness audit --output-dir agents/equity/output
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Generic RL supplies tabular Q-learning, GridWorld, Gymnasium wrappers and bounded
|
|
182
|
+
training loops; [examples](example/rl/) show the APIs and
|
|
183
|
+
[notebooks](notebooks/README.md) keep historical outputs. The FinRL-derived
|
|
184
|
+
`trading/` and TensorFlow `dl/` stacks are experimental: nothing reaches capital
|
|
185
|
+
unless it implements `Strategy` and passes the same gates. The historical
|
|
186
|
+
autotrain entrypoint is not turnkey.
|
|
187
|
+
|
|
188
|
+
## Repository map
|
|
189
|
+
|
|
190
|
+
| Path | Purpose |
|
|
191
|
+
|---|---|
|
|
192
|
+
| [src/financial_agent/quant](src/financial_agent/quant/) | Data, strategies, backtest, validation, risk, execution, runner and CLI/MCP |
|
|
193
|
+
| [docs/quant](docs/quant/) | [Architecture](docs/quant/architecture.md), safety, operations, strategy guide |
|
|
194
|
+
| [examples/quant](examples/quant/) / [deploy/quant](deploy/quant/) | Paper configs, scheduler wrapper and launchd/cron/systemd templates |
|
|
195
|
+
| [reports/quant](reports/quant/) | Dated strategy and research-forecast evidence |
|
|
196
|
+
| [tests/quant](tests/quant/) | Deterministic offline regression tests |
|
|
197
|
+
| [plan](plan/) | Dated design plans and the paper-to-live roadmap |
|
|
198
|
+
| [src/financial_agent/harness](src/financial_agent/harness/) | Equity schemas, gates, kernels and policy |
|
|
199
|
+
| [agents/equity](agents/equity/) / [skills](skills/) | Daily/native equity workflows and agent skills, including quant research and paper operations |
|
|
200
|
+
| [src/financial_agent/rl](src/financial_agent/rl/) / [example/rl](example/rl/) | Generic RL APIs and examples |
|
|
201
|
+
| [src/financial_agent/trading](src/financial_agent/trading/) / [src/financial_agent/dl](src/financial_agent/dl/) | Experimental financial RL and prediction research |
|
|
202
|
+
| [notebooks](notebooks/) | Saved research outputs; avoid incidental reruns |
|
|
203
|
+
|
|
204
|
+
## Limitations
|
|
205
|
+
|
|
206
|
+
- Yahoo's adjusted OHLCV is revised retrospectively and isn't raw auction data;
|
|
207
|
+
paper slippage is measured against those adjusted opens.
|
|
208
|
+
- The fixed ETF universe carries selection bias. Simulations omit taxes, cash
|
|
209
|
+
interest, capacity, market impact and exact corporate-action accounting.
|
|
210
|
+
- Statistics describe this historical sample, not future profitability.
|
|
211
|
+
- The scheduled runner doesn't monitor intraday loss or guarantee fills;
|
|
212
|
+
reference-price limits don't remove gap risk.
|
|
213
|
+
- State and journal hashes are integrity checks, not signatures. The runner
|
|
214
|
+
targets macOS and Linux.
|
|
215
|
+
|
|
216
|
+
## Contributing and security
|
|
217
|
+
|
|
218
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for setup, checks and pull request rules,
|
|
219
|
+
and the [code of conduct](CODE_OF_CONDUCT.md). Report vulnerabilities privately as
|
|
220
|
+
described in [SECURITY.md](SECURITY.md).
|
|
221
|
+
|
|
222
|
+
## License
|
|
223
|
+
|
|
224
|
+
[MIT](LICENSE). Software is provided as is, without warranty.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "fa-quant"
|
|
3
|
-
version = "1.
|
|
3
|
+
version = "1.3.0"
|
|
4
4
|
description = "Risk-managed systematic ETF trading, statistical validation, and financial research"
|
|
5
5
|
authors = [{name = "Bicheng (Kenneth)", email = "31808103+BichengWang@users.noreply.github.com"}]
|
|
6
6
|
keywords = ["systematic-trading", "portfolio", "backtesting", "risk-management", "reinforcement-learning"]
|
|
@@ -30,7 +30,7 @@ dependencies = [
|
|
|
30
30
|
[project.urls]
|
|
31
31
|
Homepage = "https://github.com/BichengWang/financial-agent"
|
|
32
32
|
Repository = "https://github.com/BichengWang/financial-agent"
|
|
33
|
-
Documentation = "https://github.
|
|
33
|
+
Documentation = "https://bichengwang.github.io/financial-agent/"
|
|
34
34
|
Issues = "https://github.com/BichengWang/financial-agent/issues"
|
|
35
35
|
Changelog = "https://github.com/BichengWang/financial-agent/blob/main/CHANGELOG.md"
|
|
36
36
|
|
|
@@ -122,6 +122,10 @@ dev = [
|
|
|
122
122
|
"pytest-cov",
|
|
123
123
|
"pytest-custom-exit-code",
|
|
124
124
|
]
|
|
125
|
+
docs = [
|
|
126
|
+
"mkdocs>=1.6.1,<2",
|
|
127
|
+
"mkdocs-material>=9.5,<10",
|
|
128
|
+
]
|
|
125
129
|
|
|
126
130
|
[tool.black]
|
|
127
131
|
line-length = 88
|
|
@@ -28,7 +28,12 @@ from .runner.session import EXCHANGE_TZ, session_lock
|
|
|
28
28
|
from .execution import Journal
|
|
29
29
|
from .risk import KillSwitch
|
|
30
30
|
from .strategies import build_strategy
|
|
31
|
-
from .validation import
|
|
31
|
+
from .validation import (
|
|
32
|
+
PromotionPolicy,
|
|
33
|
+
check_disclosed_trials,
|
|
34
|
+
evaluate_promotion,
|
|
35
|
+
write_certificate,
|
|
36
|
+
)
|
|
32
37
|
|
|
33
38
|
ETF_UNIVERSE = (
|
|
34
39
|
"SPY",
|
|
@@ -253,7 +258,7 @@ def research_inputs(
|
|
|
253
258
|
|
|
254
259
|
if args.provider == "csv" and args.csv_dir is None:
|
|
255
260
|
raise ConfigError("csv-dir: required for csv provider")
|
|
256
|
-
provider = CsvProvider(args.csv_dir) if args.
|
|
261
|
+
provider = CsvProvider(args.csv_dir) if args.provider == "csv" else YahooProvider()
|
|
257
262
|
data = CachedProvider(provider, args.cache_dir).fetch(
|
|
258
263
|
args.universe, args.start, args.end
|
|
259
264
|
)
|
|
@@ -414,12 +419,19 @@ def main(argv: Sequence[str] | None = None) -> int:
|
|
|
414
419
|
print("\n".join(f"{k}: {v}" for k, v in backtest_summary.items()))
|
|
415
420
|
return 0
|
|
416
421
|
config = TradingConfig.load(args.config) if args.config else None
|
|
422
|
+
grid = parameter_grid(args.grid, config, params)
|
|
423
|
+
disclosed = config.disclosed_trials if config else ()
|
|
424
|
+
try:
|
|
425
|
+
check_disclosed_trials(name, grid, disclosed)
|
|
426
|
+
except ValueError as exc:
|
|
427
|
+
raise ConfigError(str(exc)) from None
|
|
417
428
|
report = evaluate_promotion(
|
|
418
429
|
name,
|
|
419
|
-
|
|
430
|
+
grid,
|
|
420
431
|
data,
|
|
421
432
|
backtest,
|
|
422
433
|
PromotionPolicy.load(args.policy),
|
|
434
|
+
disclosed_trials=disclosed,
|
|
423
435
|
)
|
|
424
436
|
if args.command == "certify":
|
|
425
437
|
write_certificate(report, args.output)
|