Struct lfest::Margin [−][src]
Describes the margin information of the account
Fields
wallet_balance: f64
The wallet balance of account denoted in BASE currency
margin_balance: f64
The margin balance of account denoted in BASE currency
position_margin: f64
The position margin of account denoted in BASE currency
order_margin: f64
The order margin of account denoted in BASE currency
available_balance: f64
The available balance of account denoted in BASE currency
Implementations
impl Margin
[src]
pub fn new(init_balance: f64) -> Self
[src]
Create a new margin account with an initial balance denoted in BASE currency
pub fn reserve_order_margin(&mut self, order_margin: f64) -> bool
[src]
Reserve some margin for open orders, order_margin denoted in BASE currency Returns true if successful
pub fn free_order_margin(&mut self, order_margin: f64) -> bool
[src]
Free some reserved order margin for some order value, denoted in BASE currency Returns true if successful
pub fn add_margin_to_position(&mut self, trade_margin: f64) -> bool
[src]
Assign some margin for a trade with given margin value, denoted in BASE currency Return true if successful
pub fn reduce_position_margin(&mut self, trade_margin: f64) -> bool
[src]
Reduce the position margin by a given trade margin Return true if successful
pub fn change_balance(&mut self, delta: f64) -> bool
[src]
Change the balance by a given delta e.g. from realizing profit or loss Return true if successful
pub fn wallet_balance(&self) -> f64
[src]
Return the wallet balance of account
pub fn margin_balance(&self) -> f64
[src]
Return the margin balance of account
pub fn position_margin(&self) -> f64
[src]
Return the position margin of account
pub fn order_margin(&self) -> f64
[src]
Return the used order margin of account
pub fn available_balance(&self) -> f64
[src]
Return the available balance of account
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Margin
impl Send for Margin
impl Sync for Margin
impl Unpin for Margin
impl UnwindSafe for Margin
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DynClone for T where
T: Clone,
[src]
T: Clone,
pub fn __clone_box(&self, Private) -> *mut ()
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,