Skip to content

Commit

Permalink
MOD: Modify display of definition fields in C++
Browse files Browse the repository at this point in the history
  • Loading branch information
threecgreen committed Apr 17, 2024
1 parent 5ac56ba commit bde3e96
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.18.0 - TBD

### Breaking changes
- Changed format of `display_factor` and `price_ratio` to a fixed-precision decimal for
`InstrumentDefMsg` and `InstrumentDefMsgV1` to match existing values and DBN crate
- Changed format of `unit_of_measure_qty` to a fixed-precision decimal for
`InstrumentDefMsgV1` to match `InstrumentDefMsg`

## 0.17.1 - 2024-04-08

### Enhancements
Expand Down
6 changes: 3 additions & 3 deletions src/compat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,18 +205,18 @@ std::ostream& operator<<(std::ostream& stream,
.AddField("hd", instr_def_msg.hd)
.AddField("ts_recv", instr_def_msg.ts_recv)
.AddField("min_price_increment", FixPx{instr_def_msg.min_price_increment})
.AddField("display_factor", instr_def_msg.display_factor)
.AddField("display_factor", FixPx{instr_def_msg.display_factor})
.AddField("expiration", instr_def_msg.expiration)
.AddField("activation", instr_def_msg.activation)
.AddField("high_limit_price", FixPx{instr_def_msg.high_limit_price})
.AddField("low_limit_price", FixPx{instr_def_msg.low_limit_price})
.AddField("max_price_variation", FixPx{instr_def_msg.max_price_variation})
.AddField("trading_reference_price",
FixPx{instr_def_msg.trading_reference_price})
.AddField("unit_of_measure_qty", instr_def_msg.unit_of_measure_qty)
.AddField("unit_of_measure_qty", FixPx{instr_def_msg.unit_of_measure_qty})
.AddField("min_price_increment_amount",
FixPx{instr_def_msg.min_price_increment_amount})
.AddField("price_ratio", instr_def_msg.price_ratio)
.AddField("price_ratio", FixPx{instr_def_msg.price_ratio})
.AddField("inst_attrib_value", instr_def_msg.inst_attrib_value)
.AddField("underlying_id", instr_def_msg.underlying_id)
.AddField("raw_instrument_id", instr_def_msg.raw_instrument_id)
Expand Down
4 changes: 2 additions & 2 deletions src/record.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ std::ostream& operator<<(std::ostream& stream,
.AddField("hd", instr_def_msg.hd)
.AddField("ts_recv", instr_def_msg.ts_recv)
.AddField("min_price_increment", FixPx{instr_def_msg.min_price_increment})
.AddField("display_factor", instr_def_msg.display_factor)
.AddField("display_factor", FixPx{instr_def_msg.display_factor})
.AddField("expiration", instr_def_msg.expiration)
.AddField("activation", instr_def_msg.activation)
.AddField("high_limit_price", FixPx{instr_def_msg.high_limit_price})
Expand All @@ -393,7 +393,7 @@ std::ostream& operator<<(std::ostream& stream,
.AddField("unit_of_measure_qty", FixPx{instr_def_msg.unit_of_measure_qty})
.AddField("min_price_increment_amount",
FixPx{instr_def_msg.min_price_increment_amount})
.AddField("price_ratio", instr_def_msg.price_ratio)
.AddField("price_ratio", FixPx{instr_def_msg.price_ratio})
.AddField("strike_price", FixPx{instr_def_msg.strike_price})
.AddField("inst_attrib_value", instr_def_msg.inst_attrib_value)
.AddField("underlying_id", instr_def_msg.underlying_id)
Expand Down
4 changes: 2 additions & 2 deletions test/src/record_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ TEST(RecordTests, TestInstrumentDefMsgToString) {
hd = RecordHeader { length = 100, rtype = InstrumentDef, publisher_id = 1, instrument_id = 1, ts_event = 1970-01-01T00:00:00.000000000Z },
ts_recv = 1970-01-01T00:00:00.000000000Z,
min_price_increment = 0.000000001,
display_factor = 2,
display_factor = 0.000000002,
expiration = 1970-01-01T00:00:00.000000000Z,
activation = 1970-01-01T00:00:00.000000000Z,
high_limit_price = 0.000000005,
Expand All @@ -159,7 +159,7 @@ TEST(RecordTests, TestInstrumentDefMsgToString) {
trading_reference_price = 0.000000008,
unit_of_measure_qty = 0.000000009,
min_price_increment_amount = 0.000000010,
price_ratio = 11,
price_ratio = 0.000000011,
strike_price = kUndefPrice,
inst_attrib_value = 12,
underlying_id = 13,
Expand Down

0 comments on commit bde3e96

Please sign in to comment.