Skip to content
TotalFinance

Technical analysis · @insiderfinance/totalfinance

@insiderfinance/totalfinance/technical-analysis/chart-types

import { … } from '@insiderfinance/totalfinance/technical-analysis/chart-types'
stable-by-law (pre-1.0; not a 1.0 stability guarantee)iface 15class 4const 1fn 15JSON ↗
iface

AggregateStream

#

A streaming aggregator: each input bar yields zero or more completed output units.

Signature
import type { AggregateStream } from '@insiderfinance/totalfinance/technical-analysis/chart-types';

/** A streaming aggregator: each input bar yields zero or more completed output units. */
export interface AggregateStream<Out> {
    next(bar: BarInput): Out[];
    toJSON(): TechnicalAnalysisSnapshot;
}
Fields, parameters and returned members (11)
Name · typeMeaning · unitRequired · default
next(bar: BarInput) => Out[]—unitless by nameRequiredNo @default declared
next(bar)BarInput—unitless by nameRequiredNo @default declared
next(bar).closenumber—unitless by nameRequiredNo @default declared
next(bar).highnumber—unitless by nameRequiredNo @default declared
next(bar).lownumber—unitless by nameRequiredNo @default declared
next(bar).opennumber—unitless by nameOptionalNo @default declared
next(bar).volumenumber—unitless by nameOptionalNo @default declared
toJSON() => TechnicalAnalysisSnapshot—unitless by nameRequiredNo @default declared
toJSON().return.kindstring—unitless by nameRequiredNo @default declared
toJSON().return.schemaVersionnumber

Schema version, stamped at the serialization boundary by snapshotOf.

unitless by name
RequiredNo @default declared
toJSON().return.stateRecord<string, unknown>

Indicator-private stream state. Round-trip it; never read into it.

unitless by name
RequiredNo @default declared

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

class

BarAggregator

#

Public declaration. Read the signature and member contracts below; no additional behaviour is inferred.

Signature
import { BarAggregator } from '@insiderfinance/totalfinance/technical-analysis/chart-types';

export declare class BarAggregator implements AggregateStream<BarInput> {
  constructor(parameters: { kind: string; shouldClose: CloseRule; });
  flush(): BarInput[];
  next(bar: BarInput): BarInput[];
  restore(snapshot: TechnicalAnalysisSnapshot): void;
  toJSON(): TechnicalAnalysisSnapshot;
}
Fields, parameters and returned members (24)

Loading 24 members…

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

iface

CountBarParameters

#

Public declaration. Read the signature and member contracts below; no additional behaviour is inferred.

Signature
import type { CountBarParameters } from '@insiderfinance/totalfinance/technical-analysis/chart-types';

export interface CountBarParameters {
    count: number;
    flush?: boolean;
}
Fields, parameters and returned members (2)
Name · typeMeaning · unitRequired · default
countnumber—unitless by nameRequiredNo @default declared
flushboolean—unitless by nameOptionalNo @default declared

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

iface

DollarBarParameters

#

Public declaration. Read the signature and member contracts below; no additional behaviour is inferred.

Signature
import type { DollarBarParameters } from '@insiderfinance/totalfinance/technical-analysis/chart-types';

export interface DollarBarParameters {
    dollar: number;
    flush?: boolean;
}
Fields, parameters and returned members (2)
Name · typeMeaning · unitRequired · default
dollarnumber—unitless by nameRequiredNo @default declared
flushboolean—unitless by nameOptionalNo @default declared

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

iface

HeikinAshiBar

#

Public declaration. Read the signature and member contracts below; no additional behaviour is inferred.

Signature
import type { HeikinAshiBar } from '@insiderfinance/totalfinance/technical-analysis/chart-types';

// ---- Heikin-Ashi (smoothed candles; also re-exported by chart-types) ----
export interface HeikinAshiBar {
    open: number;
    high: number;
    low: number;
    close: number;
}
Fields, parameters and returned members (4)
Name · typeMeaning · unitRequired · default
closenumber—unitless by nameRequiredNo @default declared
highnumber—unitless by nameRequiredNo @default declared
lownumber—unitless by nameRequiredNo @default declared
opennumber—unitless by nameRequiredNo @default declared

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

class

InformationBarAggregator

#

Public declaration. Read the signature and member contracts below; no additional behaviour is inferred.

Signature
import { InformationBarAggregator } from '@insiderfinance/totalfinance/technical-analysis/chart-types';

export declare class InformationBarAggregator implements AggregateStream<BarInput>, FlushableAgg {
  constructor(parameters: { kind: string; mode: InfoMode; threshold: number; weight: InfoWeight; });
  static fromJSON(snapshot: TechnicalAnalysisSnapshot): InformationBarAggregator;
  flush(): BarInput[];
  next(bar: BarInput): BarInput[];
  toJSON(): TechnicalAnalysisSnapshot;
}
Fields, parameters and returned members (28)

