FastMM documentation
FastMM C++ API 0.6.0
Public headers, tier 1 and tier 2
Loading...
Searching...
No Matches
fastmm::bt::Metrics Struct Reference

#include <fastmm/backtest/metrics.hpp>

Public Member Functions

const MarkoutHorizon * markout (std::int64_t horizon_ns) const noexcept
 The markout of one horizon, or nullptr when it was not measured.
 

Public Attributes

double net_pnl = 0.0
 PnL in quote currency at the last bar: net == realized + unrealized - fees.
 
double realized_pnl = 0.0
 
double unrealized_pnl = 0.0
 
double fees = 0.0
 
double final_position = 0.0
 base units, summed over instruments
 
double sharpe_bar = 0.0
 mean / sample stdev of per-bar equity changes
 
double sharpe_annualized = 0.0
 sharpe_bar * sqrt(bars per 365-day year); NaN for runs shorter than kMinAnnualizedDurationS, where the scaling turns noise into four-digit values.
 
double max_drawdown = 0.0
 largest fall of equity from its peak, quote currency, >= 0
 
double max_drawdown_pct = 0.0
 max_drawdown / initial_capital; NaN when initial_capital <= 0.
 
std::uint64_t fills = 0
 
std::uint64_t maker_fills = 0
 
std::uint64_t taker_fills = 0
 
std::uint64_t orders = 0
 new orders sent
 
std::uint64_t cancels = 0
 
std::uint64_t replaces = 0
 
std::uint64_t rejects = 0
 
double fill_ratio = 0.0
 fills / new orders
 
double spread_captured_bps = 0.0
 mean of (mid - px) / mid for buys, (px - mid) / mid sells
 
double volume_base = 0.0
 
double volume_quote = 0.0
 
double inventory_mean = 0.0
 over bars
 
double inventory_abs_mean = 0.0
 over bars
 
double inventory_max = 0.0
 max |position| over bars
 
double quote_uptime = 0.0
 fraction of bars with both a bid and an ask resting
 
std::uint64_t bars = 0
 
double duration_s = 0.0
 
std::uint64_t virtual_tick_to_order_p50_ns = 0
 Virtual tick-to-order: engine receipt of the triggering event (T0, virtual clock) to the order's arrival at the simulated venue.
 
std::uint64_t virtual_tick_to_order_p99_ns = 0
 
std::uint64_t wall_tick_to_order_p50_ns = 0
 Measured wall clock per engine step that consumed market data (0 when not measured).
 
std::uint64_t wall_tick_to_order_p99_ns = 0
 
PnlDecomposition decomposition
 Where the net PnL came from, and how good the fills were. See markout.hpp.
 
FillQuality fill_quality
 
std::vector< MarkoutHorizon > markouts
 one entry per configured horizon, in order
 

Member Function Documentation

◆ markout()

const MarkoutHorizon * fastmm::bt::Metrics::markout ( std::int64_t  horizon_ns) const
noexcept

The markout of one horizon, or nullptr when it was not measured.

Member Data Documentation

◆ net_pnl

double fastmm::bt::Metrics::net_pnl = 0.0

PnL in quote currency at the last bar: net == realized + unrealized - fees.

◆ realized_pnl

double fastmm::bt::Metrics::realized_pnl = 0.0

◆ unrealized_pnl

double fastmm::bt::Metrics::unrealized_pnl = 0.0

◆ fees

double fastmm::bt::Metrics::fees = 0.0

◆ final_position

double fastmm::bt::Metrics::final_position = 0.0

base units, summed over instruments

◆ sharpe_bar

double fastmm::bt::Metrics::sharpe_bar = 0.0

mean / sample stdev of per-bar equity changes

◆ sharpe_annualized

double fastmm::bt::Metrics::sharpe_annualized = 0.0

sharpe_bar * sqrt(bars per 365-day year); NaN for runs shorter than kMinAnnualizedDurationS, where the scaling turns noise into four-digit values.

◆ max_drawdown

double fastmm::bt::Metrics::max_drawdown = 0.0

largest fall of equity from its peak, quote currency, >= 0

◆ max_drawdown_pct

double fastmm::bt::Metrics::max_drawdown_pct = 0.0

max_drawdown / initial_capital; NaN when initial_capital <= 0.

◆ fills

std::uint64_t fastmm::bt::Metrics::fills = 0

◆ maker_fills

std::uint64_t fastmm::bt::Metrics::maker_fills = 0

◆ taker_fills

std::uint64_t fastmm::bt::Metrics::taker_fills = 0

◆ orders

std::uint64_t fastmm::bt::Metrics::orders = 0

new orders sent

◆ cancels

std::uint64_t fastmm::bt::Metrics::cancels = 0

◆ replaces

std::uint64_t fastmm::bt::Metrics::replaces = 0

◆ rejects

std::uint64_t fastmm::bt::Metrics::rejects = 0

◆ fill_ratio

double fastmm::bt::Metrics::fill_ratio = 0.0

fills / new orders

◆ spread_captured_bps

double fastmm::bt::Metrics::spread_captured_bps = 0.0

mean of (mid - px) / mid for buys, (px - mid) / mid sells

◆ volume_base

double fastmm::bt::Metrics::volume_base = 0.0

◆ volume_quote

double fastmm::bt::Metrics::volume_quote = 0.0

◆ inventory_mean

double fastmm::bt::Metrics::inventory_mean = 0.0

over bars

◆ inventory_abs_mean

double fastmm::bt::Metrics::inventory_abs_mean = 0.0

over bars

◆ inventory_max

double fastmm::bt::Metrics::inventory_max = 0.0

max |position| over bars

◆ quote_uptime

double fastmm::bt::Metrics::quote_uptime = 0.0

fraction of bars with both a bid and an ask resting

◆ bars

std::uint64_t fastmm::bt::Metrics::bars = 0

◆ duration_s

double fastmm::bt::Metrics::duration_s = 0.0

◆ virtual_tick_to_order_p50_ns

std::uint64_t fastmm::bt::Metrics::virtual_tick_to_order_p50_ns = 0

Virtual tick-to-order: engine receipt of the triggering event (T0, virtual clock) to the order's arrival at the simulated venue.

Deterministic; includes the order latency model.

◆ virtual_tick_to_order_p99_ns

std::uint64_t fastmm::bt::Metrics::virtual_tick_to_order_p99_ns = 0

◆ wall_tick_to_order_p50_ns

std::uint64_t fastmm::bt::Metrics::wall_tick_to_order_p50_ns = 0

Measured wall clock per engine step that consumed market data (0 when not measured).

◆ wall_tick_to_order_p99_ns

std::uint64_t fastmm::bt::Metrics::wall_tick_to_order_p99_ns = 0

◆ decomposition

PnlDecomposition fastmm::bt::Metrics::decomposition

Where the net PnL came from, and how good the fills were. See markout.hpp.

◆ fill_quality

FillQuality fastmm::bt::Metrics::fill_quality

◆ markouts

std::vector<MarkoutHorizon> fastmm::bt::Metrics::markouts

one entry per configured horizon, in order