| | |
| | | for (auto& i : m) { |
| | | if (i->type == json::ADDED) { |
| | | json::AddedMessage* j = (json::AddedMessage*) i; |
| | | if (j->owner == "nseow") { |
| | | if (j->owner == "jgrunbau") { |
| | | book::OrderSideEnum s = j->side == book::Buy ? book::Sell : book::Buy; |
| | | json::AddMessage a(json::ADD, j->product, j->price, s, j->resting); |
| | | auto b = protocol::addOrder(a); |
| | | if (b->type == json::ADDED) { |
| | | if (b->type == json::ADDED && ((json::AddedMessage*) b)->resting > 0) { |
| | | json::DeleteMessage d(json::DELETE, j->product, ((json::AddedMessage*) b)->id); |
| | | delete protocol::deleteOrder(d); |
| | | } |
| | | if (b->type == json::ADDED) { |
| | | std::cout << "Hit " << j->owner << " for " << ((json::AddedMessage*) b)->filled << ", resting " << ((json::AddedMessage*) b)->resting << std::endl; |
| | | } |
| | | delete b; |
| | | } |
| | | } |