pub struct OptionData {
pub symbol: String,
pub strike_price: f64,
pub contract_type: ContractType,
/* private fields */
}Expand description
Struct representing a complete option contract
Fields§
§symbol: Stringticker symbol
strike_price: f64§contract_type: ContractTypeImplementations§
Source§impl OptionData
impl OptionData
Sourcepub fn parse_osi(osi: &str) -> Result<OptionData, Error>
pub fn parse_osi(osi: &str) -> Result<OptionData, Error>
parse a string which is OSI compliant to OptionData
pub fn parse_ib_activity_statement_trades_symbol( osi: &str, ) -> Result<OptionData, Error>
Sourcepub fn to_osi_string(&self) -> String
pub fn to_osi_string(&self) -> String
serializes OptionData to a OSI compliant string like described here [https://ibkr.info/node/972]
Sourcepub fn to_osi_string_no_symbol_padding(&self) -> String
pub fn to_osi_string_no_symbol_padding(&self) -> String
serializes OptionData to a OSI compliant string like described here [https://ibkr.info/node/972] but without padding of the symbol to 6 chars
Sourcepub fn to_schwab_string(&self) -> String
pub fn to_schwab_string(&self) -> String
serializes OptionData to a Schwab compliant string like described here [http://www.schwabcontent.com/symbology/int_eng/key_details.html]
pub fn get_expiration_year(&self) -> i32
pub fn get_expiration_month(&self) -> i32
pub fn get_expiration_day(&self) -> i32
pub fn set_ymd(&self, year: i32, month: i32, day: i32) -> Result<(), Error>
Trait Implementations§
Source§impl Debug for OptionData
impl Debug for OptionData
Source§impl PartialEq for OptionData
impl PartialEq for OptionData
impl StructuralPartialEq for OptionData
Auto Trait Implementations§
impl Freeze for OptionData
impl RefUnwindSafe for OptionData
impl Send for OptionData
impl Sync for OptionData
impl Unpin for OptionData
impl UnwindSafe for OptionData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more