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
pub fn historical_value_at_risk(
&self,
returns_source: &ReturnsSource,
percentile: f64
) -> f64
pub fn historical_value_at_risk(
&self,
returns_source: &ReturnsSource,
percentile: f64
) -> f64
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
pub fn cornish_fisher_value_at_risk(
&self,
returns_source: &ReturnsSource,
percentile: f64
) -> f64
pub fn cornish_fisher_value_at_risk(
&self,
returns_source: &ReturnsSource,
percentile: f64
) -> f64
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 total realized profit and loss of the account
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
Auto Trait Implementations
impl RefUnwindSafe for AccTracker
impl Send for AccTracker
impl Sync for AccTracker
impl Unpin for AccTracker
impl UnwindSafe for AccTracker
Blanket Implementations
Mutably borrows from an owned value. Read more