Skip to main content

py_generic_spread_id_to_list

Function py_generic_spread_id_to_list 

Source
pub fn py_generic_spread_id_to_list(
    instrument_id: InstrumentId,
) -> PyResult<Vec<(InstrumentId, i64)>>
Expand description

Parses a generic spread instrument ID into (instrument_id, ratio) legs.

Returns the legs in the order they appear in the symbol, with a negative ratio for each ((ratio))symbol leg.

ยงErrors

Returns an error if instrument_id is not in the format new_generic_spread_id produces.