From 832abfb22430c24c602adda2fcbcaec20aeef0a6 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Sat, 12 Mar 2022 13:59:44 +0100 Subject: [PATCH] kraken: add '--enable-trade' --- src/kraken.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/kraken.cc b/src/kraken.cc index f57eea4..6adfd8f 100644 --- a/src/kraken.cc +++ b/src/kraken.cc @@ -5,12 +5,21 @@ #include "engine/engine.hh" #include "parse/parse.hh" -int main() { +int main(int argc, char** argv) { + auto cross_behaviour = kraken::engine::CrossBehaviour::REJECT; + + if (argc > 1) { + using namespace std::literals; + if (argv[1] == "--enable-trade"sv) { + cross_behaviour = kraken::engine::CrossBehaviour::MATCH; + } + } + auto const orders = kraken::parse::parse_orders(std::cin); auto listener = std::make_shared(); - auto engine = kraken::engine::Engine(listener); + auto engine = kraken::engine::Engine(listener, cross_behaviour); engine.process_orders(orders);