/** * Change over a distance, runs of it, and crossings. * * `crossUp` reads "at or below, then above" rather than "strictly below, then * above", which `stdlib.md` section 9 states and gives the reason for: two * series that touch and separate report one cross rather than none, and touching * is common on an instrument with a coarse tick. */ import type { Flag, Series, StateRecord, Tail, Value } from '../values/index.js'; /** `change(src, len)`: `src - src[len]`, from bar `len`. */ export declare function changeStep(state: StateRecord, key: string, value: Value, len: number | null): Value; /** `change(src, len)` as a tail. */ export declare function changeTail(len?: number): Tail; /** `change(src, len)` over a whole series. */ export declare function change(src: Series, len?: number): Value[]; /** `history(src, n)`: `src` as it stood `n` bars ago, from bar `n`. */ export declare function historyStep(state: StateRecord, key: string, value: Value, back: number | null): Value; /** `history(src, n)` as a tail. */ export declare function historyTail(back: number): Tail; /** `history(src, n)` over a whole series. */ export declare function history(src: Series, back: number): Value[]; /** `rising` and `falling`: every one of the last `len` changes went one way. */ export declare function runStep(state: StateRecord, key: string, value: Value, len: number | null, wantUp: boolean): Flag; /** `rising(src, len)`: true when each of the last `len` changes was positive, from bar `len`. */ export declare function risingTail(len: number): Tail; /** `rising(src, len)` over a whole series. */ export declare function rising(src: Series, len: number): Flag[]; /** `falling(src, len)`: true when each of the last `len` changes was negative, from bar `len`. */ export declare function fallingTail(len: number): Tail; /** `falling(src, len)` over a whole series. */ export declare function falling(src: Series, len: number): Flag[]; /** A pair of series read on the same bar, for the crossing tests. */ export interface Pair { readonly a: Value; readonly b: Value; } /** Which way a crossing counts. */ export type Direction = 'up' | 'down' | 'either'; /** * The crossing test, which keeps the two series apart rather than subtracting. * * A difference would round, and the whole test turns on whether one series was * at or below the other, which is the one place a rounded zero would change the * answer. */ export declare function crossStep(state: StateRecord, key: string, pair: Pair, direction: Direction): Flag; /** `crossUp(a, b)`: `a` was at or below `b` and is now above, from bar 1. */ export declare function crossUpTail(): Tail; /** `crossDown(a, b)`: `a` was at or above `b` and is now below, from bar 1. */ export declare function crossDownTail(): Tail; /** `cross(a, b)`: either direction, from bar 1. */ export declare function crossEitherTail(): Tail; /** `crossUp(a, b)` over whole series. */ export declare function crossUp(a: Series, b: Series): Flag[]; /** `crossDown(a, b)` over whole series. */ export declare function crossDown(a: Series, b: Series): Flag[]; /** `cross(a, b)` over whole series. */ export declare function cross(a: Series, b: Series): Flag[]; //# sourceMappingURL=changes.d.ts.map