Skip to content
EliteChart

barCrossesPrice

Documentation


Documentation / @elitechart/core / barCrossesPrice

code
function barCrossesPrice(bar, threshold): boolean;

Defined in: alerts/alert-types.ts:40

Returns true if bar's price range contains threshold — the alert crossed during this bar. Inclusive on both sides.

Parameters

bar

Bar

threshold

number

Returns

boolean

Example

code
import { barCrossesPrice } from '@elitechart/core';
if (barCrossesPrice(latestBar, 67_500)) fireAlert();