Function trailing_stop_calculate

Source
pub fn trailing_stop_calculate(
    price_increment: Price,
    order: &OrderAny,
    bid: Option<Price>,
    ask: Option<Price>,
    last: Option<Price>,
) -> Result<(Option<Price>, Option<Price>)>
Expand description

Calculates the new trigger and limit prices for a trailing stop order.

§Errors

Returns an error if the order type or trigger type is invalid.

§Panics

Panics if trigger type or trailing offset type is unset.