-
Notifications
You must be signed in to change notification settings - Fork 60
update #388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
update #388
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Implement new method to update contracts in TWS display groups for both synchronous and asynchronous clients. The method allows changing the displayed contract by providing a contract identifier.
* Add time zone map * fix: correct China timezone mapping to Asia/Shanghai - Create shared timezone utility in src/common/timezone.rs - Map Chinese timezone names to Asia/Shanghai (UTC+8) instead of CST (UTC-6) - Handle UTF-8 Chinese names: 中国标准时间, 北京时间 - Handle Windows name: China Standard Time - Handle GB2312 mojibake by detecting U+FFFD replacement characters - Update both connection and market_data modules to use shared utility - Add tests for timezone mapping --------- Co-authored-by: kingyond <900483@qq.com> Co-authored-by: Wil Boayue <wil.boayue@gmail.com>
…#366) Add helper methods to Notice struct: - is_cancellation() - code 202 (order cancelled confirmation) - is_warning() - codes 2100-2169 - is_system_message() - codes 1100, 1101, 1102, 1300 (connectivity) - is_informational() - true if any of the above - is_error() - true if NOT informational Fixes wboayue#365
* fix: prevent scanner infinite hang on error messages (wboayue#370) - Add explicit handling for IncomingMessages::Error in scanner decode functions (async and sync) to return Error::Message instead of Error::UnexpectedResponse - Add bounded retry logic (max 10 attempts) to subscription next() methods to prevent infinite loops from unexpected responses - Log warnings on retry attempts and errors when max retries exceeded Fixes wboayue#370 * refactor: extract shared scanner decode function Move scanner message type matching logic to decode_scanner_message() in the common decoders module to avoid duplication between async and sync implementations. * refactor: extract retry decision logic to common module Move retry checking and logging to check_retry() function in the common module. This consolidates the retry decision logic that was duplicated between async and sync subscription implementations. - Add RetryDecision enum to represent continue/stop decisions - Add check_retry() function that handles counting and logging - Update async and sync subscriptions to use the shared function - Add test for check_retry() * style: fix variable naming and format code Remove underscore prefix from 'err' variable since it is actually used in the should_retry_error() call.
Reserve all order IDs upfront by calling next_order_id() for each order instead of using base_id + offset calculation. Fixes wboayue#374
… (wboayue#376) Take profit and stop loss orders now inherit the outside_rth flag from the parent order, enabling bracket orders to work correctly during extended trading hours.
Allow market entry for bracket orders for immediate execution in scalping scenarios.
Fixes wboayue#379 - 10-second bar granularity was missing from BarSize enum.
…oayue#383) Fixes wboayue#382. Symbol was incorrectly set to "EUR.USD" format instead of just "EUR". Currency was hardcoded to "USD" instead of using the quote parameter. Also removes unused amount field.
…ue#384) * feat: add historical_data_streaming() with keepUpToDate=true support Add streaming historical data support for IBKR's reqHistoricalData API with keepUpToDate parameter enabled. This allows receiving continuous bar updates as they build, enabling live trading strategies to receive bars at any IBKR-supported resolution. Changes: - Add HistoricalBarUpdate enum to represent streaming updates - Add decode_historical_data_update() for message type 90 - Add historical_data_streaming() async function that sets keepUpToDate=true - Add HistoricalDataStreamingSubscription for handling streaming responses IBKR behavior notes: - Same timestamp bars are sent ~4-6 seconds apart as they build - When a NEW timestamp appears, the previous bar is complete - Supported what_to_show: Trades, Midpoint, Bid, Ask only - end_date must be None when keepUpToDate=true * add missing historical_data_streaming function * Change channel-closed logs from warn to info * fixed historical_data_streaming to properly received historical streaming data with keep_up_to_date=true * fixed formatting and doc tests * Revert "Change channel-closed logs from warn to" This reverts commit 065a65e. * fix: use proper contract builders in example - Use Contract::forex() builder instead of manual field assignment - Use struct initialization for futures query to satisfy clippy --------- Co-authored-by: Wil Boayue <wil.boayue@gmail.com>
…wboayue#385) * Add sync historical_data_streaming(), address PR wboayue#384 feedback - Add blocking HistoricalDataStreamingSubscription with next/try_next/next_timeout - Add Client::historical_data_streaming() for sync API - Remove HistoricalEnd variant from HistoricalBarUpdate enum - Fix doc example imports to use prelude types - Replace fragile contains() test assertions with field index checks - Remove unnecessary #[cfg(feature = "async")] from decoder * Export historical_data_streaming doctest (ignore -> no_run) * Bump version to 2.7.0
…boayue#386) * Refactor: consolidate decoder context, add Client::decoder_context() - Rename ResponseContext to DecoderContext - Add server_version and time_zone fields to DecoderContext - Change StreamDecoder::decode() signature to take &DecoderContext - Add decoder_context() helper to sync and async Client - Fix async SubscriptionBuilder to preserve time_zone - Replace 20+ DecoderContext::new() calls with client.decoder_context() * Format code
* feat(orders): add `last_n_days` and `specific_dates` to `ExecutionFilter` * feat(connection): bump server `max_version` to `200` (PARAMETRIZED_DAYS_OF_EXECUTIONS) * Add tests for encode_executions version-gated date fields Tests verify: - Version < 200: date fields not encoded - Version >= 200: last_n_days and specific_dates encoded * Update mock version responses to 200, improve doc comment - Mock server responses now return v200 to match advertised range - Add format spec and example to specific_dates doc * Fix test helper to include issuer_id field for v200 Server version 200 >= BOND_ISSUERID (176), so encoder adds issuer_id. Test helper was missing this field, causing packet mismatch with mock. --------- Co-authored-by: Wil Boayue <wil.boayue@gmail.com>
Contributor
Author
|
Sorry, this was a mistake |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.