-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.cpp
52 lines (47 loc) · 1.16 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include "fix_application.h"
// -- FIX Example --
//
// Upon starting this application, a FIX session will be created and the connection
// sequence will commence. This includes sending a Logon message, a request for
// TradingSessionStatus, and a request to get accounts (CollateralInquiry). After
// the responses to these requests are received, you can use the command prompt
// to test out the functionality seen below in the switch block.
//
// --
int main()
{
FixApplication app;
// Start session and Logon
app.StartSession();
while(true){
int command = 0;
bool exit = false;
cin >> command;
switch(command){
case 0: // Exit example application
exit = true;
break;
case 1: // Get positions
app.GetPositions();
break;
case 2: // Subscribe to market data
app.SubscribeMarketData("EUR/USD");
app.SubscribeMarketData("EUR/JPY");
app.SubscribeMarketData("EUR/GBP");
break;
case 3: // Unsubscribe to market data
app.UnsubscribeMarketData();
break;
case 4: // Send market order
app.MarketOrder();
break;
}
if(exit)
break;
}
// End session and logout
app.EndSession();
//while(true){
//} // Wait
return 0;
}