Orderbook Simulation
OrderbookSim is a C++ application simulating a financial market order book. It efficiently manages and matches buy and sell orders while calculating the Volume-Weighted Average Price (VWAP).
OrderType.hpp
Go to the documentation of this file.
1 
9 #pragma once
10 #include <string>
11 
18 enum class OrderType {
20  FillAndKill,
21  Market,
22  GoodForDay,
23  FillOrKill
24 };
25 
34 inline std::string orderTypeToString(OrderType type) {
35  switch (type) {
36  case OrderType::GoodTillCancel: return "GoodTillCancel";
37  case OrderType::FillAndKill: return "FillAndKill";
38  case OrderType::Market: return "Market";
39  case OrderType::GoodForDay: return "GoodForDay";
40  case OrderType::FillOrKill: return "FillOrKill";
41  default: return "Unknown";
42  }
43 }
44 
54 inline OrderType intToOrdertType(int type) {
55  switch (type) {
56  case 1: return OrderType::GoodTillCancel;
57  case 2: return OrderType::FillAndKill;
58  case 3: return OrderType::Market;
59  case 4: return OrderType::GoodForDay;
60  case 5: return OrderType::FillOrKill;
61  default: return OrderType::GoodTillCancel;
62  }
63 }
std::string orderTypeToString(OrderType type)
Converts an OrderType to its corresponding string representation.
Definition: OrderType.hpp:34
OrderType intToOrdertType(int type)
Converts an integer value to the corresponding OrderType.
Definition: OrderType.hpp:54
OrderType
Specifies the different types of orders that can be used in a trading system.
Definition: OrderType.hpp:18