55
66[ ![ Python 3.11+] ( https://img.shields.io/badge/python-3.11+-blue.svg )] ( https://www.python.org/ )
77[ ![ License: MIT] ( https://img.shields.io/badge/License-MIT-yellow.svg )] ( LICENSE )
8+ [ ![ CI] ( https://github.com/magnaquant/quantcortex/actions/workflows/ci.yml/badge.svg )] ( https://github.com/magnaquant/quantcortex/actions/workflows/ci.yml )
89
910---
1011
@@ -46,13 +47,16 @@ broker SDKs, and storage clients remain lazy imports.
4647git clone https://github.com/magnaquant/quantcortex.git
4748cd quantcortex
4849python3.11 -m venv .venv && source .venv/bin/activate
50+ python -m pip install --upgrade pip
4951
50- # Core (required) - enough to run the full test suite
51- pip install numpy pandas scipy scikit-learn matplotlib pyarrow pytest
52- pip install -e . --no-deps # make quantcortex importable from scripts
52+ # Install the package and its scientific core.
53+ python -m pip install -e .
54+
55+ # Development, CI, and notebook tools.
56+ python -m pip install pytest pytest-cov ruff jupyter nbconvert ipykernel
5357
5458# Optional accelerators / integrations (Poetry extras):
55- poetry install -E all # or, with pip: pip install '.[ all]'
59+ python -m pip install -e ' .[ all] ' # or: poetry install -E all
5660# ml -> xgboost, lightgbm, catboost (GBDT cross-sectional alpha)
5761# nlp -> transformers, torch (FinBERT sentiment)
5862# rl -> stable-baselines3, gymnasium (PPO DRL allocator)
@@ -70,7 +74,8 @@ poetry install -E all # or, with pip: pip install '.[all]'
7074### Run the tests
7175
7276``` bash
73- pytest tests/ -v # weight contract, transaction costs, look-ahead, risk overlay, order state machine
77+ python -m pytest tests/ -q --cov=quantcortex --cov-fail-under=60
78+ ruff check .
7479```
7580
7681### Run the research notebooks
@@ -157,7 +162,11 @@ PYTHONPATH=. python scripts/generate_report.py \
157162The report records the file path, SHA-256 digest, observed date window, cost
158163assumptions, signal warm-up, DSR trial count/variance assumption, and whether
159164liquidity constraints are active.
160- Generated charts remain under ignored ` reports/ ` . See
165+ Each run writes ` equity_vs_benchmarks.png ` , ` drawdown.png ` , and
166+ ` rolling_sharpe.png ` under ignored ` reports/img/ ` , and prints performance and
167+ monthly-return tables. These are local research evidence, not repository
168+ fixtures. The README intentionally contains no fixed performance plot because
169+ the repository does not ship a redistributable input dataset. See
161170[ PERFORMANCE.md] ( PERFORMANCE.md ) for interpretation requirements and known
162171limitations.
163172
@@ -169,6 +178,19 @@ The platform is organized as eight layers joined by explicit data and weight
169178contracts. Components are replaceable when they preserve those contracts and
170179the surrounding data assumptions.
171180
181+ ``` mermaid
182+ flowchart LR
183+ D[Data and PIT controls] --> F[Features and alpha]
184+ F --> S[Selection]
185+ S --> A[Allocation]
186+ A --> T[Timing overlays]
187+ T --> R[Risk overlays]
188+ R --> W[Target weights]
189+ W --> B[Backtest and validation]
190+ W --> P[Pre-trade risk]
191+ P --> E[Broker execution]
192+ ```
193+
172194| Layer | Role | Key modules |
173195| -------| ------| -------------|
174196| ** Data** | Market, fundamental, and alternative-data adapters with PIT validation utilities | ` providers/ ` , ` pit_enforcer.py ` , ` lookahead_detector.py ` |
@@ -303,17 +325,20 @@ quantcortex/ # repo root
303325│ └── verify_brokers.py # broker adapters vs faithful SDK mocks
304326│
305327├── tests/
306- │ ├── conftest.py # shared synthetic-data fixtures
307- │ ├── test_lookahead_detector.py
308- │ ├── test_transaction_costs.py
309- │ ├── test_weight_interface.py
310- │ ├── test_risk_overlay.py
311- │ ├── test_order_manager.py
312- │ └── test_regression_guards.py # core-dep regression guards (audit fixes)
328+ │ ├── build_notebook_fixtures.py # deterministic test-only notebook inputs
329+ │ ├── test_data_integrity.py
330+ │ ├── test_factor_integrity.py
331+ │ ├── test_execution_safety.py
332+ │ ├── test_fail_closed_invariants.py
333+ │ ├── test_research_validation.py
334+ │ ├── test_repository_data_policy.py
335+ │ └── test_regression_guards.py # focused guards for audited defects
313336│
314337├── local_data/README.md # ignored local-data schemas and provenance rules
315338├── reports/ # ignored generated charts and report output
316- ├── docs/history-rewrite-plan.md # optional purge procedure; not executed
339+ ├── docs/
340+ │ ├── production-readiness.md # blockers before production capital
341+ │ └── history-rewrite-plan.md # optional purge procedure; not executed
317342├── docker-compose.yml
318343├── Dockerfile
319344├── pyproject.toml
@@ -408,6 +433,10 @@ volume_cap = 0.10 # max 10% of ADV when an ADV series is supplied
408433
409434## Development Roadmap
410435
436+ Implemented research components are not equivalent to production readiness.
437+ See [ docs/production-readiness.md] ( docs/production-readiness.md ) for the
438+ remaining broker, state, data, deployment, and operational controls.
439+
411440| Phase | Scope | Status |
412441| -------| -------| --------|
413442| ** Phase 1** | Data layer + PIT enforcement + universe construction | Implemented; licensed data is still required for production research |
@@ -418,14 +447,13 @@ volume_cap = 0.10 # max 10% of ADV when an ADV series is supplied
418447
419448---
420449
421- ## Framework Rationale
450+ ## External References
422451
423- | Framework | Role in quantcortex | Not used for |
424- | -----------| ---------------------| --------------|
425- | ** vectorbt** | Fast parameter sweeps in research notebooks | Live trading |
426- | ** qlib** | ML alpha factor benchmarks | Broker connectivity |
427- | ** Lean/QuantConnect** | Reference event-driven engine comparison | Primary architecture |
428- | ** FinRL-X** | Weight-contract interface pattern | Direct dependency |
452+ | Project | Relationship to quantcortex | Runtime dependency |
453+ | ---------| ------------------------------| --------------------|
454+ | [ Qlib] ( https://github.com/microsoft/qlib ) | Alpha158 feature names and operator conventions are reimplemented locally with documented deviations | No |
455+ | [ FinRL-X] ( https://github.com/AI4Finance-Foundation/FinRL-Trading ) | Inspiration for the deployment-consistent, weight-centric pipeline | No |
456+ | [ Lean/QuantConnect] ( https://github.com/QuantConnect/Lean ) | Comparative reference for event-driven architecture and broker-integrated systems | No integration |
429457
430458---
431459
0 commit comments