Function calculate_ofi

Source
pub fn calculate_ofi(
    prev_book: &OrderBookSnapshot,
    curr_book: &OrderBookSnapshot,
) -> f64
Expand description

Calculate basic Order Flow Imbalance (OFI)

OFI measures the net order flow at the best bid/ask level between two snapshots. Positive values indicate buying pressure, negative values indicate selling pressure.