Documentation
Documentation / @elitechart/core / appendRenkoBricks
function appendRenkoBricks(
state,
raw,
opts): {
newBricks: readonly Bar[];
state: RenkoInternalState;
};
Defined in: series/renko.ts:158
Append zero or more bricks for one new source bar.
Returns the updated state plus the new bricks emitted. Pure /
deterministic.
Parameters
state
RenkoInternalState | undefined
raw
Bar
opts
RenkoOptions & {
fixedDtFallback?: number;
}
Returns
{
newBricks: readonly Bar[];
state: RenkoInternalState;
}
newBricks
readonly newBricks: readonly Bar[];
state
readonly state: RenkoInternalState;
Example
import { appendRenkoBricks } from '@elitechart/core';
let state: RenkoInternalState | undefined;
for (const b of bars) {
const r = appendRenkoBricks(state, b, { brickSize: 100 });
state = r.state;
newBricks.push(...r.newBricks);
}