/** * The exponential family: `ema`, `rma`, `dema` and `tema`. * * All four share one seeding rule, which `stdlib.md` section 4 states for `ema` * and then refers `rma` to: the average is seeded on bar `len - 1` with the * simple average of those `len` values, and is absent before it. Seeding from * bar 0 instead, which is common and cheaper, draws a line where there should * be a gap and stays materially wrong until the seed decays away. The seeding * itself is `smoothed` in `lookback.ts`, which every seeded average here and in * the studies built on them goes through. * * **Two arrangements, deliberately.** `ema` steps as `value * k + prev * (1 - k)` * and `rma` steps as `(prev * (len - 1) + value) / len`. Those are the same * function in exact arithmetic and two different numbers in binary64, and each * is the arrangement its name has always meant. Writing `rma` as a weight of * `1 / len` in `ema`'s shape would disagree in the last bits with every * implementation of the classic oscillators, which is precisely what this * project treats as a release blocker. */ import type { Series, StateRecord, Tail, Value } from '../values/index.js'; /** `ema(src, len)`: exponential mean, weight `2 / (len + 1)`, from bar `len - 1`. */ export declare function emaStep(state: StateRecord, key: string, value: Value, len: number | null): Value; /** `ema(src, len)` as a tail. */ export declare function emaTail(len: number): Tail; /** `ema(src, len)` over a whole series. */ export declare function ema(src: Series, len: number): Value[]; /** `rma(src, len)`: the smoothing the classic oscillators use, from bar `len - 1`. */ export declare function rmaStep(state: StateRecord, key: string, value: Value, len: number | null): Value; /** `rma(src, len)` as a tail. */ export declare function rmaTail(len: number): Tail; /** `rma(src, len)` over a whole series. */ export declare function rma(src: Series, len: number): Value[]; /** * `dema(src, len)`: `2 * ema - ema(ema)`, from bar `2 * len - 2`. * * The second average is fed the first one's output, absences and all, so it * seeds on the first `len` values the first average produced. That is where the * declared warmup comes from rather than being asserted alongside it. */ export declare function demaStep(state: StateRecord, key: string, value: Value, len: number | null): Value; /** `dema(src, len)` as a tail. */ export declare function demaTail(len: number): Tail; /** `dema(src, len)` over a whole series. */ export declare function dema(src: Series, len: number): Value[]; /** `tema(src, len)`: `3 * e1 - 3 * e2 + e3`, from bar `3 * len - 3`. */ export declare function temaStep(state: StateRecord, key: string, value: Value, len: number | null): Value; /** `tema(src, len)` as a tail. */ export declare function temaTail(len: number): Tail; /** `tema(src, len)` over a whole series. */ export declare function tema(src: Series, len: number): Value[]; //# sourceMappingURL=exponential.d.ts.map