pub struct Instrument {
pub symbol: String,
pub name: String,
pub exchange_id: String,
pub exchange: String,
pub instrument_type: InstrumentType,
pub currency: String,
pub lot_size: u32,
pub min_price_increment: Decimal,
pub min_quantity: u32,
pub tradeable: bool,
pub margin_available: bool,
pub short_available: bool,
}Expand description
Information about a tradeable instrument.
Fields§
§symbol: StringTrading symbol (e.g., “AAPL”, “BTC-USD”).
name: StringFull name of the instrument.
exchange_id: StringUnique identifier used by the exchange (e.g., FIGI).
exchange: StringExchange where the instrument is traded.
instrument_type: InstrumentTypeType of instrument.
currency: StringBase currency for the instrument.
lot_size: u32Minimum lot size.
min_price_increment: DecimalMinimum price increment.
min_quantity: u32Minimum order quantity in lots.
tradeable: boolWhether the instrument is currently tradeable.
margin_available: boolWhether margin trading is allowed.
short_available: boolWhether short selling is allowed.
Implementations§
Source§impl Instrument
impl Instrument
Sourcepub fn lots_to_units(&self, lots: u32) -> Decimal
pub fn lots_to_units(&self, lots: u32) -> Decimal
Returns the quantity in units for the given number of lots.
Sourcepub fn units_to_lots(&self, units: Decimal) -> u32
pub fn units_to_lots(&self, units: Decimal) -> u32
Returns the number of complete lots for the given quantity.
Sourcepub fn round_price(&self, price: Decimal) -> Decimal
pub fn round_price(&self, price: Decimal) -> Decimal
Rounds a price to the minimum price increment.
Trait Implementations§
Source§impl Clone for Instrument
impl Clone for Instrument
Source§impl Debug for Instrument
impl Debug for Instrument
Source§impl<'de> Deserialize<'de> for Instrument
impl<'de> Deserialize<'de> for Instrument
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for Instrument
impl PartialEq for Instrument
Source§impl Serialize for Instrument
impl Serialize for Instrument
impl StructuralPartialEq for Instrument
Auto Trait Implementations§
impl Forget for Instrument
impl Freeze for Instrument
impl Move for Instrument
impl RefUnwindSafe for Instrument
impl Send for Instrument
impl Sync for Instrument
impl Unpin for Instrument
impl UnsafeUnpin for Instrument
impl UnwindSafe for Instrument
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more