Skip to main content

Quote

Struct Quote 

Source
pub struct Quote {
Show 42 fields pub date: String, pub data_type: Option<String>, pub exchange: Option<String>, pub market: 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<PriceLevel>, pub asks: Vec<PriceLevel>, pub total: Option<TotalStats>, pub last_trade: Option<TradeInfo>, pub last_trial: Option<TradeInfo>, pub trading_halt: Option<TradingHalt>, pub is_limit_down_price: bool, pub is_limit_up_price: bool, pub is_limit_down_bid: bool, pub is_limit_up_bid: bool, pub is_limit_down_ask: bool, pub is_limit_up_ask: bool, pub is_limit_down_halt: bool, pub is_limit_up_halt: bool, pub is_trial: bool, pub is_delayed_open: bool, pub is_delayed_close: bool, pub is_continuous: bool, pub is_open: bool, pub is_close: bool, pub last_updated: Option<i64>,
}
Expand description

Real-time stock quote from Fugle API (intraday/quote/{symbol})

This matches the official SDK’s RestStockIntradayQuoteResponse

Fields§

§date: String

Trading date (YYYY-MM-DD)

§data_type: Option<String>

Security type (e.g., “EQUITY”, “ODDLOT”)

§exchange: Option<String>

Exchange code (e.g., “TWSE”, “TPEx”)

§market: Option<String>

Market (e.g., “TSE”, “OTC”)

§symbol: String

Stock symbol (e.g., “2330”)

§name: Option<String>

Stock name

§previous_close: Option<f64>

Previous trading day’s close price

§open_price: Option<f64>

Open price

§open_time: Option<i64>

Open time (Unix ms)

§high_price: Option<f64>

High price

§high_time: Option<i64>

High time (Unix ms)

§low_price: Option<f64>

Low price

§low_time: Option<i64>

Low time (Unix ms)

§close_price: Option<f64>

Close price

§close_time: Option<i64>

Close time (Unix ms)

§last_price: Option<f64>

Last traded price

§last_size: Option<i64>

Last traded size

§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) / previous close * 100

§bids: Vec<PriceLevel>

Bid price levels

§asks: Vec<PriceLevel>

Ask price levels

§total: Option<TotalStats>

Total trading statistics

§last_trade: Option<TradeInfo>

Last trade info

§last_trial: Option<TradeInfo>

Last trial (simulated matching) info

§trading_halt: Option<TradingHalt>

Trading halt status

§is_limit_down_price: bool

Is at limit down price

§is_limit_up_price: bool

Is at limit up price

§is_limit_down_bid: bool

Is limit down bid

§is_limit_up_bid: bool

Is limit up bid

§is_limit_down_ask: bool

Is limit down ask

§is_limit_up_ask: bool

Is limit up ask

§is_limit_down_halt: bool

Is limit down halt

§is_limit_up_halt: bool

Is limit up halt

§is_trial: bool

Is in trial (simulated matching) period

§is_delayed_open: bool

Is delayed open

§is_delayed_close: bool

Is delayed close

§is_continuous: bool

Is continuous trading

§is_open: bool

Is market open

§is_close: bool

Is market closed

§last_updated: Option<i64>

Last updated timestamp (Unix ms)

Implementations§

Source§

impl Quote

Source

pub fn spread(&self) -> Option<f64>

Get the bid-ask spread

Source

pub fn mid_price(&self) -> Option<f64>

Get the mid price between best bid and ask

Source

pub fn has_price_data(&self) -> bool

Check if quote has essential price data

Source

pub fn is_at_limit_up(&self) -> bool

Check if the stock is at limit up

Source

pub fn is_at_limit_down(&self) -> bool

Check if the stock is at limit down

Trait Implementations§

Source§

impl Clone for Quote

Source§

fn clone(&self) -> Quote

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 Quote

Source§

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

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

impl Default for Quote

Source§

fn default() -> Quote

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

impl<'de> Deserialize<'de> for Quote

Source§

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

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

impl PartialEq for Quote

Source§

fn eq(&self, other: &Quote) -> 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 Quote

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 Quote

Auto Trait Implementations§

§

impl Freeze for Quote

§

impl RefUnwindSafe for Quote

§

impl Send for Quote

§

impl Sync for Quote

§

impl Unpin for Quote

§

impl UnsafeUnpin for Quote

§

impl UnwindSafe for Quote

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>,