SPARK-1147 Add requited glbx fields to enable this work.
This commit is contained in:
1 parent
38f212e633
commit
d3f2ecc78e
5 files changed
+21
No files matched your search
@@ -55,6 +55,9 @@ message GLBXExchangeData {
|
||||
string security_desc = 20;
|
||||
string cfi_code = 21;
|
||||
string cme_symbol = 22;
|
||||
uint32 main_fraction = 30;
|
||||
uint32 sub_fraction = 31;
|
||||
uint32 price_display_format = 32;
|
||||
}
|
||||
message CBOEExchangeData {
|
||||
int64 exchange_id = 10;
|
||||
|
||||
@@ -71,6 +71,9 @@ string dump_security(const FixedSecurity& security) {
|
||||
res << "'display_factor': " << (int)security.display_factor << ", ";
|
||||
res << "'numeric_id': " << security.numeric_id << ", ";
|
||||
res << "'cboe_class_key': " << security.cboe_class_key << ", ";
|
||||
res << "'cme_main_frac': " << (int)security.cme_main_fraction << ", ";
|
||||
res << "'cme_sub_fract': " << (int)security.cme_sub_fraction << ", ";
|
||||
res << "'cme_price_dformat': " << (int)security.cme_price_display_format << ", ";
|
||||
|
||||
res << "'market_segment': " << security.cme_market_segment_id << ", ";
|
||||
|
||||
|
||||
@@ -157,6 +157,9 @@ void convert_security(const FixedSecurity& source, Security* presult) {
|
||||
dest.mutable_glbx()->set_security_desc(source.security_desc());
|
||||
dest.mutable_glbx()->set_cfi_code(source.cfi_code());
|
||||
dest.mutable_glbx()->set_cme_symbol(source.alt_symbol());
|
||||
if (source.cme_main_fraction != 0) dest.mutable_glbx()->set_main_fraction(source.cme_main_fraction);
|
||||
if (source.cme_sub_fraction != 0) dest.mutable_glbx()->set_sub_fraction(source.cme_sub_fraction);
|
||||
if (source.cme_price_display_format) dest.mutable_glbx()->set_price_display_format(source.cme_price_display_format);
|
||||
break;
|
||||
case Venue::VENUE_BTS:
|
||||
break;
|
||||
@@ -254,6 +257,9 @@ void convert_security(const Security& src, FixedSecurity& dest, bool set_securit
|
||||
dest.security_desc(src.glbx().security_desc());
|
||||
dest.cfi_code(src.glbx().cfi_code());
|
||||
dest.alt_symbol(src.glbx().cme_symbol());
|
||||
dest.cme_main_fraction = src.glbx().main_fraction();
|
||||
dest.cme_sub_fraction = src.glbx().sub_fraction();
|
||||
dest.cme_price_display_format = src.glbx().price_display_format();
|
||||
break;
|
||||
case Security::ExchangeDataCase::kCboe:
|
||||
dest.cboe_class_key = src.cboe().class_key();
|
||||
|
||||
@@ -54,6 +54,10 @@ public:
|
||||
double high_tick;
|
||||
double cash_per_point;
|
||||
|
||||
uint8_t cme_main_fraction;
|
||||
uint8_t cme_sub_fraction;
|
||||
uint8_t cme_price_display_format;
|
||||
|
||||
private:
|
||||
char _symbol[16]; // CME defines this as a char[6] but I'm padding
|
||||
char _cfi_code[8]; // CME defines this as char[6]
|
||||
|
||||
@@ -201,6 +201,10 @@ void set_security_common(const Definition& def, FixedSecurity& fsec) {
|
||||
// tickRule not present in futures
|
||||
fsec.cme_market_segment_id = def.marketSegmentId();
|
||||
fsec.display_factor = def.displayFactor().exponent() + floorlog10(def.displayFactor().mantissa());
|
||||
|
||||
def.mainFraction(fsec.cme_main_fraction);
|
||||
def.subFraction(fsec.cme_sub_fraction);
|
||||
def.priceDisplayFormat(fsec.cme_price_display_format);
|
||||
}
|
||||
|
||||
void MDP3Listener::onDefinition(onixs::Handler&, const onixs::Security& osec, const onixs::InstrumentDefinitionFutureArgs& def) {
|
||||
@@ -211,6 +215,7 @@ void MDP3Listener::onDefinition(onixs::Handler&, const onixs::Security& osec, co
|
||||
bts_assert(exchange_id == osec.id());
|
||||
|
||||
FixedFutureSecurity fsec;
|
||||
|
||||
set_security_common(sec, fsec);
|
||||
fsec.price_break = 0;
|
||||
// low/high tick are stored non-premultiplied and multiplied in conversion to api::Secutity
|
||||
|
||||
Reference in new issue
Block a user