FastMM documentation
FastMM C++ API 0.14.0
Public headers, tier 1 and tier 2
Loading...
Searching...
No Matches
ab_report.hpp File Reference

The readout of an [ab] test (fastmm-data ab), from the journals of the live sessions or backtests that ran it. More...

#include "fastmm/backtest/markout.hpp"
#include <cstddef>
#include <cstdint>
#include <span>
#include <string>
#include <vector>

Go to the source code of this file.

Classes

struct  fastmm::bt::AbReportOptions
 
struct  fastmm::bt::AbHorizon
 
struct  fastmm::bt::AbCell
 One instrument in one arm over one block (the whole test with assignment = "instrument"). More...
 
struct  fastmm::bt::AbArmSummary
 
struct  fastmm::bt::AbEffect
 One arm against arm 0 on one metric. More...
 
struct  fastmm::bt::AbReport
 

Namespaces

namespace  fastmm
 
namespace  fastmm::bt
 

Functions

AbReport fastmm::bt::ab_report (std::span< const std::string > journals, const AbReportOptions &opt)
 Throws std::runtime_error when a journal cannot be read, has no [ab] in its configuration, or the journals ran different tests.
 
void fastmm::bt::add_noise_floor (AbReport &r, const AbReport &aa)
 Puts aa's interval half-widths next to the matching effects of r (by metric).
 
std::string fastmm::bt::format_ab_report (const AbReport &r)
 
std::string fastmm::bt::ab_report_json (const AbReport &r)
 
std::string fastmm::bt::ab_cells_csv (const AbReport &r)
 One row per cell.
 

Detailed Description

The readout of an [ab] test (fastmm-data ab), from the journals of the live sessions or backtests that ran it.

A journal carries everything it needs: the configuration with [ab] (the arms and the design, rebuilt as an AbPlan), the arm updates (ParamUpdate, Origin::Experiment), the arm of each order sent (OutNewOrder, OutReplace) and the BookTicker mids the fills are marked against.

Each instrument's time is cut into cells: one arm over one block (time, crossover) or over the whole test (instrument). A fill belongs to the cell of its order's arm at its time; a fill that came after its instrument changed arm goes to the last block of the arm it was sent under. Per cell: the time, the fills, the traded notional and, at each horizon, the markout, the fees the configuration charges ([venues.<x>.fees], [[instruments]] maker_bps / taker_bps) less any extra maker rebate, and their net, over the fills marked at that horizon.

The comparison pairs the arms where the design makes them comparable: the instruments of one stratum (instrument), or one instrument over one run of blocks that gives each arm one block (time, crossover). A pair counts when it has time in every arm. Each arm is compared with arm 0 on the net, notional and fills per instrument-hour (each arm's total over its time in the pairs, so a pair cut short at the test's start or stop weighs by the time it has) and on net bps (its net over its notional in the pairs); the 95% interval comes from resampling clusters of pairs (the strata, or the runs of blocks), which keeps what one market moment does to every instrument inside one draw. An A/A test's intervals, run the same way, are its noise floor.