Loading 28 members…

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

iface

InformationBarParameters

#

Public declaration. Read the signature and member contracts below; no additional behaviour is inferred.

Signature
import type { InformationBarParameters } from '@insiderfinance/totalfinance/technical-analysis/chart-types';

export interface InformationBarParameters {
    /** Imbalance/run magnitude that closes a bar. */
    threshold: number;
    /** Emit the trailing partial bar. Default true. */
    flush?: boolean;
}
Fields, parameters and returned members (2)
Name · typeMeaning · unitRequired · default
flushboolean

Emit the trailing partial bar. Default true.

unitless by name
OptionalNo @default declared
thresholdnumber

Imbalance/run magnitude that closes a bar.

unitless by name
RequiredNo @default declared

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

iface

KagiParameters

#

Public declaration. Read the signature and member contracts below; no additional behaviour is inferred.

Signature
import type { KagiParameters } from '@insiderfinance/totalfinance/technical-analysis/chart-types';

// ───────────────────────── Kagi (batch) ─────────────────────────
export interface KagiParameters {
    /** Reversal amount. Absolute price by default, or a percent of price if `percent` is true. */
    reversal: number;
    percent?: boolean;
}
Fields, parameters and returned members (2)
Name · typeMeaning · unitRequired · default
percentboolean—unitless by nameOptionalNo @default declared
reversalnumber

Reversal amount. Absolute price by default, or a percent of price if percent is true.

unitless by name
RequiredNo @default declared

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

iface

KagiSegment

#

Public declaration. Read the signature and member contracts below; no additional behaviour is inferred.

Signature
import type { KagiSegment } from '@insiderfinance/totalfinance/technical-analysis/chart-types';

export interface KagiSegment {
    from: number;
    to: number;
    direction: 1 | -1;
    /** Yang (thick) once price rises above the prior shoulder; yin (thin) below the prior waist. */
    line: 'yang' | 'yin';
}
Fields, parameters and returned members (4)
Name · typeMeaning · unitRequired · default
direction1 | -1—unitless by nameRequiredNo @default declared
fromnumber—unitless by nameRequiredNo @default declared
line'yang' | 'yin'

Yang (thick) once price rises above the prior shoulder; yin (thin) below the prior waist.

unitless by name
RequiredNo @default declared
tonumber—unitless by nameRequiredNo @default declared

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

iface

LineBreakBar

#

Public declaration. Read the signature and member contracts below; no additional behaviour is inferred.

Signature
import type { LineBreakBar } from '@insiderfinance/totalfinance/technical-analysis/chart-types';

export interface LineBreakBar {
    open: number;
    close: number;
    direction: 1 | -1;
}
Fields, parameters and returned members (3)
Name · typeMeaning · unitRequired · default
closenumber—unitless by nameRequiredNo @default declared
direction1 | -1—unitless by nameRequiredNo @default declared
opennumber—unitless by nameRequiredNo @default declared

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

iface

LineBreakParameters

#

Public declaration. Read the signature and member contracts below; no additional behaviour is inferred.

Signature
import type { LineBreakParameters } from '@insiderfinance/totalfinance/technical-analysis/chart-types';

// ───────────────────────── Three-Line Break ─────────────────────────
export interface LineBreakParameters {
    lines?: number;
}
Fields, parameters and returned members (1)
Name · typeMeaning · unitRequired · default
linesnumber—unitless by nameOptionalNo @default declared

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

class

LineBreakStream

#

Public declaration. Read the signature and member contracts below; no additional behaviour is inferred.

Signature
import { LineBreakStream } from '@insiderfinance/totalfinance/technical-analysis/chart-types';

export declare class LineBreakStream implements AggregateStream<LineBreakBar> {
  constructor(count: number);
  static fromJSON(snapshot: TechnicalAnalysisSnapshot): LineBreakStream;
  next(bar: BarInput): LineBreakBar[];
  toJSON(): TechnicalAnalysisSnapshot;
}
Fields, parameters and returned members (21)

Loading 21 members…

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

iface

PnfColumn

#

Public declaration. Read the signature and member contracts below; no additional behaviour is inferred.

Signature
import type { PnfColumn } from '@insiderfinance/totalfinance/technical-analysis/chart-types';

