1.7 KiB
1.7 KiB
Manual Test Instructions
IBKR Daily Fetcher Skeleton
This test checks the first hard-coded IBKR data fetcher without writing any data files.
The fetcher currently requests:
- gateway:
127.0.0.1:4002; - client id:
101; - ticker:
SPY; - date range:
2026-06-01to2026-06-05; - bar size:
1 day; - data type:
TRADES; - regular trading hours only;
- output: printed CSV-like rows.
Prerequisites
- Start IBKR Gateway.
- Log in to the paper trading account.
- Confirm API access is enabled in IBKR Gateway.
- Confirm the API socket port is
4002. - Confirm no other API client is already using client id
101. - Sync Python dependencies:
mise exec -- uv sync
Run The Test
From the repository root, run:
mise exec -- uv run python src/trading_bot/data/fetch_ibkr_daily.py
Expected Output
The tool should first print the hard-coded request range and connection target:
Fetching SPY daily candles from 2026-06-01 to 2026-06-05
Connecting to IBKR Gateway at 127.0.0.1:4002 with client id 101
If the request succeeds, it should then print a header and one row per returned trading day:
date,ticker,open,high,low,close,volume
2026-06-01,SPY,...
Exact prices and volume depend on what IBKR returns.
Common Issues
- Connection refused: IBKR Gateway is not running, the port is not
4002, or API access is disabled. - Client id already in use: change
IBKR_CLIENT_IDin the fetcher or disconnect the other client. - No historical bars: confirm the account has market data permissions and that IBKR accepts the requested historical data range.
- Pacing or permission errors: note the IBKR error message before changing the request.
This skeleton does not write Parquet files yet.