convert_contract_quantity

Function convert_contract_quantity 

Source
pub fn convert_contract_quantity(
    value: Option<f64>,
    contract_decimal: Decimal,
    max_scale: u32,
    field_name: &str,
) -> Result<Option<Quantity>>
Expand description

Converts an optional contract-count field (e.g. lotSize, maxOrderQty) into a Nautilus quantity using the previously derived contract size.

ยงErrors

Returns an error when the raw value cannot be represented with the available precision.