Skip to content

Commit

Permalink
Fix multiplier and lot_size for pyo3 instrument conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
cjdsellers committed Nov 29, 2024
1 parent 48c4da8 commit 2b5c285
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions nautilus_trader/model/instruments/futures_contract.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,8 @@ cdef class FuturesContract(Instrument):
currency=Currency.from_str_c(pyo3_instrument.currency.code),
price_precision=pyo3_instrument.price_precision,
price_increment=Price.from_raw_c(pyo3_instrument.price_increment.raw, pyo3_instrument.price_precision),
multiplier=Quantity.from_raw_c(pyo3_instrument.multiplier.raw, 0),
lot_size=Quantity.from_raw_c(pyo3_instrument.lot_size.raw, 0),
multiplier=Quantity.from_raw_c(pyo3_instrument.multiplier.raw, pyo3_instrument.multiplier.precision),
lot_size=Quantity.from_raw_c(pyo3_instrument.lot_size.raw, pyo3_instrument.lot_size.precision),
underlying=pyo3_instrument.underlying,
activation_ns=pyo3_instrument.activation_ns,
expiration_ns=pyo3_instrument.expiration_ns,
Expand Down
4 changes: 2 additions & 2 deletions nautilus_trader/model/instruments/futures_spread.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,8 @@ cdef class FuturesSpread(Instrument):
currency=Currency.from_str_c(pyo3_instrument.currency.code),
price_precision=pyo3_instrument.price_precision,
price_increment=Price.from_raw_c(pyo3_instrument.price_increment.raw, pyo3_instrument.price_precision),
multiplier=Quantity.from_raw_c(pyo3_instrument.multiplier.raw, 0),
lot_size=Quantity.from_raw_c(pyo3_instrument.lot_size.raw, 0),
multiplier=Quantity.from_raw_c(pyo3_instrument.multiplier.raw, pyo3_instrument.multiplier.precision),
lot_size=Quantity.from_raw_c(pyo3_instrument.lot_size.raw, pyo3_instrument.lot_size.precision),
underlying=pyo3_instrument.underlying,
strategy_type=pyo3_instrument.strategy_type,
activation_ns=pyo3_instrument.activation_ns,
Expand Down
4 changes: 2 additions & 2 deletions nautilus_trader/model/instruments/options_contract.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,8 @@ cdef class OptionsContract(Instrument):
currency=Currency.from_str_c(pyo3_instrument.currency.code),
price_precision=pyo3_instrument.price_precision,
price_increment=Price.from_raw_c(pyo3_instrument.price_increment.raw, pyo3_instrument.price_precision),
multiplier=Quantity.from_raw_c(pyo3_instrument.multiplier.raw, 0),
lot_size=Quantity.from_raw_c(pyo3_instrument.lot_size.raw, 0),
multiplier=Quantity.from_raw_c(pyo3_instrument.multiplier.raw, pyo3_instrument.multiplier.precision),
lot_size=Quantity.from_raw_c(pyo3_instrument.lot_size.raw, pyo3_instrument.lot_size.precision),
underlying=pyo3_instrument.underlying,
option_kind=option_kind_from_str(str(pyo3_instrument.option_kind)),
activation_ns=pyo3_instrument.activation_ns,
Expand Down
4 changes: 2 additions & 2 deletions nautilus_trader/model/instruments/options_spread.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,8 @@ cdef class OptionsSpread(Instrument):
currency=Currency.from_str_c(pyo3_instrument.currency.code),
price_precision=pyo3_instrument.price_precision,
price_increment=Price.from_raw_c(pyo3_instrument.price_increment.raw, pyo3_instrument.price_precision),
multiplier=Quantity.from_raw_c(pyo3_instrument.multiplier.raw, 0),
lot_size=Quantity.from_raw_c(pyo3_instrument.lot_size.raw, 0),
multiplier=Quantity.from_raw_c(pyo3_instrument.multiplier.raw, pyo3_instrument.multiplier.precision),
lot_size=Quantity.from_raw_c(pyo3_instrument.lot_size.raw, pyo3_instrument.lot_size.precision),
underlying=pyo3_instrument.underlying,
strategy_type=pyo3_instrument.strategy_type,
activation_ns=pyo3_instrument.activation_ns,
Expand Down

0 comments on commit 2b5c285

Please sign in to comment.