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,

source

pub fn ticker(&self) -> &String

Identifying ticker symbol

source

pub fn price_filter(&self) -> &PriceFilter

Pricing rules

source

pub fn quantity_filter(&self) -> &QuantityFilter<Q>

Quantity rules

source§

impl<Q> ContractSpecification<Q>
where Q: Currency,

source

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.

source

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).

source

pub fn mark_method(&self) -> MarkMethod

The method for computing mark-to-market.

source

pub fn fee_maker(&self) -> Fee

The maker fee as a fraction. e.g.: 2.5 basis points rebate -> -0.00025

source

pub fn fee_taker(&self) -> Fee

The taker fee as a fraction. e.g.: 10 basis points -> 0.0010

source§

impl<Q> ContractSpecification<Q>
where Q: Currency,

source

pub fn set_ticker(&mut self, val: String) -> &mut Self

Identifying ticker symbol

source

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,

source

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>
where Q: Currency + Clone,

source§

fn clone(&self) -> ContractSpecification<Q>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Q> Debug for ContractSpecification<Q>
where Q: Currency + Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Q> Default for ContractSpecification<Q>
where Q: Currency,

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<Q> Freeze for ContractSpecification<Q>
where Q: Freeze,

§

impl<Q> RefUnwindSafe for ContractSpecification<Q>
where Q: RefUnwindSafe,

§

impl<Q> Send for ContractSpecification<Q>

§

impl<Q> Sync for ContractSpecification<Q>
where Q: Sync,

§

impl<Q> Unpin for ContractSpecification<Q>
where Q: Unpin,

§

impl<Q> UnwindSafe for ContractSpecification<Q>
where Q: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more