1.0.2 • Published 7 years ago

hhv-llv v1.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

Build Status Coverage

hhv-llv

Calculates the highest high values / lowest low values of closing prices over the preceding periods (periods includes the current time)

Install

$ npm install hhv-llv

Usage

import {
  hhv,
  llv
} from 'hhv-llv'

const array = [1, 2, 4, 1]

hhv(array, 2)    // [, 2, 4, 4]
hhv(array)       // 4
hhv(array, 5)    // [<4 empty items>]
hhv(array, 1)    // [1, 2, 4, 1]

hhv(array, 2)    // [, 1, 2, 2]

hhv(data, periods)

  • data Array.<Number> the array of closing prices.
  • periods Number the size of periods

Returns Number the highest closing prices over the preceding periods periods.

llv(data, periods)

Instead, returns Number the lowest closing prices.

License

MIT