-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBidAskQueue.hpp
36 lines (33 loc) · 1.25 KB
/
BidAskQueue.hpp
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
#ifndef BID_ASK_QUEUE_HPP
#define BID_ASK_QUEUE_HPP
#include <queue>
#include "FixParser.hpp"
#include <algorithm>
#include <functional>
#include <cmath>
#include <chrono>
namespace MARKET{
class BidAskQueue{
// std::priority_queue<FIX::order, std::vector<FIX::order>,
// compareFixPriceGreater> bidQueue;
// std::priority_queue<FIX::order, std::vector<FIX::order>,
// compareFixPriceSmaller> askQueue;
public:
BidAskQueue();
std::deque<FIX::order> bidQueue;
std::deque<FIX::order> askQueue;
std::deque<FIX::order> clientOrders;
void insertBid(const FIX::order & ord);
void insertAsk(const FIX::order & ord);
void clearBid();
void clearAsk();
FIX::order popBid();
FIX::order popAsk();
bool fillOrders(std::vector<FIX::ACK> & filledOrders);
bool cancelOrder(const FIX::order & cancelRequest, std::vector<FIX::ACK> cancelledOrders);
// bool tryFillAggressiveOrder(FIX::order & ord, std::vector<FIX::ACK> & filledOrders);
bool tryFill3MinsOrder(std::vector<FIX::ACK> & filledOrders);
void addingQuotesIntoQueues(const std::string & updt);
};
};
#endif