pub enum FinError {
InvalidSymbol(String),
InvalidPrice(Decimal),
InvalidQuantity(Decimal),
SequenceMismatch {
expected: u64,
got: u64,
},
InsufficientLiquidity(Decimal),
BarInvariant(String),
SignalNotReady {
name: String,
required: usize,
have: usize,
},
PositionNotFound(String),
InsufficientFunds {
need: Decimal,
have: Decimal,
},
InvalidTimeframe,
CsvParse(String),
ArithmeticOverflow,
}Expand description
All errors that can occur in fin-primitives operations.
Variants§
InvalidSymbol(String)
Symbol string was empty or contained whitespace.
InvalidPrice(Decimal)
Price value was zero or negative.
InvalidQuantity(Decimal)
Quantity value was negative.
SequenceMismatch
Order book delta arrived out of sequence.
InsufficientLiquidity(Decimal)
Not enough resting liquidity to fill the requested quantity.
BarInvariant(String)
OHLCV bar failed internal invariant check (high >= low, etc.).
SignalNotReady
A signal has not accumulated enough bars to produce a value.
PositionNotFound(String)
Position lookup failed for the given symbol.
InsufficientFunds
Ledger cash balance insufficient to cover the fill cost.
InvalidTimeframe
Timeframe duration was zero or negative.
CsvParse(String)
CSV or text parse failure.
ArithmeticOverflow
A Decimal arithmetic operation overflowed.
Trait Implementations§
Source§impl Error for FinError
impl Error for FinError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for FinError
impl RefUnwindSafe for FinError
impl Send for FinError
impl Sync for FinError
impl Unpin for FinError
impl UnsafeUnpin for FinError
impl UnwindSafe for FinError
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