pub struct FutOptQuote {Show 25 fields
pub date: String,
pub contract_type: Option<String>,
pub exchange: Option<String>,
pub symbol: String,
pub name: Option<String>,
pub previous_close: Option<f64>,
pub open_price: Option<f64>,
pub open_time: Option<i64>,
pub high_price: Option<f64>,
pub high_time: Option<i64>,
pub low_price: Option<f64>,
pub low_time: Option<i64>,
pub close_price: Option<f64>,
pub close_time: Option<i64>,
pub last_price: Option<f64>,
pub last_size: Option<i64>,
pub avg_price: Option<f64>,
pub change: Option<f64>,
pub change_percent: Option<f64>,
pub amplitude: Option<f64>,
pub bids: Vec<FutOptPriceLevel>,
pub asks: Vec<FutOptPriceLevel>,
pub total: Option<FutOptTotalStats>,
pub last_trade: Option<FutOptLastTrade>,
pub last_updated: Option<i64>,
}Expand description
Real-time FutOpt quote from Fugle API (futopt/intraday/quote/{symbol})
This matches the official SDK’s RestFutOptIntradayQuoteResponse
§Example
use marketdata_core::models::futopt::FutOptQuote;
let json = r#"{
"date": "2024-01-15",
"type": "FUTURE",
"exchange": "TAIFEX",
"symbol": "TXFC4",
"name": "臺股期貨",
"previousClose": 17500.0,
"openPrice": 17520.0,
"openTime": 1705287000000,
"highPrice": 17580.0,
"highTime": 1705290600000,
"lowPrice": 17480.0,
"lowTime": 1705288800000,
"closePrice": 17550.0,
"closeTime": 1705302000000,
"lastPrice": 17550.0,
"lastSize": 2,
"avgPrice": 17530.0,
"change": 50.0,
"changePercent": 0.29,
"amplitude": 0.57,
"bids": [{"price": 17549.0, "size": 50}],
"asks": [{"price": 17550.0, "size": 30}],
"total": {"tradeVolume": 50000, "totalBidMatch": 25000, "totalAskMatch": 25000},
"lastTrade": {"price": 17550.0, "size": 2, "time": 1705302000000},
"lastUpdated": 1705302000000
}"#;
let quote: FutOptQuote = serde_json::from_str(json).unwrap();
assert_eq!(quote.symbol, "TXFC4");
assert_eq!(quote.last_price, Some(17550.0));Fields§
§date: StringTrading date (YYYY-MM-DD)
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
previous_close: Option<f64>Previous close price
open_price: Option<f64>Open price
open_time: Option<i64>Open time (Unix milliseconds)
high_price: Option<f64>High price
high_time: Option<i64>High time (Unix milliseconds)
low_price: Option<f64>Low price
low_time: Option<i64>Low time (Unix milliseconds)
close_price: Option<f64>Close price
close_time: Option<i64>Close time (Unix milliseconds)
last_price: Option<f64>Last traded price
last_size: Option<i64>Last traded size (number of contracts)
avg_price: Option<f64>Average price
change: Option<f64>Price change from previous close
change_percent: Option<f64>Percentage change from previous close
amplitude: Option<f64>Price amplitude (high - low) / reference price * 100
bids: Vec<FutOptPriceLevel>Bid price levels (best to worst)
asks: Vec<FutOptPriceLevel>Ask price levels (best to worst)
total: Option<FutOptTotalStats>Total trading statistics
last_trade: Option<FutOptLastTrade>Last trade information
last_updated: Option<i64>Last updated timestamp (Unix milliseconds)
Implementations§
Source§impl FutOptQuote
impl FutOptQuote
Sourcepub fn has_price_data(&self) -> bool
pub fn has_price_data(&self) -> bool
Check if quote has essential price data
Sourcepub fn total_volume(&self) -> Option<i64>
pub fn total_volume(&self) -> Option<i64>
Get the total trade volume
Trait Implementations§
Source§impl Clone for FutOptQuote
impl Clone for FutOptQuote
Source§fn clone(&self) -> FutOptQuote
fn clone(&self) -> FutOptQuote
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 FutOptQuote
impl Debug for FutOptQuote
Source§impl Default for FutOptQuote
impl Default for FutOptQuote
Source§fn default() -> FutOptQuote
fn default() -> FutOptQuote
Source§impl<'de> Deserialize<'de> for FutOptQuote
impl<'de> Deserialize<'de> for FutOptQuote
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<FutOptQuote, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<FutOptQuote, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for FutOptQuote
impl PartialEq for FutOptQuote
Source§fn eq(&self, other: &FutOptQuote) -> bool
fn eq(&self, other: &FutOptQuote) -> bool
self and other values to be equal, and is used by ==.