Trait lfest::prelude::MarginCurrency
source · pub trait MarginCurrency: Currency {
// Required method
fn pnl<S>(
entry_price: QuoteCurrency,
exit_price: QuoteCurrency,
quantity: S
) -> S::PairedCurrency
where S: Currency;
}
Expand description
Each Currency that is used as margin has to implement this trait.
The margin currency of an account defines which type of futures contract is
traded. Here is how the margin Currency
maps to the futures type:
QuoteCurrency
: linear futures.
BaseCurrency
: inverse futures.
Required Methods§
sourcefn pnl<S>(
entry_price: QuoteCurrency,
exit_price: QuoteCurrency,
quantity: S
) -> S::PairedCurrencywhere
S: Currency,
fn pnl<S>(
entry_price: QuoteCurrency,
exit_price: QuoteCurrency,
quantity: S
) -> S::PairedCurrencywhere
S: Currency,
Object Safety§
This trait is not object safe.