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

#include <fastmm/backtest/backtest_runner.hpp>

Public Member Functions

 BacktestSession (const BacktestConfig &cfg, MdSource *source, const ParamSchema *schema=nullptr, std::string_view strategy_meta={})
 schema: the strategy's parameters, recorded in cfg.journal_out (may be null).
 
 ~BacktestSession ()
 
 BacktestSession (const BacktestSession &)=delete
 
BacktestSession & operator= (const BacktestSession &)=delete
 
RunnerDeps & deps () noexcept
 
sim::SimBackend & backend () noexcept
 
void set_param_schedule (sim::ParamSchedule *schedule) noexcept
 Parameter updates delivered at simulated times during run() (not owned; may be null).
 
void set_slow_hooks (const sim::SlowHooks &hooks) noexcept
 Code run at simulated times during run() (sim::SimDriver::set_slow_hooks).
 
BacktestResult run (const sim::EngineHooks &hooks, IEngineRunner *runner, std::string_view strategy_name)
 Runs to the end of the data / horizon.
 

Constructor & Destructor Documentation

◆ BacktestSession() [1/2]

fastmm::bt::BacktestSession::BacktestSession ( const BacktestConfig &  cfg,
MdSource *  source,
const ParamSchema *  schema = nullptr,
std::string_view  strategy_meta = {} 
)

schema: the strategy's parameters, recorded in cfg.journal_out (may be null).

strategy_meta: key=value lines recorded in cfg.journal_out (Python strategies).

◆ ~BacktestSession()

fastmm::bt::BacktestSession::~BacktestSession ( )

◆ BacktestSession() [2/2]

fastmm::bt::BacktestSession::BacktestSession ( const BacktestSession &  )
delete

Member Function Documentation

◆ operator=()

BacktestSession & fastmm::bt::BacktestSession::operator= ( const BacktestSession &  )
delete

◆ deps()

RunnerDeps & fastmm::bt::BacktestSession::deps ( )
inlinenoexcept

◆ backend()

sim::SimBackend & fastmm::bt::BacktestSession::backend ( )
inlinenoexcept

◆ set_param_schedule()

void fastmm::bt::BacktestSession::set_param_schedule ( sim::ParamSchedule *  schedule)
inlinenoexcept

Parameter updates delivered at simulated times during run() (not owned; may be null).

◆ set_slow_hooks()

void fastmm::bt::BacktestSession::set_slow_hooks ( const sim::SlowHooks &  hooks)
inlinenoexcept

Code run at simulated times during run() (sim::SimDriver::set_slow_hooks).

◆ run()

BacktestResult fastmm::bt::BacktestSession::run ( const sim::EngineHooks &  hooks,
IEngineRunner *  runner,
std::string_view  strategy_name 
)

Runs to the end of the data / horizon.

runner (may be null) supplies engine stats and, with [strategy] state_file, the strategy's state to write at the end.