pub struct ComboLeg {
pub instrument_name: String,
pub amount: i32,
}Expand description
Leg in a combo instrument
Represents one instrument leg in a combo, with the instrument name and size multiplier. A negative amount indicates the leg trades in the opposite direction to the combo trade.
Fields§
§instrument_name: StringInstrument name (e.g., “BTC-29APR22-37500-C”)
amount: i32Size multiplier (negative = opposite direction)
Implementations§
Source§impl ComboLeg
impl ComboLeg
Sourcepub fn is_same_direction(&self) -> bool
pub fn is_same_direction(&self) -> bool
Check if this leg is in the same direction as the combo
Sourcepub fn is_opposite_direction(&self) -> bool
pub fn is_opposite_direction(&self) -> bool
Check if this leg is in the opposite direction to the combo
Sourcepub fn abs_amount(&self) -> i32
pub fn abs_amount(&self) -> i32
Get the absolute amount multiplier
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ComboLeg
impl<'de> Deserialize<'de> for ComboLeg
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
impl Eq for ComboLeg
impl StructuralPartialEq for ComboLeg
Auto Trait Implementations§
impl Freeze for ComboLeg
impl RefUnwindSafe for ComboLeg
impl Send for ComboLeg
impl Sync for ComboLeg
impl Unpin for ComboLeg
impl UnsafeUnpin for ComboLeg
impl UnwindSafe for ComboLeg
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