Skip to main content

FutOptTicker

Struct FutOptTicker 

Source
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: String

Contract 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: bool

Whether dynamic price banding is enabled

§flow_group: Option<i32>

Flow group for trading

Implementations§

Source§

impl FutOptTicker

Source

pub fn has_contract_dates(&self) -> bool

Check if the contract has valid date information

Source

pub fn is_future(&self) -> bool

Check if this is likely a futures contract based on type

Source

pub fn is_option(&self) -> bool

Check if this is likely an options contract based on type

Source

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

Source§

fn clone(&self) -> FutOptTicker

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FutOptTicker

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for FutOptTicker

Source§

fn default() -> FutOptTicker

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for FutOptTicker

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<FutOptTicker, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for FutOptTicker

Source§

fn eq(&self, other: &FutOptTicker) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for FutOptTicker

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for FutOptTicker

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,