Skip to main content

settle_instrument_close

Function settle_instrument_close 

Source
pub fn settle_instrument_close(
    cache: &mut Cache,
    close: InstrumentClose,
) -> Result<Vec<(Position, Quantity)>>
Expand description

Settles every open position in the binary option named by a contract-expiration close.

The first contract-expiration close cached for the instrument is authoritative. A later close settles any position still open on the cached terms, and a conflicting price is logged. Returns a transient copy of each settled position, without stored history, with the quantity the settlement closed. The list is empty when close is not a contract expiration for a cached binary option. A position that cannot be settled is logged and skipped.

ยงErrors

Returns an error if caching the close fails.