pub enum SizingError {
Show 23 variants
InvalidRiskMultiplier {
value: f64,
},
InvalidFixedLots {
value: f64,
},
InvalidFixedRiskAmount {
value: f64,
},
InvalidBalanceRiskPercent {
value: f64,
},
InvalidBalanceBefore {
value: f64,
},
InvalidEntryPrice {
value: f64,
},
InvalidProtectiveStop {
value: f64,
},
MissingProtectiveStop,
InvalidStopGeometry {
side: Side,
entry_price: f64,
stop_price: f64,
},
StopDistanceBelowTick {
entry_price: f64,
stop_price: f64,
digits: u16,
},
PriceOutOfRange {
field: &'static str,
value: f64,
digits: u16,
},
MissingAccountLossPerLot,
InvalidAccountLossPerLot {
value: f64,
},
InvalidPricePrecision {
digits: u16,
pip_position: u16,
},
InvalidLotBaseUnits {
value: i64,
},
InvalidLotStepUnits {
value: i64,
},
InvalidMinimumLotSteps {
value: i64,
},
InvalidMaximumLotSteps {
maximum: i64,
minimum: i64,
},
InvalidScaledPolicyValue {
base_value: f64,
risk_multiplier: f64,
},
InvalidScaledRawLot {
value: f64,
},
InvalidNativeLossPerLot {
entry_price: f64,
stop_price: f64,
},
BelowMinimumLot {
scaled_raw_lot: f64,
floored_lot_steps: u64,
minimum_lot_steps: u64,
},
LotStepOverflow {
scaled_raw_lot: f64,
},
}Expand description
Stable structured failures from compute_size.
Variants§
InvalidRiskMultiplier
The signal risk multiplier is not usable.
InvalidFixedLots
The fixed lot policy value is not usable.
InvalidFixedRiskAmount
The fixed account risk policy value is not usable.
InvalidBalanceRiskPercent
The balance percentage policy value is not usable.
InvalidBalanceBefore
The realized balance required by a balance policy is not usable.
InvalidEntryPrice
The authoritative entry price is not usable.
InvalidProtectiveStop
The supplied protective stop is not usable.
MissingProtectiveStop
A monetary policy was used without a protective stop.
InvalidStopGeometry
A stop is not on the loss side of the authoritative entry.
Fields
StopDistanceBelowTick
Entry and stop collapse to the same tick at the symbol price precision.
Fields
PriceOutOfRange
A price cannot be represented safely at the symbol precision.
Fields
MissingAccountLossPerLot
A monetary policy did not receive an account-currency loss per lot.
InvalidAccountLossPerLot
The supplied account-currency loss per lot is not usable.
InvalidPricePrecision
The symbol price precision is internally inconsistent or unsupported.
InvalidLotBaseUnits
The symbol lot base unit count is invalid.
InvalidLotStepUnits
The symbol lot step unit count is invalid.
InvalidMinimumLotSteps
The symbol minimum lot step count is invalid.
InvalidMaximumLotSteps
The symbol maximum lot step count is invalid.
InvalidScaledPolicyValue
Applying the signal multiplier produced an unusable policy value.
Fields
InvalidScaledRawLot
Monetary division produced an unusable raw lot quantity.
InvalidNativeLossPerLot
The computed native loss for one lot overflowed.
BelowMinimumLot
The floored lot quantity does not meet the symbol minimum.
Fields
LotStepOverflow
The lot quantity cannot be represented by the authoritative step count.
Trait Implementations§
Source§impl Clone for SizingError
impl Clone for SizingError
Source§fn clone(&self) -> SizingError
fn clone(&self) -> SizingError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SizingError
impl Debug for SizingError
Source§impl Display for SizingError
impl Display for SizingError
Source§impl Error for SizingError
impl Error for SizingError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()