export interface PnfColumn {
    kind: 'X' | 'O';
    low: number;
    high: number;
    boxes: number;
}
Fields, parameters and returned members (4)
Name · typeMeaning · unitRequired · default
boxesnumber—unitless by nameRequiredNo @default declared
highnumber—unitless by nameRequiredNo @default declared
kind'X' | 'O'—unitless by nameRequiredNo @default declared
lownumber—unitless by nameRequiredNo @default declared

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

iface

PnfParameters

#

Public declaration. Read the signature and member contracts below; no additional behaviour is inferred.

Signature
import type { PnfParameters } from '@insiderfinance/totalfinance/technical-analysis/chart-types';

// ───────────────────────── Point & Figure (batch) ─────────────────────────
export interface PnfParameters {
    boxSize: number;
    reversal?: number;
}
Fields, parameters and returned members (2)
Name · typeMeaning · unitRequired · default
boxSizenumber—count (integer)RequiredNo @default declared
reversalnumber—unitless by nameOptionalNo @default declared

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

iface

RangeBarParameters

#

Public declaration. Read the signature and member contracts below; no additional behaviour is inferred.

Signature
import type { RangeBarParameters } from '@insiderfinance/totalfinance/technical-analysis/chart-types';

export interface RangeBarParameters {
    size: number;
    /** Emit the trailing partial bar. Default true. */
    flush?: boolean;
}
Fields, parameters and returned members (2)
Name · typeMeaning · unitRequired · default
flushboolean

Emit the trailing partial bar. Default true.

unitless by name
OptionalNo @default declared
sizenumber—unitless by nameRequiredNo @default declared

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

iface

RenkoBrick

#

Public declaration. Read the signature and member contracts below; no additional behaviour is inferred.

Signature
import type { RenkoBrick } from '@insiderfinance/totalfinance/technical-analysis/chart-types';

export interface RenkoBrick {
    open: number;
    close: number;
    direction: 1 | -1;
}
Fields, parameters and returned members (3)
Name · typeMeaning · unitRequired · default
closenumber—unitless by nameRequiredNo @default declared
direction1 | -1—unitless by nameRequiredNo @default declared
opennumber—unitless by nameRequiredNo @default declared

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

iface

RenkoParameters

#

Public declaration. Read the signature and member contracts below; no additional behaviour is inferred.

Signature
import type { RenkoParameters } from '@insiderfinance/totalfinance/technical-analysis/chart-types';

// ───────────────────────── Renko ─────────────────────────
export interface RenkoParameters {
    brickSize: number;
}
Fields, parameters and returned members (1)
Name · typeMeaning · unitRequired · default
brickSizenumber—count (integer)RequiredNo @default declared

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

class

RenkoStream

#

Public declaration. Read the signature and member contracts below; no additional behaviour is inferred.

Signature
import { RenkoStream } from '@insiderfinance/totalfinance/technical-analysis/chart-types';

export declare class RenkoStream implements AggregateStream<RenkoBrick> {
  constructor(brick: number);
  static fromJSON(snapshot: TechnicalAnalysisSnapshot): RenkoStream;
  next(bar: BarInput): RenkoBrick[];
  toJSON(): TechnicalAnalysisSnapshot;
}
Fields, parameters and returned members (21)

Loading 21 members…

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

iface

VolumeBarParameters

#

Public declaration. Read the signature and member contracts below; no additional behaviour is inferred.

Signature
import type { VolumeBarParameters } from '@insiderfinance/totalfinance/technical-analysis/chart-types';

export interface VolumeBarParameters {
    volume: number;
    flush?: boolean;
}
Fields, parameters and returned members (2)
Name · typeMeaning · unitRequired · default
flushboolean—unitless by nameOptionalNo @default declared
volumenumber—unitless by nameRequiredNo @default declared

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.

const

aggregators

#

Streaming aggregators for live bar construction (each returns completed bars per input bar).

Signature
import { aggregators } from '@insiderfinance/totalfinance/technical-analysis/chart-types';

export declare const aggregators: { readonly dollar: (threshold: number) => BarAggregator; readonly dollarImbalance: (threshold: number) => InformationBarAggregator; readonly dollarRun: (threshold: number) => InformationBarAggregator; readonly imbalance: (threshold: number) => InformationBarAggregator; readonly range: (size: number) => BarAggregator; readonly run: (threshold: number) => InformationBarAggregator; readonly tick: (count: number) => BarAggregator; readonly volume: (threshold: number) => BarAggregator; readonly volumeImbalance: (threshold: number) => InformationBarAggregator; readonly volumeRun: (threshold: number) => InformationBarAggregator; };
Fields, parameters and returned members (54)

Loading 54 members…

Stability: stable-by-law (pre-1.0; not a 1.0 stability guarantee). Units come from declared names; “unitless by name” means the name alone does not establish a unit. See conventions and errors and warnings.