/** * The averages with a shape to them: `hma`, `alma` and `linreg`. * * Each one is a weighted lookback like `wma`, and each accumulates oldest bar * first, in index order, for the reason `lookback.ts` gives. */ import type { Series, StateRecord, Tail, Value } from '../values/index.js'; /** * `hma(src, len)`: from bar `len + round(sqrt(len)) - 2`. * * `wma` of twice the half length average less the full length one, smoothed * again over the square root of the length. * * **The half length is not stated.** `stdlib.md` section 4 fixes the outer * length as `round(sqrt(len))`, which the declared warmup confirms, and says * nothing about the inner one. `floor(len / 2)` is used here, held at a minimum * of 1 so a length of 1 or 2 still has a lookback, and the declared warmup holds * for any inner length at or below `len`, so nothing in the warmup column * settles it. This is recorded as a gap rather than presented as a reading. */ export declare function hmaStep(state: StateRecord, key: string, value: Value, len: number | null): Value; /** `hma(src, len)` as a tail. */ export declare function hmaTail(len: number): Tail; /** `hma(src, len)` over a whole series. */ export declare function hma(src: Series, len: number): Value[]; /** * `alma(src, len, offset, sigma)`: the Gaussian weighted mean, from bar `len - 1`. * * `offset` slides the kernel's peak between lag and smoothness and `sigma` sets * how sharply it falls away. * * A bounded pure cache holds immutable coefficients keyed by the current * parameters. Source observations remain exclusively in the copyable region. */ export declare function almaStep(state: StateRecord, key: string, value: Value, len: number | null, offset: number | null, sigma: number | null): Value; /** `alma(src, len, offset, sigma)` as a tail. */ export declare function almaTail(len: number, offset?: number, sigma?: number): Tail; /** `alma(src, len, offset, sigma)` over a whole series. */ export declare function alma(src: Series, len: number, offset?: number, sigma?: number): Value[]; /** * `linreg(src, len, offset)`: the least squares line through the last `len` * points, read `offset` bars back along it, from bar `len - 1`. * * `x` runs 0 at the oldest bar of the lookback to `len - 1` at the current one, * so the value at the current bar is `intercept + slope * (len - 1)` and a * positive `offset` steps back down the line without refitting it. * * A length of 1 has no line through it: the normal equations are singular, and * the answer is absence rather than the single point, because a line fitted to * one point is not a fit. */ export declare function linregStep(state: StateRecord, key: string, value: Value, len: number | null, offset: number | null): Value; /** `linreg(src, len, offset)` as a tail. */ export declare function linregTail(len: number, offset?: number): Tail; /** `linreg(src, len, offset)` over a whole series. */ export declare function linreg(src: Series, len: number, offset?: number): Value[]; //# sourceMappingURL=shaped.d.ts.map