Skip to content
EliteChart

suggestPointFigureBoxSize

Documentation


Documentation / @elitechart/core / suggestPointFigureBoxSize

code
function suggestPointFigureBoxSize(bars, opts?): number;

Defined in: series/point-figure.ts:274

Suggest a sensible default boxSize for a series. The hard-coded 1.0 default makes P&F unusable on instruments whose price magnitude is far from 1 — a $1 box on BTC ($46k+) produces hundreds of stacked glyphs per column. Mirrors the suggestRenkoBrickSize approach: ATR-based by default, falling back to a percent-of-close for very short series.

Parameters

bars

readonly Bar[]

opts?

fraction?

number

method?

"atr" | "percent"

period?

number

tickSize?

number

Returns

number

Example

code
const boxSize = suggestPointFigureBoxSize(bars, { tickSize: 0.01 });
chart.setPointFigureOptions({ boxSize, reversalBoxes: 3 });