Struct lfest::Exchange[][src]

pub struct Exchange { /* fields omitted */ }
Expand description

The main leveraged futures exchange for simulated trading

Implementations

Create a new Exchange with the desired config and whether to use candles as infomation source

Return a reference to current exchange config

Return the bid price

Return the ask price

Return a reference to Account

Return a mutable reference to Account

Update the exchange state with a new trade.

Parameters

bid: bid price ask: ask price timestamp: timestamp usually in milliseconds

Returns

executed orders true if position has been liquidated

Submit a new order to the exchange. Returns the order with timestamp and id filled in or OrderError

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.