Slick Sim 0.10.1
Exchange simulator that shadows real venues for risk-free strategy testing
Loading...
Searching...
No Matches
slick::sim::engine::MatchingConfig Struct Reference

Which engine a venue's symbols match with. More...

#include <matching_engine/matching_config.hpp>

Collaboration diagram for slick::sim::engine::MatchingConfig:

Static Public Member Functions

static MatchingConfig from_json (const nlohmann::json &config)
 Reads matching_algorithm ("fifo" by default, or "pro_rata") and, for pro-rata, the pro_rata block: lot_size and min_allocation in venue units, fifo_percent 0-100.

Public Attributes

MatchingEngine::Type type = MatchingEngine::Type::FIFO
ProRataConfig pro_rata

Detailed Description

Which engine a venue's symbols match with.

Definition at line 25 of file matching_config.hpp.

Member Function Documentation

◆ from_json()

MatchingConfig MatchingConfig::from_json ( const nlohmann::json & config)
static

Reads matching_algorithm ("fifo" by default, or "pro_rata") and, for pro-rata, the pro_rata block: lot_size and min_allocation in venue units, fifo_percent 0-100.

Throws std::invalid_argument on anything else, a wrong JSON type included, since falling back to FIFO would silently change who gets filled.

Definition at line 60 of file matching_config.cpp.

References slick::sim::engine::ProRataConfig::fifo_percent, slick::sim::engine::ProRataConfig::lot_size, slick::sim::engine::ProRataConfig::min_allocation, pro_rata, slick::sim::engine::MatchingEngine::ProRata, type, and slick::sim::engine::ProRataConfig::validate().

Referenced by slick::sim::exch::Exchange::configureMatching().

Member Data Documentation

◆ pro_rata

ProRataConfig slick::sim::engine::MatchingConfig::pro_rata

Definition at line 27 of file matching_config.hpp.

Referenced by slick::sim::engine::createMatchingEngine(), and from_json().

◆ type

MatchingEngine::Type slick::sim::engine::MatchingConfig::type = MatchingEngine::Type::FIFO

Definition at line 26 of file matching_config.hpp.

Referenced by slick::sim::engine::createMatchingEngine(), and from_json().


The documentation for this struct was generated from the following files: