Initial hello world IBKR API connection.
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
# 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-01` to `2026-06-05`;
|
||||
- bar size: `1 day`;
|
||||
- data type: `TRADES`;
|
||||
- regular trading hours only;
|
||||
- output: printed CSV-like rows.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
1. Start IBKR Gateway.
|
||||
2. Log in to the paper trading account.
|
||||
3. Confirm API access is enabled in IBKR Gateway.
|
||||
4. Confirm the API socket port is `4002`.
|
||||
5. Confirm no other API client is already using client id `101`.
|
||||
6. Sync Python dependencies:
|
||||
|
||||
```sh
|
||||
mise exec -- uv sync
|
||||
```
|
||||
|
||||
## Run The Test
|
||||
|
||||
From the repository root, run:
|
||||
|
||||
```sh
|
||||
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:
|
||||
|
||||
```text
|
||||
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:
|
||||
|
||||
```text
|
||||
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_ID` in 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.
|
||||
Reference in New Issue
Block a user