pub struct MarketImpact;Expand description
Market impact estimators: linear, square-root, and Almgren-Chriss.
Implementations§
Source§impl MarketImpact
impl MarketImpact
Sourcepub fn linear_impact(size: f64, volume: f64, impact_bps_per_pct: f64) -> f64
pub fn linear_impact(size: f64, volume: f64, impact_bps_per_pct: f64) -> f64
Linear market impact in USD.
impact = size / volume * impact_bps_per_pct / 10_000 * size
where size / volume is the participation rate in [0, 1].
Sourcepub fn sqrt_impact(size: f64, volume: f64, sigma: f64, eta: f64) -> f64
pub fn sqrt_impact(size: f64, volume: f64, sigma: f64, eta: f64) -> f64
Square-root market impact in USD.
impact = eta * sigma * sqrt(size / volume) * size
Sourcepub fn almgren_chriss(
size: f64,
volume: f64,
sigma: f64,
gamma: f64,
eta: f64,
) -> (f64, f64)
pub fn almgren_chriss( size: f64, volume: f64, sigma: f64, gamma: f64, eta: f64, ) -> (f64, f64)
Almgren-Chriss permanent and temporary market impact.
Returns (permanent_impact_usd, temporary_impact_usd).
- Permanent:
gamma * size— persistent price shift - Temporary:
eta * sigma * sqrt(size / volume) * size
Auto Trait Implementations§
impl Freeze for MarketImpact
impl RefUnwindSafe for MarketImpact
impl Send for MarketImpact
impl Sync for MarketImpact
impl Unpin for MarketImpact
impl UnsafeUnpin for MarketImpact
impl UnwindSafe for MarketImpact
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