UNPKG

@4ex/indicators

Version:

Technical indicators for ohlc charts written in TypeScript

45 lines (44 loc) 1.78 kB
import { ADL as ADLIndicator } from 'technicalindicators'; import { OHLC } from '../types'; import { Indicator, IndicatorInput } from './base-indicator'; export declare type AccumulationDistributionLineInput = IndicatorInput; /** * The accumulation/distribution line was created by Marc Chaikin * to determine the flow of money into or out of a security. It should not * be confused with the advance/decline line. While their initials might be * the same, these are entirely different indicators, as are their users. * The advance/decline line provides insight into market movements and the * accumulation/distribution line is of use to traders seeking to measure * buy/sell pressure on a security or confirm the strength of a trend. */ export declare class ADL implements Indicator { indicator: ADLIndicator; /** * @param {OHLC[]} series candle series */ constructor(series: OHLC[]); /** * Retrieve ADL values for instance * @return {number[]} values for instance data */ getResults(): number[]; /** * Calculate ADL to next tick * @param {OHLC} candle new candle to add to series * @return {number | undefined} next adl value or undefined if period is * greater than actual series length */ next(candle: OHLC): number | undefined; /** * Create instance from data * @param {AccumulationDistributionLineInput} input input data * @return {ADL} adl instance */ static generator({ series, }: AccumulationDistributionLineInput): ADL; /** * Get adl values from input * @param {AccumulationDistributionLineInput} input input data * @return {number[]} adl values */ static calculate({ series, }: AccumulationDistributionLineInput): number[]; }