quant-indicators 0.7.0

Pure indicator math library for trading — MA, RSI, Bollinger, MACD, ATR, HRP
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! Error types for indicator calculations.

use thiserror::Error;

/// Errors that can occur during indicator computation.
#[derive(Debug, Error, PartialEq, Eq, Clone)]
pub enum IndicatorError {
    /// Not enough data points to compute the indicator.
    #[error("insufficient data: need {required} candles, got {actual}")]
    InsufficientData { required: usize, actual: usize },

    /// Invalid parameter for indicator configuration.
    #[error("invalid parameter: {message}")]
    InvalidParameter { message: String },
}