pub struct OptionChainQuery {
pub underlying: String,
pub expiration: Option<String>,
pub expiration2: Option<String>,
pub strike_proximity: i32,
pub spread_type: OptionSpreadType,
pub risk_free_rate: Option<f64>,
pub price_center: Option<f64>,
pub strike_interval: i32,
pub enable_greeks: bool,
pub strike_range: OptionStrikeRange,
pub option_type: OptionType,
}Expand description
The query used to sream an options chain.
Fields§
§underlying: StringThe symbol for the underlying security on which the option contracts are based.
expiration: Option<String>Date on which the option contract expires; must be a valid expiration date.
NOTE: Defaults to the next contract expiration date.
expiration2: Option<String>Second contract expiration date required for Calendar and Diagonal spreads.
strike_proximity: i32Specifies the number of spreads to display above and below the price center.
NOTE: Defaults to a proximity of 5 strikes above and below the price center.
spread_type: OptionSpreadTypeSpecifies the name of the spread type to use.
risk_free_rate: Option<f64>The theoretical rate of return of an investment with zero risk.
NOTE: Defaults to the current quote for $IRX.X.
NOTE: The percentage rate should be specified as a decimal value.
E.g, to use 2% for the rate, pass in 0.02.
price_center: Option<f64>Specifies the strike price center.
NOTE: Defaults to the last quoted price for the underlying security.
strike_interval: i32Specifies the desired interval between the strike prices in a spread.
NOTE: It must be greater than or equal to 1. A value of 1 uses consecutive strikes; a value of 2 skips one between strikes; and so on.
NOTE: Defaults to 1.
enable_greeks: boolSpecifies whether or not greeks properties are returned.
NOTE: Defaults to true.
strike_range: OptionStrikeRangeSet the option chain filter for specific range of options.
NOTE: Defaults to all OptionStrikeRange::All.
E.g: Filter the chain for out of the money options:
OptionStrikeRange::OTM.
option_type: OptionTypeFilters the spreads by a specific option type.
Implementations§
Source§impl OptionChainQuery
impl OptionChainQuery
pub fn as_query_string(&self) -> String
Trait Implementations§
Source§impl Clone for OptionChainQuery
impl Clone for OptionChainQuery
Source§fn clone(&self) -> OptionChainQuery
fn clone(&self) -> OptionChainQuery
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more