SPARK-2197 Correction to PIQ calculation per taha (+test coverage)

This commit is contained in:
Eric Harding committed 2019-04-29 17:28:23 -04:00
1 parent 4279e3d388
commit 6066e2162c
3 files changed
+30 -3

No files matched your search

+3 -3
View File
@@ -148,14 +148,14 @@ std::optional<uint32_t> search_orders(const ExchangeOrderKey oid, const std::vec
const auto& oo = orders[x];
if (oo.id == oid) {
if (oo.price == price) return { position };
else return 0 ;
else return 0;
}
else if (price == oo.price) {
position += 1;
position += oo.size;
}
else {
price = oo.price;
position = 1;
position = oo.size;
}
}
return std::nullopt;