You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IBKR runtime for shared `us_equity` strategy profiles from `UsEquityStrategies`. It supports the `us_equity` profiles listed in the IBKR profile status table below. Strategy logic, cadence, asset universes, parameters, and research/backtest notes live in `UsEquityStrategies`.
22
16
23
17
Current strategy implementations are sourced from `UsEquityStrategies`.
24
18
25
-
Full strategy documentation now lives in [`UsEquityStrategies`](https://github.com/QuantStrategyLab/UsEquityStrategies). The strategy section below is kept as an execution-side summary.
26
-
This runtime matrix is the authoritative enablement source for IBKR. `UsEquityStrategies`only describes strategy-layer compatibility and human-readable metadata.
19
+
Full strategy documentation now lives in [`UsEquityStrategies`](https://github.com/QuantStrategyLab/UsEquityStrategies). This README focuses on IBKR runtime behavior, profile enablement, deployment, and credentials.
20
+
This runtime matrix is the authoritative enablement source for IBKR. `UsEquityStrategies`carries strategy-layer logic, cadence, compatibility, and metadata.
27
21
28
22
### Execution boundary
29
23
@@ -36,7 +30,7 @@ The mainline runtime now follows one path only:
36
30
37
31
`main.py` no longer reads private strategy constants or platform-only fields from strategy return payloads.
38
32
39
-
### Strategy
33
+
### Strategy profile support
40
34
41
35
**Supported `STRATEGY_PROFILE` values**
42
36
@@ -63,65 +57,11 @@ Check the current matrix locally:
Snapshot-backed profiles use upstream artifacts from `UsEquitySnapshotPipelines`. This runtime only needs the artifact location, for example `IBKR_FEATURE_SNAPSHOT_PATH`; strategy logic, cadence, feature definitions, and snapshot schema details live in `UsEquityStrategies` / `UsEquitySnapshotPipelines`.
Telegram alerts support English/Chinese execution and heartbeat messages. Strategy-specific signal/status fields come from the selected `UsEquityStrategies` profile; IBKR-specific fields cover order submission, order IDs, account-group context, and runtime state.
180
88
181
89
### Runtime env vars
182
90
@@ -188,7 +96,7 @@ The selected `ACCOUNT_GROUP` is now the runtime identity. Keep broker-specific i
188
96
|`IB_GATEWAY_IP_MODE`| Optional fallback |`internal` (default) or `external`. Recommended to keep in the selected account-group entry; this env var is only a transition fallback. |
|`ACCOUNT_GROUP`| Yes | Account-group selector. No default fallback. |
191
-
|`IBKR_FEATURE_SNAPSHOT_PATH`| Conditionally required | Required when `STRATEGY_PROFILE=russell_1000_multi_factor_defensive`. Path to the latest feature snapshot file (`.csv`, `.json`, `.jsonl`, `.parquet`). |
99
+
|`IBKR_FEATURE_SNAPSHOT_PATH`| Conditionally required | Required for snapshot-backed profiles such as `russell_1000_multi_factor_defensive` and `tech_communication_pullback_enhancement`. Path to the latest feature snapshot file (`.csv`, `.json`, `.jsonl`, `.parquet`). |
192
100
|`IB_ACCOUNT_GROUP_CONFIG_SECRET_NAME`| Yes for Cloud Run | Secret Manager secret name for account-group config JSON. Recommended production source. |
193
101
|`IB_ACCOUNT_GROUP_CONFIG_JSON`| No | Local/dev JSON fallback for account-group config. Not recommended for production Cloud Run. |
194
102
|`TELEGRAM_TOKEN`| Yes | Telegram bot token. For Cloud Run, prefer a Secret Manager reference instead of a literal env var. |
@@ -332,7 +240,7 @@ Important:
332
240
2.**VPC / Subnet**: Put Cloud Run and GCE in the same VPC. For cleaner firewall rules, reserve a dedicated subnet for Cloud Run Direct VPC egress.
333
241
3.**Cloud Run**: Deploy or update this Flask app with Direct VPC egress. Set `STRATEGY_PROFILE`, `ACCOUNT_GROUP`, and `IB_ACCOUNT_GROUP_CONFIG_SECRET_NAME`. Keep `IB_GATEWAY_ZONE` / `IB_GATEWAY_IP_MODE` only as transition fallbacks if the selected account-group payload does not already contain them. The runtime service account needs `roles/secretmanager.secretAccessor` and, for instance-name resolution, `roles/compute.viewer`.
334
242
4.**Firewall**: Allow TCP `4001` (`live`) or `4002` (`paper`) from the Cloud Run egress subnet CIDR to the GCE instance.
335
-
5.**Cloud Scheduler**: Create a job: `45 15 * * 1-5` (America/New_York), POST to the Cloud Run URL. The code handles market calendar checks internally.
243
+
5.**Cloud Scheduler**: Create a job that POSTs to the Cloud Run URL. Choose the cron from the strategy-layer cadence in `UsEquityStrategies`; daily profiles can still use a near-close weekday schedule such as `45 15 * * 1-5` in `America/New_York`.
336
244
6.**Optional public-IP mode**: Only if you cannot use VPC, set `IB_GATEWAY_IP_MODE=external`, expose the GCE public IP deliberately, and restrict source ranges tightly. This is not the default path.
337
245
338
246
Example deploy/update command:
@@ -364,11 +272,11 @@ gcloud run services update ibkr-quant \
0 commit comments