Merge branch 'spartan_tas' of bitbucket.org:bluetradesys/spark into spartan_tas

This commit is contained in:
Pedro Pinto committed 2020-10-08 11:48:12 -04:00
commit a062dbe321
2 files changed
+14

No files matched your search

@@ -86,6 +86,7 @@ FifoPriceLevelMatcher::_one_pass_cross_order(MDP3OrderKey cross_ord_key,
MDP3Quantity(filled),
_price
};
UtilFunctions::validate_update(passive_upd);
res->push_back(passive_upd);
OrderUpdate agg_upd =
{
@@ -98,6 +99,7 @@ FifoPriceLevelMatcher::_one_pass_cross_order(MDP3OrderKey cross_ord_key,
MDP3Quantity(filled),
_price
};
UtilFunctions::validate_update(agg_upd);
res->push_back(agg_upd);
}
if(_trace.log(o.key) || _trace.log(cross_ord_key))
@@ -3,6 +3,7 @@
// did not want to fwd decl everything specially
// the templated classes (will fix later)
#include "../../common/InstrumentSnapshot.h"
#include "../simulator/AlgoEvent.h"
namespace bts::spartan::mdp3 {
@@ -41,6 +42,17 @@ public:
}
};
class UtilFunctions{
public:
static void validate_update(const OrderUpdate& u){
if (u.status == OrderUpdate::Status::PARTIALLY_FILLED ||
u.status == OrderUpdate::Status::FILLED)
bts_assert(u.last_fills.value() > 0);
if (u.status == OrderUpdate::Status::CANCELED)
bts_assert(u.last_fills.value() == 0);
}
};
struct MatcherIB {
bool is_ib = false;
MDP3Quantity show_qty = MDP3Quantity(0);