Skip to main content

position_prices_match

Function position_prices_match 

Source
pub fn position_prices_match(
    cached_avg_px: Decimal,
    venue_avg_px: Decimal,
    tolerance: Option<Decimal>,
    venue_precision: Option<u8>,
) -> bool
Expand description

Compares average entry prices using relative tolerance (default 0.01%).

Average entry prices need not fall on instrument price ticks. A zero reported average cannot establish a relative comparison and returns false. When the venue rounds or truncates its average to venue_precision decimal places, the difference may also span one unit at that precision on top of the relative tolerance; a precision above 28 adds no allowance.