/** * `chop` and `hv`, the two readings that say how the lookback behaved rather than * how wide it was. * * Both are written as a step over a state region and both tails are that step * over a region of their own, so a live chart and a fold over a run of bars * cannot disagree. */ import type { Bar, Series, StateRecord, Tail, Value } from '../values/index.js'; import type { Gap } from './range.js'; /** * `chop(len)`: a 0 to 100 reading of whether the lookback trended or chopped, * from bar `len`. * * The distance price actually travelled over the lookback, against the outright * range it covered. A market that went straight there travels its range and * reads low; one that went back and forth travels several times its range and * reads high. * * The travel is a sum of `len` true ranges, and a true range needs the bar * before it, which is why the first reading is at bar `len` and not at bar * `len - 1`: the gap-aware form of true range is the one used here, per the * note in `range.ts`. The previous close arrives with the gap rather than being * remembered here, for the reason the same note gives. */ export declare function chopStep(state: StateRecord, key: string, gap: Gap, len: number | null): Value; /** `chop(len)` as a tail. */ export declare function chopTail(len?: number): Tail; /** `chop(len)` over a run of bars. */ export declare function chop(bars: readonly Bar[], len?: number): Value[]; /** * `hv(src, len, periodsPerYear)`: the annualised standard deviation of log * returns, from bar `len`. * * A log return needs the previous bar, so the deviation's lookback starts at bar * 1 and its first value is at bar `len`, one later than a lookback over levels. * * The result is a proportion, not a percentage: `stdlib.md` section 6 says * "annualised standard deviation of log returns" and nothing about scaling it * by a hundred, so nothing here does. A study that wants a percentage axis * multiplies at the plot, where a reader can see it happen. */ export declare function hvStep(state: StateRecord, key: string, value: Value, len: number | null, periodsPerYear: number | null): Value; /** `hv(src, len, periodsPerYear)` as a tail. */ export declare function hvTail(len?: number, periodsPerYear?: number): Tail; /** `hv(src, len, periodsPerYear)` over a whole series. */ export declare function hv(src: Series, len?: number, periodsPerYear?: number): Value[]; //# sourceMappingURL=measures.d.ts.map