pub struct FutOptTicker {
pub date: Option<String>,
pub contract_type: Option<String>,
pub exchange: Option<String>,
pub symbol: String,
pub name: Option<String>,
pub reference_price: Option<f64>,
pub start_date: Option<String>,
pub end_date: Option<String>,
pub settlement_date: Option<String>,
pub contract_sub_type: Option<String>,
pub is_dynamic_banding: bool,
pub flow_group: Option<i32>,
}Expand description
FutOpt contract information from Fugle API (futopt/intraday/ticker/{symbol})
This matches the official SDK’s RestFutOptIntradayTickerResponse. Contains contract metadata including expiration dates which are critical for futures and options trading.
§Example
use marketdata_core::models::futopt::FutOptTicker;
let json = r#"{
"date": "2024-01-15",
"type": "FUTURE",
"exchange": "TAIFEX",
"symbol": "TXFC4",
"name": "臺股期貨 03",
"referencePrice": 17500.0,
"startDate": "2023-12-20",
"endDate": "2024-03-20",
"settlementDate": "2024-03-20"
}"#;
let ticker: FutOptTicker = serde_json::from_str(json).unwrap();
assert_eq!(ticker.symbol, "TXFC4");
assert_eq!(ticker.end_date.as_deref(), Some("2024-03-20"));Fields§
§date: Option<String>Trading date (YYYY-MM-DD). Optional: the intraday/tickers list
returns lightweight items with no date; the single ticker
endpoint includes it.
contract_type: Option<String>Contract type (FUTURE or OPTION)
exchange: Option<String>Exchange code (TAIFEX)
symbol: StringContract symbol (e.g., “TXFC4”, “TXO18000C4”)
name: Option<String>Contract name (e.g., “臺股期貨 03”, “臺指選擇權 18000C 03”)
reference_price: Option<f64>Reference price (previous settlement price)
start_date: Option<String>Contract start date (YYYY-MM-DD) - when the contract starts trading
end_date: Option<String>Contract end date (YYYY-MM-DD) - last trading date
settlement_date: Option<String>Settlement date (YYYY-MM-DD) - when the contract settles
contract_sub_type: Option<String>Contract sub-type (e.g., “I” for Index)
is_dynamic_banding: boolWhether dynamic price banding is enabled
flow_group: Option<i32>Flow group for trading
Implementations§
Source§impl FutOptTicker
impl FutOptTicker
Sourcepub fn has_contract_dates(&self) -> bool
pub fn has_contract_dates(&self) -> bool
Check if the contract has valid date information
Sourcepub fn is_expired_on(&self, date: &str) -> Option<bool>
pub fn is_expired_on(&self, date: &str) -> Option<bool>
Get days until expiration from a given date Returns None if end_date is not set or date parsing fails
Note: This is a simple string comparison, not actual date calculation. For production use, consider using a proper date library.
Trait Implementations§
Source§impl Clone for FutOptTicker
impl Clone for FutOptTicker
Source§fn clone(&self) -> FutOptTicker
fn clone(&self) -> FutOptTicker
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FutOptTicker
impl Debug for FutOptTicker
Source§impl Default for FutOptTicker
impl Default for FutOptTicker
Source§fn default() -> FutOptTicker
fn default() -> FutOptTicker
Source§impl<'de> Deserialize<'de> for FutOptTicker
impl<'de> Deserialize<'de> for FutOptTicker
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<FutOptTicker, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<FutOptTicker, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for FutOptTicker
impl PartialEq for FutOptTicker
Source§fn eq(&self, other: &FutOptTicker) -> bool
fn eq(&self, other: &FutOptTicker) -> bool
self and other values to be equal, and is used by ==.