Repository navigation
Conversation
TWS sends the underlying's security type as one of its codes (STK for a stock option, FUT for a futures option, IND for a future on an index) and nothing for a stock or an index, live on paper TWS. The field was a String, empty when TWS sent nothing. It now decodes with the existing SecurityType parser, None when absent and SecurityType::Other for a code the crate doesn't model. Migration section 40.
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
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.
Why
ContractDetails::under_security_typewas aStringholding a TWS security type code, or"". A caller checking whether a contract is a futures option compared against"FUT", whileContract::security_typeis already aSecurityType.What
under_security_typeisOption<SecurityType>, decoded with the existingparse_optional:Nonewhen TWS sends nothing,SecurityType::Otherfor a code the crate doesn't model, so a new code never fails the request.Contract::security_type(the variant name, ornull); the migration section says so.Verified
underSecType; the ES future sendsIND; all 680 AAPL options for 202612 sendSTK; all 7582 ES futures options for 202612 sendFUT.STK,FUT,IND, an unmodeled code, empty, and absent.cargo fmt; clippy, rustdoc, examples andcargo teston the default, sync-only and all-features legs;tools/check-rules-graph.sh; clippy onibapi-integration-syncandibapi-integration-async.