Skip to content
EliteChart

priceBounds

Documentation


Documentation / @elitechart/core / priceBounds

code
function priceBounds(bars, range): MinMax | null;

Defined in: math/bounds.ts:34

Compute the price range [low, high] over the given bar sub-range.

Parameters

bars

readonly Bar[]

range

BarRange

Returns

MinMax | null

null when the sub-range is empty.

Example

code
import { priceBounds } from '@elitechart/core';
const bounds = priceBounds(bars, { start: 0, end: 100 });
if (bounds !== null) {
  console.log(`min=${bounds.min} max=${bounds.max}`);
}