pub enum RiskPolicy {
MaxOpenPositions {
limit: usize,
},
MaxOpenPerSymbol {
limit: usize,
},
GroupRiskCap {
group: String,
max_group_risk: f64,
},
DailyLossHalt {
max_loss: LossLimit,
reset_at_utc: NaiveTime,
},
KillSwitch {
max_drawdown_percent: f64,
action: HaltAction,
},
}Expand description
One portfolio rule.
Risk figures are account-currency amounts lost if a position’s protective stop fills: what a monetary sizing policy requests before a fill and what the position’s initial risk reports after it.
Variants§
MaxOpenPositions
At most limit positions open or pending at once, counting approved entries that have not reached the market yet.
MaxOpenPerSymbol
At most limit positions open or pending per symbol, counted the same way.
GroupRiskCap
The positions in group together may carry at most max_group_risk of risk; an entry that would exceed it is rejected.
DailyLossHalt
After the day’s realized loss reaches max_loss, new exposure is rejected until the next reset_at_utc.
KillSwitch
Once equity falls max_drawdown_percent percent below its peak, new exposure is rejected for the rest of the run, and HaltAndCloseAll also closes everything.