SPARK-2060 NetChange in Ticks

This commit is contained in:
Eric Harding committed 2019-02-21 12:49:55 -05:00
1 parent 3094eee327
commit e7b371aa6f
2 files changed
+14 -2

No files matched your search

+5 -2
View File
@@ -257,9 +257,12 @@ TimeStamp copy_synthetic_depth(const SyntheticStrategy& synth, size_t count, Pri
// NET Change
if (leg_params.leg_md_calc() == spark::LegSpreaderParams::NET_CHANGE) {
auto settle = synth.legs[x].settlement_price();
double tick = synth.legs[x].get_minimum_tick();
for (size_t d = 0; d < COCONUT_MAX_DEPTH; ++d) {
bids[d] = bids[d] - settle;
asks[d] = asks[d] - settle;
auto b = (bids[d] - settle);
auto a = (asks[d] - settle);
bids[d] = { b.int_price() / tick, b.size() };
asks[d] = { a.int_price() / tick, a.size() };
}
}
+9
View File
@@ -197,6 +197,15 @@ public:
}
bts_assert(false);
}
double get_minimum_tick() const {
switch(_type) {
case HANDLETYPE_DEPTH: return book.cdata->security.low_tick * pow10(book.cdata->security.display_factor);
case HANDLETYPE_BBO: return bbo.cdata->security.low_tick * pow10(bbo.cdata->security.display_factor);
case HANDLETYPE_SYNTHETIC: return synthetic.def->security.contract_spec().low_tick();
default:
case HANDLETYPE_VOID: return os::nan();
}
}
TimeStamp last_market_update() const {
switch(_type) {