Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,6 @@ test-outputs/
CLAUDE.md

# Test files
test_*.py
*_test.py
CONFIRMATION.md

# Development files
Expand Down
273 changes: 273 additions & 0 deletions AGENTS.md

Large diffs are not rendered by default.

47 changes: 47 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,53 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Fixed
- Declared the undeclared `httpx` runtime dependency in `pyproject.toml`
- REST requests now attach the broker's auth headers via the auth handler
(`Authorization: DXAPI <token>` plus `X-Auth-Token` for session auth),
fixing authenticated requests against DXTrade brokers such as Velotrade
- Portfolio subscription now uses the DXTrade Push API payload shape
(`requestType: "LIST"` + `accounts: [...]`); the previous shape is
rejected by the server (`errorCode 32`)
- `send_message()` no longer reads from the socket (the background message
handler owns `recv`), fixing a `websockets.ConcurrencyError` on send
- Push subscription messages now carry the spec-required `timestamp` field
- Ping stats are stored per channel even before a full connection cycle,
fixing lost counters

### Added
- `AuthHandler.get_auth_headers()` — transport-agnostic auth header builder
implemented by `SessionHandler`, `BearerTokenHandler`, and `HMACHandler`
- Transport REST methods matching the official DXTrade OpenAPI spec:
`get_users`, `get_account_metrics`, `get_account_portfolio`,
`get_account_positions`, `get_account_orders`, `get_account_orders_history`,
`query_instruments`, `get_market_data`, `place_order`, `cancel_order`,
`ping`, `logout`, and `_encode_account` for percent-encoding account codes
- `dxtrade.utils` — high-level helpers for streaming and trading:
`stream_quotes`, `open_position` (with protective stop loss),
`close_position`, `flatten`, `account_is_flat`, `resolve_account`,
`resolve_symbol`, `discover_symbols`, `order_code`
- `DXTradeTransport.wait_for_channel()` — wait for a WebSocket channel to connect
- `dxtrade.capture.Capture` class — high-level API for streaming quotes,
placing orders, and capturing data to CSV + Polars DataFrame
- `dxtrade.capture.QuoteStore` — append-only CSV store with incremental
Polars DataFrame for quote capture
- `QuoteStore.to_ohlcv()` / `Capture.get_ohlcv()` — convert quote data to
OHLCV bars with configurable timeframes (1m, 5m, 15m, 1h, 4h, 1d)
- Example scripts: `examples/stream_quotes.py`, `examples/trade_smoke.py`,
`examples/stream_quotes_store.py`, and `examples/capture_example.py`
(captures quotes to append-only CSV plus an incremental Polars DataFrame;
requires the `capture` extra, `pip install -e ".[capture]"`)
- `env_config.py` now reads the documented `DXTRADE_WS_MARKET_DATA_URL` and
`DXTRADE_WS_PORTFOLIO_URL` variables

### Fixed
- WebSocket URL fallback builders no longer inject a wrong `/ws` path segment
(`get_market_data_url`/`get_portfolio_url`), and `subscribe()` resolves URLs
through them

## [1.0.0] - 2025-01-06

### Added
Expand Down
300 changes: 300 additions & 0 deletions TEST_PLAN_VELOTRADE.md

Large diffs are not rendered by default.

Loading
Loading