Options
All
  • Public
  • Public/Protected
  • All
Menu

Math helper class with commonly used functions in this library

Hierarchy

  • MathUtils

Index

Methods

Static arraySum

  • arraySum(arr: number[], start?: number, end?: number): number
  • Calculates total sum of numbers in array between start and end index

    Parameters

    • arr: number[]
    • Default value start: number = 0
    • Default value end: number = arr.length - 1

    Returns number

Static ema

  • ema(data: number[], period: number): Array<number>
  • Calculate exponential moving area

    constructor

    Parameters

    • data: number[]
    • period: number

    Returns Array<number>

Static isNumber

  • isNumber(n: any): boolean
  • Return true if n is finite number or false if not

    Parameters

    • n: any

    Returns boolean

Static max

  • max(arr: number[], start?: number, end?: number): number
  • Return maximum number found in array between start and end

    Parameters

    • arr: number[]
    • Default value start: number = 0
    • Default value end: number = arr.length

    Returns number

Static min

  • min(arr: number[], start?: number, end?: number): number
  • Return minimum number found in array between start and end

    Parameters

    • arr: number[]
    • Default value start: number = 0
    • Default value end: number = arr.length

    Returns number

Static sma

  • sma(data: number[], period: number): Array<number>
  • Calculate simple moving average

    Parameters

    • data: number[]

      input data

    • period: number

      period of time

    Returns Array<number>

Static wEma

  • wEma(data: number[], interval: number): Array<number>
  • Calculate wilders exponential moving average

    constructor

    Parameters

    • data: number[]
    • interval: number

    Returns Array<number>

Generated using TypeDoc