pub struct RiskConfig {
pub max_position_size: f64,
pub max_total_exposure: f64,
pub max_drawdown_percent: f64,
pub max_daily_loss: f64,
pub position_limits: HashMap<String, f64>,
}Expand description
Risk management configuration.
Defines limits and constraints to protect trading capital.
Fields§
§max_position_size: f64Maximum position size per trade Env: VELORA_RISK_MAX_POSITION_SIZE
max_total_exposure: f64Maximum total exposure across all positions Env: VELORA_RISK_MAX_TOTAL_EXPOSURE
max_drawdown_percent: f64Maximum drawdown percentage before stopping Env: VELORA_RISK_MAX_DRAWDOWN_PERCENT
max_daily_loss: f64Maximum daily loss before stopping Env: VELORA_RISK_MAX_DAILY_LOSS
position_limits: HashMap<String, f64>Per-symbol position limits (prefer config file)
Example:
[risk.position_limits]
"BTC/USDT" = 5000.0
"ETH/USDT" = 2000.0Trait Implementations§
Source§impl Clone for RiskConfig
impl Clone for RiskConfig
Source§impl Debug for RiskConfig
impl Debug for RiskConfig
Source§impl Default for RiskConfig
impl Default for RiskConfig
Source§impl<'de> Deserialize<'de> for RiskConfig
impl<'de> Deserialize<'de> for RiskConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for RiskConfig
impl RefUnwindSafe for RiskConfig
impl Send for RiskConfig
impl Sync for RiskConfig
impl Unpin for RiskConfig
impl UnsafeUnpin for RiskConfig
impl UnwindSafe for RiskConfig
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