Skip to main content

SpreadPriceRounder

Trait SpreadPriceRounder 

Source
pub trait SpreadPriceRounder {
    // Required method
    fn round_prices(
        &self,
        raw_bid: f64,
        raw_ask: f64,
        precision: u8,
    ) -> (Price, Price);
}
Expand description

Rounder for spread bid/ask (e.g. tick scheme). When absent, raw prices are used with instrument precision.

Required Methods§

Source

fn round_prices( &self, raw_bid: f64, raw_ask: f64, precision: u8, ) -> (Price, Price)

Rounds raw bid/ask to valid prices (handles negative prices with mirroring when using tick scheme).

Implementors§