Update completed implementation

This commit is contained in:
Lev
2021-06-13 13:46:04 -05:00
parent 7a913d8d4b
commit d74223f92a
6 changed files with 36 additions and 11 deletions

View File

@ -133,7 +133,7 @@ std::vector<OrderBookEntry> OrderBook::matchAsksToBids(std::string product, std:
// if bid.price >= ask.price # we have a match
if (bid.price >= ask.price)
{
std::cout << "bid price is right " << std::endl;
//std::cout << "bid price is right " << std::endl;
OrderBookEntry sale{ask.price, 0, timestamp, product, OrderBookType::asksale};
OrderBookType type = OrderBookType::asksale;
if(bid.username == "simuser")
@ -183,7 +183,7 @@ std::vector<OrderBookEntry> OrderBook::matchAsksToBids(std::string product, std:
// if bid.amount < ask.amount # bid is completely gone, slice the ask
if (bid.amount < ask.amount)
if (bid.amount < ask.amount && bid.amount != 0)
{
// sale.amount = bid.amount
sale.amount = bid.amount;