pub struct RiskEngine { /* private fields */ }Expand description
Risk engine for pre-trade validation
Implementations§
Source§impl RiskEngine
impl RiskEngine
pub fn new(limits: RiskLimits) -> Self
pub fn check_order( &self, instrument: &str, side: Side, quantity: Quantity, order_id: OrderId, ) -> Result<()>
pub fn update_position(&self, instrument: &str, side: Side, quantity: Quantity)
pub fn remove_order(&self, order_id: OrderId)
Sourcepub fn get_position(&self, instrument: &str) -> i64
pub fn get_position(&self, instrument: &str) -> i64
Get current position for an instrument
Sourcepub fn positions(&self) -> &DashMap<String, Position>
pub fn positions(&self) -> &DashMap<String, Position>
Get all positions (for exposure calculation)
Sourcepub fn open_orders(&self) -> &DashMap<OrderId, Quantity>
pub fn open_orders(&self) -> &DashMap<OrderId, Quantity>
Get open orders (for exposure calculation)
Sourcepub fn limits(&self) -> &Arc<RiskLimits>
pub fn limits(&self) -> &Arc<RiskLimits>
Get risk limits
Auto Trait Implementations§
impl Freeze for RiskEngine
impl !RefUnwindSafe for RiskEngine
impl Send for RiskEngine
impl Sync for RiskEngine
impl Unpin for RiskEngine
impl UnwindSafe for RiskEngine
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