pub struct SizingConfig {
pub margin_per_trade: f64,
pub leverage: u32,
pub max_contracts: u32,
}Expand description
Configuration for PositionSizer.
Fields§
§margin_per_trade: f64Default margin to commit per trade in quote currency (e.g. USDT).
leverage: u32Leverage multiplier. Used to convert margin into notional.
max_contracts: u32Hard ceiling on contracts per trade — never exceeded regardless of what the formula returns.
Trait Implementations§
Source§impl Clone for SizingConfig
impl Clone for SizingConfig
Source§fn clone(&self) -> SizingConfig
fn clone(&self) -> SizingConfig
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 SizingConfig
impl Debug for SizingConfig
Source§impl Default for SizingConfig
impl Default for SizingConfig
Source§fn default() -> SizingConfig
fn default() -> SizingConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for SizingConfig
impl<'de> Deserialize<'de> for SizingConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<SizingConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SizingConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for SizingConfig
impl Serialize for SizingConfig
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 SizingConfig
impl RefUnwindSafe for SizingConfig
impl Send for SizingConfig
impl Sync for SizingConfig
impl Unpin for SizingConfig
impl UnsafeUnpin for SizingConfig
impl UnwindSafe for SizingConfig
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