Skip to main content

trailing_stop_calculate_with_bid_ask

Function trailing_stop_calculate_with_bid_ask 

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

Calculates the trailing stop price using bid and ask prices.

ยงErrors

Returns an error if the offset type is unsupported or the calculated price cannot be represented as a [Price].