Struct lfest::Position [−][src]
pub struct Position { /* fields omitted */ }
Describes the position information of the account
Implementations
impl Position
[src]
impl Position
[src]pub fn new(leverage: f64) -> Self
[src]
Create a new position with a given leverage
pub fn new_all_fields(
size: f64,
value: f64,
entry_price: f64,
leverage: f64,
unrealized_pnl: f64
) -> Self
[src]
size: f64,
value: f64,
entry_price: f64,
leverage: f64,
unrealized_pnl: f64
) -> Self
Create a new position with all fields custom. NOTE: only for advanced use cases
pub fn size(&self) -> f64
[src]
Return the position size denoted in QUOTE currency
pub fn value(&self) -> f64
[src]
Return the position value denoted in BASE currency
pub fn entry_price(&self) -> f64
[src]
Return the entry price of the position
pub fn leverage(&self) -> f64
[src]
Return the positions leverage
pub fn unrealized_pnl(&self) -> f64
[src]
Return the positions unrealized profit and loss, denoted in BASE currency
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Position
impl RefUnwindSafe for Position
impl UnwindSafe for Position
impl UnwindSafe for Position