@pond-ts/financial API Reference
    Preparing search index...

    Type Alias FoldStep<State>

    FoldStep: (
        state: State,
        index: number,
        run: number,
        inputs: readonly Float64Array[],
        outputs: readonly Float64Array[],
    ) => void

    One bar of a K6 machine.

    Type Parameters

    • State

    Type Declaration

      • (
            state: State,
            index: number,
            run: number,
            inputs: readonly Float64Array[],
            outputs: readonly Float64Array[],
        ): void
      • Parameters

        • state: State

          The machine's own state, allocated once by the study and mutated in place — carried fields plus whatever configuration the step needs (multiplier, the acceleration step, …), so the step can be a top-level function with no closure to allocate.

        • index: number

          The row to read and write.

        • run: number

          How many consecutive complete rows end at index; 1 on the first bar of a fresh run (the series start, or the bar after a gap).

        • inputs: readonly Float64Array[]

          The row-aligned input columns, in the order given to foldRows. No cell at index is NaN — an infinite one still arrives, since only NaN marks a gap ([PND-STUDYBOX]).

        • outputs: readonly Float64Array[]

          The row-aligned output columns, pre-filled with NaN. A step that writes nothing leaves the warm-up in place.

        Returns void