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).
OrderbookSim
OrderType.hpp
Go to the documentation of this file.
1
9
#pragma once
10
#include <string>
11
18
enum class
OrderType
{
19
GoodTillCancel
,
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
}
orderTypeToString
std::string orderTypeToString(OrderType type)
Converts an OrderType to its corresponding string representation.
Definition:
OrderType.hpp:34
intToOrdertType
OrderType intToOrdertType(int type)
Converts an integer value to the corresponding OrderType.
Definition:
OrderType.hpp:54
OrderType
OrderType
Specifies the different types of orders that can be used in a trading system.
Definition:
OrderType.hpp:18
OrderType::Market
@ Market
OrderType::FillOrKill
@ FillOrKill
OrderType::GoodForDay
@ GoodForDay
OrderType::FillAndKill
@ FillAndKill
OrderType::GoodTillCancel
@ GoodTillCancel
Generated by
1.9.1