pub enum RiskRule {
AllowEntryIn(EntryFilter),
MaxPositionSize(f64),
MaxDrawdown(RiskType),
MaxIntradayLoss(RiskType),
MaxConsLossDays(u32),
MaxIntradayFilledOrders(u32),
}Expand description
A risk-management rule set by a strategy.risk.* call, applied to the broker.
Variants§
AllowEntryIn(EntryFilter)
Restrict entries to one direction (allow_entry_in).
MaxPositionSize(f64)
Cap the absolute position size in contracts (max_position_size).
MaxDrawdown(RiskType)
Halt the strategy once equity falls this far from its peak (max_drawdown).
MaxIntradayLoss(RiskType)
Halt for the rest of the day once equity falls this far from the day’s
peak (max_intraday_loss).
MaxConsLossDays(u32)
Halt after this many consecutive losing days (max_cons_loss_days).
MaxIntradayFilledOrders(u32)
Block new orders after this many fills in a day (max_intraday_filled_orders).
Trait Implementations§
impl Copy for RiskRule
impl StructuralPartialEq for RiskRule
Auto Trait Implementations§
impl Freeze for RiskRule
impl RefUnwindSafe for RiskRule
impl Send for RiskRule
impl Sync for RiskRule
impl Unpin for RiskRule
impl UnsafeUnpin for RiskRule
impl UnwindSafe for RiskRule
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