pub trait AccountTracker<M>: Sendwhere
    M: Currency,{
    // Required methods
    fn update(&mut self, timestamp: u64, price: QuoteCurrency, upnl: M);
    fn log_rpnl(&mut self, rpnl: M);
    fn log_fee(&mut self, fee_in_margin: M);
    fn log_limit_order_submission(&mut self);
    fn log_limit_order_cancellation(&mut self);
    fn log_limit_order_fill(&mut self);
    fn log_trade(
        &mut self,
        side: Side,
        price: QuoteCurrency,
        size: M::PairedCurrency
    );
}
Expand description

Something that tracks the performance of the Account. This allows for greated flexibility over using the FullAccountTracker which can easily use more than 10GB of RAM due to storage of tick-by-tick returns

Required Methods§

source

fn update(&mut self, timestamp: u64, price: QuoteCurrency, upnl: M)

Update with each tick, using data provided in update_state method of Exchange.

Arguments:

timestamp: timestamp of latest tick price: price of latest tick upnl: unrealized profit and loss of account in current tick

source

fn log_rpnl(&mut self, rpnl: M)

Log a realized profit and loss event

source

fn log_fee(&mut self, fee_in_margin: M)

Log a fee, measured in the margin currency

source

fn log_limit_order_submission(&mut self)

Log a limit order submission event

source

fn log_limit_order_cancellation(&mut self)

Log a limit order cancellation event

source

fn log_limit_order_fill(&mut self)

Log a limit order fill event

source

fn log_trade(&mut self, side: Side, price: QuoteCurrency, size: M::PairedCurrency)

Log a trade event where some order got filled and the position changed

Implementors§