bollinger-bands
v3.0.2
Published
Fintach math utility to calculate bollinger bands.
Downloads
349
Maintainers
Readme
MAINTENANCE WARNING
This module is lack of maintenance.
If you are familiar with python programming maybe you could check stock-pandas which provides powerful statistic indicators support, and is backed by numpy
and pandas
.
The performance of stock-pandas is many times higher than JavaScript libraries, and can be directly used by machine learning programs.
bollinger-bands
Fintach math utility to calculate bollinger bands.
Install
$ npm install bollinger-bands
Usage
import boll from 'bollinger-bands'
boll([1, 2, 4, 8], 2, 2)
// {
// upper: [, 2.5, 5, 10],
// mid : [, 1.5, 3, 6],
// lower: [, 0.5, 1, 2]
// }
boll(datum, size, times, options)
- datum
Array.<Number>
the collection of data - size
Number=20
the period size, defaults to20
- times
Number=2
the times of standard deviation between the upper band and the moving average. - options
Object=
optional options- ma
Array.<Number>=
the moving averages of the provideddatum
and periodsize
. This option is used to prevent duplicate calculation of moving average. - sd
Array.<Number>=
the standard average of the provideddatum
and periodsize
- ma
Returns Array.<Band>
the array of the Band
object.
struct Band
- upper
Number
the value of the upper band - mid
Number
the value middle band (moving average) - lower
Number
the value of the lower band
Related Fintech Modules
- moving-averages: The complete collection of utility methods for Moving average.
- s-deviation: Math utility to calculate standard deviations.
License
MIT