Function trailing_stop_calculate_with_last

Source
pub fn trailing_stop_calculate_with_last(
    price_increment: Price,
    trailing_offset_type: TrailingOffsetType,
    side: OrderSideSpecified,
    offset: Decimal,
    last: Price,
) -> Result<Price>
Expand description

Calculates the trailing stop price using the last traded price.

§Errors

Returns an error if the offset calculation fails or the offset type is unsupported.

§Panics

Panics if the offset cannot be converted to a float.