yiii0012/moontalib/statistic does not have a README file

    MinMaxResult

    pub struct MinMaxResult {
    min : Array[Double]
    max : Array[Double]
    }

    Rolling extremes over a window: min and max arrays of equal length. A NaN inside the window yields NaN for both.

    avg_price

    Average price: (open + high + low + close) / 4.

    avgdev

    fn avgdev(data : Array[Double], period : Int) -> Array[Double] raise
    TaError

    Mean absolute deviation over a rolling window: sum(|x - mean|) / period. A flat window reads 0; a NaN inside the window yields NaN.

    avgdev_lookback

    fn avgdev_lookback(period : Int) -> Int

    Number of leading NaN values produced by avgdev for the given period.

    correl

    fn correl(data1 : Array[Double], data2 : Array[Double], period : Int) -> Array[Double] raise
    TaError

    Pearson correlation coefficient of data1 and data2 over a rolling window of period values: sum(dx * dy) / sqrt(sum(dx^2) * sum(dy^2)) with dx/dy the per-window deviations from the mean. Result ranges from -1 to +1; a window containing NaN, or where either series is flat (zero deviation sum), yields NaN.

    correl_lookback

    fn correl_lookback(period : Int) -> Int

    Number of leading NaN values produced by correl for the given period.

    linearreg

    fn linearreg(data : Array[Double], period : Int) -> Array[Double] raise
    TaError

    Linear regression endpoint: the fitted value at the current bar, intercept + slope * (period - 1).

    linearreg_angle

    fn linearreg_angle(data : Array[Double], period : Int) -> Array[Double] raise
    TaError

    Linear regression angle in degrees: atan(slope) converted from radians.

    linearreg_intercept

    fn linearreg_intercept(data : Array[Double], period : Int) -> Array[Double] raise
    TaError

    Least-squares intercept over a rolling window, defined at bar offset 0.

    linearreg_lookback

    fn linearreg_lookback(period : Int) -> Int

    Number of leading NaN values produced by the linear-regression family for the given period.

    linearreg_slope

    fn linearreg_slope(data : Array[Double], period : Int) -> Array[Double] raise
    TaError

    Least-squares slope over a rolling window. A window shorter than 2 bars cannot define a slope; period must be at least 2.

    max

    fn max(data : Array[Double], period : Int) -> Array[Double] raise
    TaError

    Rolling maximum over a window of period values. A NaN inside the window yields NaN.

    med_price

    Median price: (high + low) / 2.

    min

    fn min(data : Array[Double], period : Int) -> Array[Double] raise
    TaError

    Rolling minimum over a window of period values. A NaN inside the window yields NaN.

    minmax

    fn minmax(data : Array[Double], period : Int) -> MinMaxResult raise
    TaError

    Rolling minimum and maximum over a window of period values, computed in a single pass.

    minmax_lookback

    fn minmax_lookback(period : Int) -> Int

    Number of leading NaN values produced by minmax for the given period.

    sum

    fn sum(data : Array[Double], period : Int) -> Array[Double] raise
    TaError

    Rolling sum over a window of period values. A NaN inside the window yields NaN.

    tsf

    fn tsf(data : Array[Double], period : Int) -> Array[Double] raise
    TaError

    Time series forecast: the regression value one bar beyond the current one, intercept + slope * period.

    typ_price

    Typical price (used by CCI and MFI): (high + low + close) / 3.

    wcl_price

    Weighted close price (TA-Lib WCLPRICE): (high + low + 2 * close) / 4.

    window_lookback

    fn window_lookback(period : Int) -> Int

    Number of leading NaN values produced by max/min/sum for the given period.