yiii0012/moontalib/overlap does not have a README file

    BBands

    pub struct BBands {
    upper : Array[Double]
    middle : Array[Double]
    lower : Array[Double]
    }

    Bollinger Bands: upper / middle / lower arrays of equal length. Produced by bbands; fields are readable everywhere but the struct is only constructed inside this package.

    bbands

    fn bbands(data : Array[Double], period : Int, ndev~ : Double) -> BBands raise
    TaError

    Bollinger Bands over data with a moving window of period values and ndev standard deviations (population stddev, TA-Lib convention). A NaN inside a window makes all three outputs NaN at that position.

    bbands_lookback

    fn bbands_lookback(period : Int) -> Int

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

    dema

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

    Double exponential moving average: 2 * EMA - EMA(EMA).

    dema_lookback

    fn dema_lookback(period : Int) -> Int

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

    ema

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

    Exponential moving average with smoothing factor 2 / (period + 1), seeded by the SMA of the first period values (TA-Lib convention).

    ema_from

    fn ema_from(data : Array[Double], period : Int, first_valid : Int) -> Array[Double]

    Exponential moving average over a series that only becomes valid at index first_valid (positions before it are leading NaN padding, as produced by chained indicators).

    The seed is the SMA of the first period valid values (TA-Lib convention); any NaN inside the seed window poisons the whole chain, and a NaN input later on propagates forward. This is the primitive that ema, dema, tema, trix and macd are built on.

    ema_lookback

    fn ema_lookback(period : Int) -> Int

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

    hma

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

    Hull moving average: WMA(2 * WMA(n/2) - WMA(n), sqrt(n)), smoothing the lag of the weighted average against the price series.

    hma_lookback

    fn hma_lookback(period : Int) -> Int

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

    midpoint

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

    Midpoint over a rolling window: (max + min) / 2 of the last period values. A NaN inside the window yields NaN.

    midpoint_lookback

    fn midpoint_lookback(period : Int) -> Int

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

    midprice

    fn midprice(candles :
    Candles
    , period : Int) -> Array[Double] raise
    TaError

    Midprice over a rolling candle window: (highest_high + lowest_low) / 2. A NaN inside the window yields NaN.

    moving_average

    fn moving_average(data : Array[Double], period : Int, ma_type~ :
    MAType
    ) -> Array[Double] raise
    TaError

    Moving average with a selectable flavor; the dispatch point shared by APO/PPO.

    sma

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

    Simple moving average.

    Output has the same length as data; positions before the first full window are NaN, and a NaN anywhere inside a window makes that position NaN.

    sma_lookback

    fn sma_lookback(period : Int) -> Int

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

    tema

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

    Triple exponential moving average: 3 * EMA - 3 * EMA(EMA) + EMA(EMA(EMA)).

    tema_lookback

    fn tema_lookback(period : Int) -> Int

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

    vwma

    fn vwma(price : Array[Double], volume : Array[Double], period : Int) -> Array[Double] raise
    TaError

    Volume-weighted moving average: sum(price * volume) / sum(volume) over the window. Windows containing NaN, or whose volume sums to zero, yield NaN.

    wma

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

    Linearly weighted moving average: the newest bar of the window gets weight period, the oldest gets weight 1.

    wma_lookback

    fn wma_lookback(period : Int) -> Int

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

    Source Files