|
Special Relativity in Financial Modeling 1.0.0
Lorentz transforms, spacetime classification, and geodesic price paths for quantitative finance
|
#include <event_backtester.hpp>
Public Member Functions | |
| BacktestEngine (double initial_cash=100 '000.0, double commission=0.001) noexcept | |
| void | set_strategy (std::unique_ptr< Strategy > strat) noexcept |
| Set the strategy to drive order generation. | |
| void | add_event (BacktestEvent event) |
| Insert a market event into the priority queue. | |
| BacktestResult | run () |
| const std::vector< Fill > & | fills () const noexcept |
| Const accessor for the fill history. | |
| const Portfolio & | portfolio () const noexcept |
Const accessor for the portfolio state after run(). | |
Event-driven backtesting engine.
Events are inserted via add_event() and processed in strict timestamp order by run(). The engine simulates market fills, tracks a Portfolio, and returns a BacktestResult.
Usage:
Definition at line 179 of file event_backtester.hpp.
|
inlineexplicitnoexcept |
| initial_cash | Starting cash in quote currency. |
| commission | Commission fraction per trade notional. |
Definition at line 183 of file event_backtester.hpp.
|
inline |
Insert a market event into the priority queue.
Definition at line 197 of file event_backtester.hpp.
|
inlinenoexcept |
Const accessor for the fill history.
Definition at line 207 of file event_backtester.hpp.
|
inlinenoexcept |
Const accessor for the portfolio state after run().
Definition at line 210 of file event_backtester.hpp.
| BacktestResult srfm::event_bt::BacktestEngine::run | ( | ) |
Process all queued events and return aggregate performance.
Definition at line 94 of file event_backtester.cpp.
|
inlinenoexcept |
Set the strategy to drive order generation.
Definition at line 192 of file event_backtester.hpp.