|
2 | 2 |
|
3 | 3 | [Chinese README](README.zh-CN.md) |
4 | 4 |
|
5 | | -> ⚠️ Investing involves risk. This project does not provide investment advice and is for educational and research purposes only. |
| 5 | +> Investing involves risk. This project does not provide investment advice and is for education, research, and engineering review only. |
6 | 6 |
|
7 | | -## What this project does |
| 7 | +## What this repository is |
8 | 8 |
|
9 | | -InteractiveBrokersPlatform is an **Execution platform** in the QuantStrategyLab ecosystem. It executes QuantStrategyLab US and Hong Kong equity strategies through Interactive Brokers runtime services, including account-group config, region handling, dry-run controls, and SEHK/HKD support. |
| 9 | +InteractiveBrokersPlatform is a QuantStrategyLab Interactive Brokers multi-market execution platform. It runs US and HK equity profiles through IBKR runtime services with dry-run, paper, and live controls. |
10 | 10 |
|
11 | | -## Who this is for |
| 11 | +It is an execution layer, not a strategy research repository. Strategy logic comes from `UsEquityStrategies / HkEquityStrategies`; snapshot and validation artifacts come from `UsEquitySnapshotPipelines / HkEquitySnapshotPipelines` when a profile requires them. |
12 | 12 |
|
13 | | -- Engineers and researchers who want to inspect, reproduce, or extend this part of the QuantStrategyLab stack. |
14 | | -- Operators who need a clear entry point before reading the deeper runbooks or workflow files. |
15 | | -- Reviewers who need to understand the repository purpose, safety boundary, and evidence requirements before enabling automation. |
| 13 | +## Runtime boundary |
16 | 14 |
|
17 | | -## Current status |
| 15 | +- Loads only runtime-enabled strategy profiles exposed by the strategy packages. |
| 16 | +- Handles broker/API connectivity, dry-run checks, notifications, and deployment settings. |
| 17 | +- Must keep credentials in GitHub Secrets, cloud secret stores, or the broker-specific secret system, never in Git. |
| 18 | +- Should start with dry-run or paper mode before any live order path is enabled. |
18 | 19 |
|
19 | | -Production-oriented broker integration; use paper or dry-run validation before real trading. |
| 20 | +## Direct vs snapshot-backed profiles |
| 21 | + |
| 22 | +Direct runtime profiles can usually run from market history or portfolio state. Snapshot-backed profiles need a current artifact bundle from the matching snapshot pipeline before this platform should execute them. The platform should not invent strategy eligibility; it should consume the status and artifacts published by the strategy and snapshot repositories. |
| 23 | + |
| 24 | +## Deploy safely |
| 25 | + |
| 26 | +1. Configure secrets and runtime variables outside Git. |
| 27 | +2. Run the workflow or service in dry-run mode. |
| 28 | +3. Review generated orders, logs, notifications, and reconciliation output. |
| 29 | +4. Confirm rollback steps and artifact versions. |
| 30 | +5. Enable scheduled or live execution only after the above checks are clear. |
20 | 31 |
|
21 | 32 | ## Repository layout |
22 | 33 |
|
23 | | -- `application/`, `entrypoints/`, `notifications/`, `strategy/`: Python package code. |
24 | | -- `tests/`: unit and contract tests. |
25 | | -- `docs/`: detailed design notes, runbooks, and evidence docs. |
26 | | -- `.github/workflows/`: CI, scheduled jobs, and deployment workflows. |
| 34 | +- `tests/`: unit, contract, and regression tests. |
| 35 | +- `docs/`: runbooks, design notes, evidence, and integration contracts. |
| 36 | +- `.github/workflows/`: CI, scheduled jobs, release, or deployment workflows. |
27 | 37 | - `scripts/`: operator scripts and local helpers. |
| 38 | +- `research/`: research configs and non-live candidate artifacts. |
28 | 39 |
|
29 | 40 | ## Quick start |
30 | 41 |
|
31 | | -From a fresh clone: |
32 | | - |
33 | 42 | ```bash |
34 | 43 | python -m pip install -r requirements.txt |
35 | 44 | python -m pytest -q |
36 | 45 | ``` |
37 | 46 |
|
38 | | -If a command requires credentials, run it only after reading the relevant workflow or runbook and configuring secrets outside Git. |
39 | | - |
40 | | -## Deployment and operation |
41 | | - |
42 | | -Prepare IBKR connectivity, account identifiers, runtime variables, and strategy source. Run the workflow or service in dry-run mode, verify orders and notifications, then schedule production runs. |
43 | | - |
44 | | -Prefer manual or dry-run execution first. Enable schedules or live execution only after logs, artifacts, permissions, and rollback steps are reviewed. |
45 | | - |
46 | | -## Strategy performance and evidence |
47 | | - |
48 | | -Execution performance is measured by reliability and order correctness. Strategy performance must be reviewed in the strategy/snapshot repositories before routing orders through IBKR. |
49 | | - |
50 | | -README files are intentionally not a source of dated performance promises. Re-run the relevant tests, backtests, or pipeline jobs before relying on any result. |
51 | | - |
52 | | -## Safety notes |
53 | | - |
54 | | -- Never commit API keys, broker credentials, OAuth tokens, cookies, or account identifiers. |
55 | | -- Run new strategies and platform changes in dry-run or paper mode before any live execution. |
56 | | -- Review generated orders, artifacts, and logs manually before enabling schedules. |
57 | | - |
58 | | -## Contributing |
| 47 | +## Useful docs |
59 | 48 |
|
60 | | -Keep changes small, reproducible, and covered by the narrowest useful tests. For strategy-facing changes, include the evidence artifact or command used to validate behavior. |
| 49 | +- [`docs/hk_equity_runtime.md`](docs/hk_equity_runtime.md) |
| 50 | +- [`docs/ibkr_paper_top50_switch.md`](docs/ibkr_paper_top50_switch.md) |
| 51 | +- [`docs/ibkr_runtime_rollout.md`](docs/ibkr_runtime_rollout.md) |
61 | 52 |
|
62 | 53 | ## License |
63 | 54 |
|
64 | | -See [LICENSE](LICENSE) if present in this repository. |
| 55 | +See [LICENSE](LICENSE). |
0 commit comments