Skip to content
EliteChart

anchorMatchFactor

Documentation


Documentation / @elitechart/core / anchorMatchFactor

code
function anchorMatchFactor(primaryAnchor, compareAnchor): number;

Defined in: compare/compare-types.ts:46

Anchor-matched scaling factor.

Returns a scalar k such that primaryAnchor = compareAnchor × k. Apply k to every compare-bar close to plot them on the primary's price axis.

Parameters

primaryAnchor

number

compareAnchor

number

Returns

number

Example

code
import { anchorMatchFactor } from '@elitechart/core';
const k = anchorMatchFactor(67_500, 3_200);
const scaled = ethBars.map((b) => ({ ...b, close: b.close * k }));