|
FastMM C++ API 0.6.0
Public headers, tier 1 and tier 2
|
#include <fastmm/testing/strategy_harness.hpp>
Public Types | |
| using | EngineType = Engine< S, SimClock, SimTransport, InlineFeed > |
Public Member Functions | |
| StrategyHarness (const ParamMap ¶ms={}, const HarnessOptions &options={}) | |
Configures the strategy with params (std::invalid_argument on a bad value), then warms up and starts the engine (on_start runs here). | |
| void | book (Price bid, Price ask, Qty size=Qty::from_int(1), InstrumentId id=InstrumentId{0}) |
| A one-level snapshot each side. | |
| void | book (std::string_view bid, std::string_view ask, InstrumentId id=InstrumentId{0}) |
| void | trade (Price px, Qty qty, Side aggressor, InstrumentId id=InstrumentId{0}) |
| bool | fill (Side side, Qty qty=Qty{}, InstrumentId id=InstrumentId{0}) |
Fills our best working order on side (quantity 0: its whole remainder) with a taker order at the venue, then advances by the ack latency so the fill reaches the strategy. | |
| std::vector< Order > | working_orders (InstrumentId id=InstrumentId{0}) const |
| Our working orders (Live or PartiallyFilled): bids best first, then asks best first. | |
| void | disconnect (std::uint8_t channel=0, VenueId v=VenueId{0}) |
| Channel 0 is market data (the engine clears the venue's books), 1 is order entry. | |
| void | reconnect (std::uint8_t channel=0, VenueId v=VenueId{0}) |
| void | pull_quotes () |
| void | resume_quotes () |
| void | publish (const std::vector< ParamPublisher::ParamValue > &values) |
A ParamUpdate of values (names and values as in [strategy.params]) for all instruments, at the current time: the strategy's parameters change and on_params runs. | |
| void | push (EventHeader &h) |
| Any other message, delivered to the engine at the current time. | |
| void | advance (Duration d) |
Moves virtual time forward by d, delivering orders to the venue, acks and fills to the engine and firing timers in time order. | |
| Timestamp | now () const noexcept |
| EngineType & | engine () noexcept |
| S & | strategy () noexcept |
| SimTransport & | venue_transport () noexcept |
Static Public Member Functions | |
| static InstrumentId | instrument () noexcept |
| static Price | price (std::string_view s) |
| static Qty | quantity (std::string_view s) |
| using fastmm::sim::StrategyHarness< S >::EngineType = Engine<S, SimClock, SimTransport, InlineFeed> |
|
inlineexplicit |
Configures the strategy with params (std::invalid_argument on a bad value), then warms up and starts the engine (on_start runs here).
|
inline |
A one-level snapshot each side.
|
inline |
|
inline |
|
inline |
Fills our best working order on side (quantity 0: its whole remainder) with a taker order at the venue, then advances by the ack latency so the fill reaches the strategy.
False when there is no working order on that side.
|
inline |
Our working orders (Live or PartiallyFilled): bids best first, then asks best first.
|
inline |
Channel 0 is market data (the engine clears the venue's books), 1 is order entry.
|
inline |
|
inline |
|
inline |
|
inline |
A ParamUpdate of values (names and values as in [strategy.params]) for all instruments, at the current time: the strategy's parameters change and on_params runs.
Validated against the strategy's current parameters; std::invalid_argument when a publisher would reject it.
|
inline |
Any other message, delivered to the engine at the current time.
|
inline |
Moves virtual time forward by d, delivering orders to the venue, acks and fills to the engine and firing timers in time order.
< the wheel fires on its next tick
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinestaticnoexcept |
|
inlinestatic |
|
inlinestatic |