pub struct PortfolioRiskConfig {
pub max_daily_loss: f64,
pub max_concurrent_positions: u32,
pub max_gross_exposure: f64,
}Expand description
Configuration for PortfolioRisk. Every limit is independently
disable-able, and the Default disables them all (opt-in).
Fields§
§max_daily_loss: f64Account-wide net loss ceiling for the day, in quote currency (a
negative number, e.g. -500.0). When net realised PnL across all
symbols drops to or below this, every new entry is halted until
the next 00:00 UTC rollover. f64::NEG_INFINITY disables the halt.
max_concurrent_positions: u32Maximum number of symbols holding a position at once. A new entry on a
symbol that is currently flat is blocked when this many symbols are
already open. 0 means unlimited.
max_gross_exposure: f64Cap on aggregate gross exposure (the sum of |notional| across all
open positions) in quote currency. A new entry is blocked when it would
push gross exposure past this. f64::INFINITY disables the cap.
Trait Implementations§
Source§impl Clone for PortfolioRiskConfig
impl Clone for PortfolioRiskConfig
Source§fn clone(&self) -> PortfolioRiskConfig
fn clone(&self) -> PortfolioRiskConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PortfolioRiskConfig
impl Debug for PortfolioRiskConfig
Source§impl Default for PortfolioRiskConfig
impl Default for PortfolioRiskConfig
Source§fn default() -> PortfolioRiskConfig
fn default() -> PortfolioRiskConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for PortfolioRiskConfig
impl<'de> Deserialize<'de> for PortfolioRiskConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<PortfolioRiskConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<PortfolioRiskConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for PortfolioRiskConfig
impl Serialize for PortfolioRiskConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for PortfolioRiskConfig
impl RefUnwindSafe for PortfolioRiskConfig
impl Send for PortfolioRiskConfig
impl Sync for PortfolioRiskConfig
impl Unpin for PortfolioRiskConfig
impl UnsafeUnpin for PortfolioRiskConfig
impl UnwindSafe for PortfolioRiskConfig
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