/** * A bar, and the derived prices a study reaches for by name. * * The functions `stdlib.md` writes without a source argument, `atr(len)` and * `cci(len)` among them, read the bar rather than a series. This library is * pure, so it takes the bar explicitly and an engine binds it; the function * names and the arithmetic are the specification's, the plumbing is not. * * `volume` is absent, not zero, on an instrument the host has no volume for * (`stdlib.md` section 3.1). Zero is a real reading meaning nobody traded, and * conflating the two would make a volume study draw a flat line where it should * draw nothing. */ import type { Value } from './value.js'; /** One bar of price and quantity. */ export interface Bar { readonly open: Value; readonly high: Value; readonly low: Value; readonly close: Value; readonly volume: Value; } /** * `(high + low) / 2`, the bar's midpoint. * * It takes the two extremes rather than the whole bar, because the studies * built on a range hold those two and the close before them rather than a bar. */ export declare function hl2(bar: { readonly high: Value; readonly low: Value; }): Value; /** `(high + low + close) / 3`, the typical price. */ export declare function hlc3(bar: Bar): Value; /** `(open + high + low + close) / 4`, the average price. */ export declare function ohlc4(bar: Bar): Value; /** `(high + low + close + close) / 4`, the close-weighted average price. */ export declare function hlcc4(bar: Bar): Value; //# sourceMappingURL=bar.d.ts.map