29int main(
int argc,
char * argv[])
36 const Settings settings{cfg.settingsFile()};
39 const auto connectBus = [&client]{ client.
connectBus(); };
41 const auto connectBgw = [&client]{ client.
connectBgw(); };
42 const auto traderLogon = [&client]{ client.
traderLogon(); };
45 {
"Print this message",
"Printing available options", [&menu]{ menu.
outputItems(); }},
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(); }},
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(); }},
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(); }},
63 {
"Show orders",
"Viewing orders and status", [&client]{ client.
showOrders(); }},
64 {
"Show active orders",
"Viewing active orders", [&client]{ client.
showActiveOrders(); }},
67 {
"Send RFQ",
"Sending quote", [&client]{ client.
sendQuote(); }},
68 {
"Send mass quote",
"Sending mass quote", [&client]{ client.
sendMassQuote(); }},
71 {
"Create strategy",
"Creating strategy", [&client]{ client.
createStrategy(); }},
72 {
"Create flex",
"Creating flexible instrument", [&client]{ client.
createFlex(); }},
75 {
"*Get ready BGW session (shortcut)",
"Preparing BGW session", {connectBus, requestBgwCredentials, connectBgw, traderLogon}},
76 {
"Exit",
"Closing connections and exiting", [&menu]{ menu.
stopRequest(); }}
81 catch (
const std::exception& ex)
83 std::cerr << std::endl <<
"Error: " << ex.what() <<
"." << std::endl;
int main(int argc, char *argv[])