diff --git a/src/client/spark_core/Co2/MDConsumerHandle.cs b/src/client/spark_core/Co2/MDConsumerHandle.cs index 689eb0005..02f262bd7 100644 --- a/src/client/spark_core/Co2/MDConsumerHandle.cs +++ b/src/client/spark_core/Co2/MDConsumerHandle.cs @@ -232,7 +232,7 @@ namespace mbts.co2 public readonly UInt16 sequence; } - [StructLayout(LayoutKind.Sequential, Size = 432)] + [StructLayout(LayoutKind.Sequential, Size = 440)] internal struct ColdEntry { public int exchange_status; diff --git a/src/lib/md/Diag/ShmDumper.cpp b/src/lib/md/Diag/ShmDumper.cpp index adbd54a27..d17678aa4 100644 --- a/src/lib/md/Diag/ShmDumper.cpp +++ b/src/lib/md/Diag/ShmDumper.cpp @@ -80,6 +80,7 @@ string dump_security(const FixedSecurity& security) { res << "'price_break': " << security.price_break << ", "; res << "'low_tick': " << security.low_tick << ", "; res << "'high_tick': " << security.high_tick << ", "; + res << "'cpp': " << security.cash_per_point << ", "; switch(security.type) { case SECURITYTYPE_STOCK: break; diff --git a/src/lib/md/Shm/FixedSecurity.cpp b/src/lib/md/Shm/FixedSecurity.cpp index 22021fafe..2c3fcbd14 100644 --- a/src/lib/md/Shm/FixedSecurity.cpp +++ b/src/lib/md/Shm/FixedSecurity.cpp @@ -133,11 +133,13 @@ void get_contract_spec(const FixedSecurity& source, api::ContractSpecification& spec.set_price_break(source.price_break); spec.set_low_tick(source.low_tick); spec.set_high_tick(source.high_tick); + spec.set_cash_per_point(source.cash_per_point); // Account for price multiplier spec.set_price_multiplier(pow10(source.display_factor)); spec.set_price_break(spec.price_break() * spec.price_multiplier()); spec.set_low_tick(spec.low_tick() * spec.price_multiplier()); spec.set_high_tick(spec.high_tick() * spec.price_multiplier()); + spec.set_cash_per_point(spec.cash_per_point() * spec.price_multiplier()); } Security convert_security(const FixedSecurity& security) { @@ -268,6 +270,7 @@ void convert_security(const Security& src, FixedSecurity& dest, bool set_securit dest.price_break = src.contract_spec().price_break() / src.contract_spec().price_multiplier(); dest.low_tick = src.contract_spec().low_tick() / src.contract_spec().price_multiplier(); dest.high_tick = src.contract_spec().high_tick() / src.contract_spec().price_multiplier(); + dest.cash_per_point = src.contract_spec().cash_per_point(); switch(securitytype_of(src)) { case SECURITYTYPE_FUTURE: { diff --git a/src/lib/md/Shm/FixedSecurity.h b/src/lib/md/Shm/FixedSecurity.h index b52f36657..d0258be42 100644 --- a/src/lib/md/Shm/FixedSecurity.h +++ b/src/lib/md/Shm/FixedSecurity.h @@ -51,6 +51,7 @@ public: double price_break; double low_tick; double high_tick; + double cash_per_point; private: char _symbol[16]; // CME defines this as a char[6] but I'm padding diff --git a/src/server/sparkd/md/platforms/mdp3_onixs/MDP3Listener.cpp b/src/server/sparkd/md/platforms/mdp3_onixs/MDP3Listener.cpp index 060135b2e..3248aec75 100644 --- a/src/server/sparkd/md/platforms/mdp3_onixs/MDP3Listener.cpp +++ b/src/server/sparkd/md/platforms/mdp3_onixs/MDP3Listener.cpp @@ -214,7 +214,11 @@ void MDP3Listener::onDefinition(onixs::Handler&, const onixs::Security& osec, co set_security_common(sec, fsec); fsec.price_break = 0; // low/high tick are stored non-premultiplied and multiplied in conversion to api::Secutity - fsec.low_tick = fsec.high_tick = double_of_price(sec.minPriceIncrement(), 0); + double min_tick = double_of_price(sec.minPriceIncrement(), 0); + fsec.low_tick = fsec.high_tick = min_tick; + onixs::PRICE min_tick_amount; + sec.minPriceIncrementAmount(min_tick_amount); + fsec.cash_per_point = double_of_price(min_tick_amount, 0) / min_tick; auto expiration = date_of_maturity(sec); fsec.expiration_year = expiration.year; fsec.expiration_month = expiration.month; @@ -247,13 +251,15 @@ void MDP3Listener::onDefinition(onixs::Handler&, const onixs::Security&, const o bts_assert(sec.strikePrice(strike_price)); fsec.strike = double_of_price(strike_price, fsec.display_factor); - onixs::PRICE min_tick; + onixs::PRICE min_tick, min_tick_amount; sec.minPriceIncrement(min_tick); + sec.minPriceIncrementAmount(min_tick_amount); int8_t tick_rule; if (sec.tickRule(tick_rule)) { decode_ticks(tick_rule, double_of_price(min_tick, 0), fsec); } + fsec.cash_per_point = double_of_price(min_tick_amount, 0) / fsec.low_tick; fsec.call_put = sec.putOrCall() == onixs::PutOrCall::Call ? api::PUTORCALL_CALL : api::PUTORCALL_PUT;