Fix equality comparison between mbo price levels
This commit is contained in:
1 parent
96572539a7
commit
dd049374d7
2 files changed
+5
-3
No files matched your search
@@ -105,7 +105,7 @@ namespace mbts.spark {
|
||||
var tickLength = large ? 6.0 : 3.0;
|
||||
dc.DrawLine(pen, new Point(x, baseline), new Point(x, baseline + tickLength));
|
||||
|
||||
if (x + smallTick > _dp.size.Width) {
|
||||
if (x + smallTick >= _dp.size.Width) {
|
||||
// last tick mark
|
||||
var size = (int)(x / _dp.scale);
|
||||
var text = TextUtils.GetFormattedText(size.ToString(), 9.0);
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "lib/api/services/OrderService.client.pb.h"
|
||||
#include "lib/utils/Dispatcher.h"
|
||||
#include "lib/utils/TimeStamp.h"
|
||||
#include "lib/domain_model/Security.h"
|
||||
#include "MDClient.h"
|
||||
#include "ExchangeOrderKey.h"
|
||||
#include "MBOProcessor.h"
|
||||
@@ -308,13 +309,14 @@ void MBOServiceServer::get_orders_for_security(const MBOSecurityQuery& request,
|
||||
}
|
||||
|
||||
size_t count = 0;
|
||||
auto tick = handle.get_minimum_tick();
|
||||
if(handle.is_initialized()) {
|
||||
auto mbo = handle.get_mbo();
|
||||
if (mbo) {
|
||||
for (const auto& o : mbo->bids) {
|
||||
double price = o.price.price();
|
||||
bool isnan = os::is_nan(request.price_level());
|
||||
if (isnan || request.price_level() == price) {
|
||||
if (isnan || securities::test_price_equality(request.price_level(), price, tick)) {
|
||||
++count;
|
||||
if (request.limit() && count > request.limit()) break;
|
||||
auto* entry = response.add_orders();
|
||||
@@ -330,7 +332,7 @@ void MBOServiceServer::get_orders_for_security(const MBOSecurityQuery& request,
|
||||
for (const auto& o : mbo->asks) {
|
||||
double price = o.price.price();
|
||||
bool isnan = os::is_nan(request.price_level());
|
||||
if (isnan || request.price_level() == price) {
|
||||
if (isnan || securities::test_price_equality(request.price_level(), price, tick)) {
|
||||
++count;
|
||||
if (request.limit() && count > request.limit()) break;
|
||||
auto* entry = response.add_orders();
|
||||
|
||||
Reference in new issue
Block a user