Options
All
  • Public
  • Public/Protected
  • All
Menu

LCJS analysis API Documentation

Index

Type aliases

AreaPoint

AreaPoint: { high: number; low: number; position: number }

Datapoint with one X value and two Y values.

Type declaration

  • high: number

    High value of Point in the given position.

  • low: number

    Low value of Point in the given position.

  • position: number

    Position of Point.

Point

Point: { x: number; y: number }

Datapoint with X and Y values.

Type declaration

  • x: number
  • y: number

XOHLC

XOHLC: [number, number, number, number, number]

Ordered tuple that contains values for:

  • X
  • Open
  • High
  • Low
  • Close

Functions

Const bollingerBands

  • bollingerBands(xohlcValues: XOHLC[], averagingFrameLength: number): AreaPoint[]
  • Calculate bollinger bands values from XOHLC values. Uses "typical prices" (average of close + low + high).

    Parameters

    • xohlcValues: XOHLC[]

      Array of XOHLC values.

    • averagingFrameLength: number

      Length of averaging frame.

    Returns AreaPoint[]

    Points of Bollinger bands (X + 2 Y values)

Const exponentialMovingAverage

  • exponentialMovingAverage(xohlcValues: XOHLC[], averagingFrameLength: number): Point[]
  • Calculate EMA values from XOHLC 'close' values.

    Parameters

    • xohlcValues: XOHLC[]

      Array of XOHLC values.

    • averagingFrameLength: number

      Length of averaging frame.

    Returns Point[]

    Array of EMA values. Length of this array is equal to xohlcValues.length - averagingFrameLength + 1

Const relativeStrengthIndex

  • relativeStrengthIndex(xohlcValues: XOHLC[], averagingFrameLength: number): Point[]
  • Calculate RSI values from XOHLC 'close' values.

    Parameters

    • xohlcValues: XOHLC[]

      Array of XOHLC values.

    • averagingFrameLength: number

      Length of averaging frame.

    Returns Point[]

    Relative Strength Index values. Length of this array is equal to xohlcValues.length - averagingFrameLength

Const simpleMovingAverage

  • simpleMovingAverage(xohlcValues: XOHLC[], averagingFrameLength: number): Point[]
  • Calculate SMA values from XOHLC 'close' values.

    Parameters

    • xohlcValues: XOHLC[]

      Array of XOHLC values.

    • averagingFrameLength: number

      Length of averaging frame.

    Returns Point[]

    Array of SMA values. Length of this array will be xohlcValues.length - averagingFrameLength + 1

Const standardDeviation

  • standardDeviation(values: number[]): number
  • Calculate standard deviation for a set of values.

    Parameters

    • values: number[]

      Array of values.

    Returns number

    Standard deviation value.