30{
31 try
32 {
33
35
36 const Settings settings{cfg.settingsFile()};
38
39 const auto connectBus = [&client]{ client.
connectBus(); };
41 const auto connectBgw = [&client]{ client.
connectBgw(); };
42 const auto traderLogon = [&client]{ client.
traderLogon(); };
43
45 {
"Print this message",
"Printing available options", [&menu]{ menu.
outputItems(); }},
46
47 {"Connect BUS session", "Connecting a BUS session", connectBus},
48 {"Request BGW credentials", "Requesting BGW credentials", requestBgwCredentials},
49 {
"Request instruments",
"Requesting SecurityDefinition data", [&client]{ client.
requestInstruments(); }},
50 {
"List known instruments",
"Listing instruments", [&client]{ client.
listInstruments(); }},
51 {
"Show instrument by provided symbol",
"Looking up the instrument",[&client]{ client.
lookupInstruments(); }},
52
53 {"Connect BGW session", "Connecting a BGW session", connectBgw},
54 {"Trader log on", "Logging trader on", traderLogon},
55 {
"Trader log out",
"Logging trader out", [&client]{ client.
traderLogout(); }},
56
57 {
"Send order",
"Sending order", [&client]{ client.
sendOrder(); }},
58 {
"Send cross order",
"Sending cross order", [&client]{ client.
sendOrderCross(); }},
59 {
"Cancel order",
"Cancelling order", [&client]{ client.
cancelOrder(); }},
60 {
"Replace order",
"Replacing order", [&client]{ client.
replaceOrder(); }},
61 {
"Mass cancel",
"Cancelling matching working orders", [&client]{ client.
sendMassCancel(); }},
62
63 {
"Show orders",
"Viewing orders and status", [&client]{ client.
showOrders(); }},
64 {
"Show active orders",
"Viewing active orders", [&client]{ client.
showActiveOrders(); }},
65
66
67 {
"Send RFQ",
"Sending quote", [&client]{ client.
sendQuote(); }},
68 {
"Send mass quote",
"Sending mass quote", [&client]{ client.
sendMassQuote(); }},
70
71 {
"Create strategy",
"Creating strategy", [&client]{ client.
createStrategy(); }},
72 {
"Create flex",
"Creating flexible instrument", [&client]{ client.
createFlex(); }},
73
74
75 {"*Get ready BGW session (shortcut)", "Preparing BGW session", {connectBus, requestBgwCredentials, connectBgw, traderLogon}},
76 {
"Exit",
"Closing connections and exiting", [&menu]{ menu.
stopRequest(); }}
77 };
78
80 }
81 catch (const std::exception& ex)
82 {
83 std::cerr << std::endl << "Error: " << ex.what() << "." << std::endl;
84 return 1;
85 }
86
87 return 0;
88}
void createStrategy()
Creates a strategy.
void traderLogout()
Logs the trader out from the BGW session.
void listInstruments()
Prints the list of instruments currently known to the client.
void requestBgwCredentials()
Requests BGW credentials (IpRequest) over the active BUS session.
void connectBus()
Commands.
void connectBgw()
Establishes a BGW session using previously obtained credentials.
void createFlex()
Creates a flexible instrument (flex).
void sendOrderCross()
Sends a cross order.
void sendMassCancel()
Submits a mass cancel request.
void replaceOrder()
Issues a replace for an existing live order.
void lookupInstruments()
Prints the list of instruments currently known to the client by the provided Symbol value.
void sendQuoteCancelRequest()
Cancels a previously submitted quote.
void cancelOrder()
Sends a cancel request for a specific order.
void sendOrder()
Sends a new order via BGW.
void sendMassQuote()
Sends a multiple quote request.
void showActiveOrders()
Displays active orders sent by this client session and their last-known statuses.
void showOrders()
Displays orders sent by this client session and their last-known statuses.
void sendQuote()
Sends a quote message.
void traderLogon()
Logs a trader into the connected BGW session.
void requestInstruments()
Submits a SecurityDefinitionRequest to fetch/refresh known instruments.