pub struct MicrostructureFeatures {
pub order_imbalance: f64,
pub trade_intensity: f64,
pub price_impact_coefficient: f64,
}Expand description
Market microstructure-derived features.
§Example
use fin_primitives::ml_features::MicrostructureFeatures;
let f = MicrostructureFeatures::compute(1000.0, 800.0, 50, 0.01, 100_000.0);
assert!(f.order_imbalance.abs() <= 1.0);Fields§
§order_imbalance: f64Order imbalance: (bid_vol - ask_vol) / (bid_vol + ask_vol) in [-1, 1].
trade_intensity: f64Trade intensity: number of trades per unit time (trades/minute equivalent).
price_impact_coefficient: f64Price impact coefficient: |Δprice| / dollar_volume (Kyle’s λ proxy).
Implementations§
Source§impl MicrostructureFeatures
impl MicrostructureFeatures
Sourcepub fn compute(
bid_volume: f64,
ask_volume: f64,
trade_count: u64,
price_move: f64,
dollar_volume: f64,
) -> Self
pub fn compute( bid_volume: f64, ask_volume: f64, trade_count: u64, price_move: f64, dollar_volume: f64, ) -> Self
Compute microstructure features.
bid_volume,ask_volume: cumulative bid/ask volumes at top of book.trade_count: number of trades in the observation window.price_move: absolute price change over the window.dollar_volume: total dollar volume traded over the window.
Trait Implementations§
Source§impl Clone for MicrostructureFeatures
impl Clone for MicrostructureFeatures
impl Copy for MicrostructureFeatures
Auto Trait Implementations§
impl Freeze for MicrostructureFeatures
impl RefUnwindSafe for MicrostructureFeatures
impl Send for MicrostructureFeatures
impl Sync for MicrostructureFeatures
impl Unpin for MicrostructureFeatures
impl UnsafeUnpin for MicrostructureFeatures
impl UnwindSafe for MicrostructureFeatures
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more