Struct lfest::AccTracker[][src]

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

Used for keeping track of account statistics

Implementations

Vector of absolute returns the account has generated, including unrealized pnl

Parameters

source: the sampling interval of pnl snapshots

Vector of natural logarithmic returns the account has generated, including unrealized pnl

Parameters

source: the sampling interval of pnl snapshots

Ratio of cumulative trade profit over cumulative trade loss

Cumulative fees paid to the exchange

Would be return of buy and hold strategy

Would be return of sell and hold strategy

Return the sharpe ratio using the selected returns as source

Parameters:

returns_source: the sampling interval of pnl snapshots risk_free_is_buy_and_hold: if true, it will use the market returns as the risk-free comparison else risk-free rate is zero

Return the Sortino ratio based on daily returns data

Parameters:

returns_source: the sampling interval of pnl snapshots risk_free_is_buy_and_hold: if true, it will use the market returns as the risk-free comparison else risk-free rate is zero

Calculate the value at risk using the percentile method on daily returns multiplied by starting wallet balance The time horizon N is assumed to be 1 The literature says if you want a larger N, just multiply by N.sqrt(), which assumes standard normal distribution

Arguments

returns_source: the sampling interval of pnl snapshots percentile: value between [0.0, 1.0], smaller value will return more worst case results

Calculate the cornish fisher value at risk based on daily returns of the account

Arguments

returns_source: the sampling interval of pnl snapshots percentile: in range [0.0, 1.0], usually something like 0.01 or 0.05

Return the number of trading days

Also called discriminant-ratio, which focuses on the added value of the algorithm It uses the Cornish-Fish Value at Risk (CF-VaR) It better captures the risk of the asset as it is not limited by the assumption of a gaussian distribution It it time-insensitive from: https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3927058

Parameters

returns_source: the sampling interval of pnl snapshots

Annualized return on investment as a factor, e.g.: 100% -> 2x

Maximum drawdown of the wallet balance

Maximum drawdown of the wallet balance including unrealized profit and loss

Return the number of trades the account made

Return the ratio of executed trades vs total trading opportunities Higher values means a more active trading agent

Return the ratio of buy trades vs total number of trades

Return the cumulative turnover denoted in margin currency

Return the total realized profit and loss of the account

Return the current unrealized profit and loss

Return the ratio of winning trades vs all trades

Return the ratio of filled limit orders vs number of submitted limit orders

Return the ratio of limit order cancellations vs number of submitted limit orders

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.