/** * The running totals: `obv`, `ad`, `adOsc` and `pvt`. * * Every function in this module returns absence on every bar when the host * supplies no volume, because `volume` is absent rather than zero there * (`stdlib.md` sections 3.1 and 7). A script tests `chart.hasVolume` to branch * on that rather than inspecting the result, and nothing here substitutes a * zero to keep a line drawing. * * A running total is the one thing a lookback cannot stand in for, so each of * these carries its total in the state region rather than in a closure: that is * what lets an engine roll one back with the rest of a moving bar's state. * * A bar's term is checked after every operation that forms it * (`compiled-program.md` section 3.1), and a term that is not finite is an absent * term: the bar is absent and the total is left where it was, so one overflowing * bar costs its own reading and nothing after it. A total that overflows although * its term was finite is kept as the arithmetic produced it, and every later * reading is absent, which is what `stdlib.md` section 20.6 says of every running * total there. */ import type { Bar, StateRecord, Tail, Value } from '../values/index.js'; /** * Where the close sat inside the bar, as -1 at the low to 1 at the high, times * the volume behind it. * * A bar whose high and low are equal has no position inside it to report, and * the settled treatment is that such a bar contributes nothing rather than * ending the running total. * * A span that overflows is not that bar. It is absent (`compiled-program.md` * section 3.1), and so is the term, because the one later step that could hide * it is this division: a finite numerator over an infinite span is an exact * zero, a term for a bar whose position was never computed. Every other step * that overflows stays non-finite to the end and the last check catches it. */ export declare function moneyFlow(bar: Bar): Value; /** `obv()`: the running total of volume signed by the close's direction, from bar 0, seeded 0. */ export declare function obvStep(state: StateRecord, key: string, bar: Bar): Value; /** `obv()` as a tail. */ export declare function obvTail(): Tail; /** `obv()` over a run of bars. */ export declare function obv(bars: readonly Bar[]): Value[]; /** `ad()`: the running total of volume weighted by where the close sat, from bar 0. */ export declare function adStep(state: StateRecord, key: string, bar: Bar): Value; /** `ad()` as a tail. */ export declare function adTail(): Tail; /** `ad()` over a run of bars. */ export declare function ad(bars: readonly Bar[]): Value[]; /** * `adOsc(fast, slow)`: the difference of two means of `ad`, from bar `slow - 1`. * * The averages run over the running total, not over the per-bar term, so what * this measures is acceleration in accumulation rather than the flow itself. */ export declare function adOscStep(state: StateRecord, key: string, bar: Bar, fast: number | null, slow: number | null): Value; /** `adOsc(fast, slow)` as a tail. */ export declare function adOscTail(fast?: number, slow?: number): Tail; /** `adOsc(fast, slow)` over a run of bars. */ export declare function adOsc(bars: readonly Bar[], fast?: number, slow?: number): Value[]; /** * `pvt()`: the running total of volume weighted by percentage change, from bar * 1, seeded 0. * * The total starts at zero before the first change, and the first change is at * bar 1, so bar 0 is absent and bar 1 already carries its own term. Reporting a * zero at bar 0 would claim a reading on a bar where the quantity is not * defined. */ export declare function pvtStep(state: StateRecord, key: string, bar: Bar): Value; /** `pvt()` as a tail. */ export declare function pvtTail(): Tail; /** `pvt()` over a run of bars. */ export declare function pvt(bars: readonly Bar[]): Value[]; //# sourceMappingURL=accumulation.d.ts.map