Enum lfest::FuturesTypes
source · [−]pub enum FuturesTypes {
Linear,
Inverse,
}
Expand description
Enumeration of different futures types
Variants
Linear
Linear futures with a linear payout profit and loss calculation: position_size * (exit_price - entry_price)
Inverse
Inverse futures allow the user to hold the collateral in BASE currency and speculating on price moves denoted in QUOTE currency Example would be Bitmex XBTUSD inverse perpetual futures. profit and loss calculation: position_size * (1.0 / entry_price - 1.0 / exit_price)
Implementations
return the profit and loss for a given entry and exit price with a given contract_qty Note that negative contract_qty will give the pnl for a short position
Trait Implementations
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
Auto Trait Implementations
impl RefUnwindSafe for FuturesTypes
impl Send for FuturesTypes
impl Sync for FuturesTypes
impl Unpin for FuturesTypes
impl UnwindSafe for FuturesTypes
Blanket Implementations
Mutably borrows from an owned value. Read more