Struct lfest::prelude::ContractSpecification
source · pub struct ContractSpecification<Q>where
Q: Currency,{ /* private fields */ }
Expand description
Specifies the details of the futures contract
Implementations§
source§impl<Q> ContractSpecification<Q>where
Q: Currency,
impl<Q> ContractSpecification<Q>where
Q: Currency,
sourcepub fn price_filter(&self) -> &PriceFilter
pub fn price_filter(&self) -> &PriceFilter
Pricing rules
sourcepub fn quantity_filter(&self) -> &QuantityFilter<Q>
pub fn quantity_filter(&self) -> &QuantityFilter<Q>
Quantity rules
source§impl<Q> ContractSpecification<Q>where
Q: Currency,
impl<Q> ContractSpecification<Q>where
Q: Currency,
sourcepub fn init_margin_req(&self) -> Decimal
pub fn init_margin_req(&self) -> Decimal
The initial deposit required to open a new futures position. Expressed as a fraction. Eg. 1% (0.01) initial margin requirement, which is equal to 100x leverage.
sourcepub fn maintenance_margin(&self) -> Decimal
pub fn maintenance_margin(&self) -> Decimal
The minimum amount that must be maintained in the traders account to keep existing positions open. Expressed as a fraction. Eg. 0.5% (0.005).
sourcepub fn mark_method(&self) -> MarkMethod
pub fn mark_method(&self) -> MarkMethod
The method for computing mark-to-market
.
source§impl<Q> ContractSpecification<Q>where
Q: Currency,
impl<Q> ContractSpecification<Q>where
Q: Currency,
sourcepub fn set_ticker(&mut self, val: String) -> &mut Self
pub fn set_ticker(&mut self, val: String) -> &mut Self
Identifying ticker symbol
sourcepub fn set_mark_method(&mut self, val: MarkMethod) -> &mut Self
pub fn set_mark_method(&mut self, val: MarkMethod) -> &mut Self
The method for computing mark-to-market
.
source§impl<Q> ContractSpecification<Q>where
Q: Currency,
impl<Q> ContractSpecification<Q>where
Q: Currency,
sourcepub fn new(
leverage: Leverage,
maintenance_margin_fraction: Decimal,
price_filter: PriceFilter,
quantity_filter: QuantityFilter<Q>,
fee_maker: Fee,
fee_taker: Fee,
) -> Result<Self>
pub fn new( leverage: Leverage, maintenance_margin_fraction: Decimal, price_filter: PriceFilter, quantity_filter: QuantityFilter<Q>, fee_maker: Fee, fee_taker: Fee, ) -> Result<Self>
Create a new ContractSpecification
from the most basic parameters.
§Arguments:
leverage
: The leverage dictates the margin requirements of a position.
When a trader sets a user-defined leverage setting, they’re essentially adjusting the margin requirements for their account.
higher leverage setting means lower margin requirements, while a lower leverage setting means higher margin requirements.
maintenance_margin_fraction
: The fraction (in range [0..1]) that the maintenance margin will be relative to the computed initial_margin
.
price_filter
: The rules for prices in the market
quantity_filter
: The rules for quantities in the market.
fee_maker
: The fee a maker pays.
fee_taker
: The fee a taker pays.
Trait Implementations§
source§impl<Q> Clone for ContractSpecification<Q>
impl<Q> Clone for ContractSpecification<Q>
source§fn clone(&self) -> ContractSpecification<Q>
fn clone(&self) -> ContractSpecification<Q>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more