ohlcv-indicators 1.5.5 → 1.5.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +6 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -9,6 +9,7 @@ import { donchianChannels } from './src/moving-averages/donchianChannel.js'
9
9
  import {Big} from 'trading-signals';
10
10
  import { parseOhlcvToVertical } from './src/utilities/parsing-utilities.js'
11
11
  import { candlesStudies } from './src/studies/candleStudies.js'
12
+ import { correlation } from './src/studies/correlation.js'
12
13
 
13
14
  export default class OHLCV_INDICATORS {
14
15
  constructor({input, precision = false, ticker = 'undefined'}) {
@@ -17,6 +18,7 @@ export default class OHLCV_INDICATORS {
17
18
  if(input.length === 0) throw Error('input ohlcv must not be empty: ' + ticker)
18
19
  if(!input[0].hasOwnProperty('close')) throw Error('input ohlcv array objects require at least close property: ' + ticker)
19
20
 
21
+
20
22
  const big = num => (this.precision) ? new Big(num) : num
21
23
 
22
24
  this.len = input.length
@@ -27,7 +29,10 @@ export default class OHLCV_INDICATORS {
27
29
  this.verticalOhlcv = parseOhlcvToVertical(input, this.len, big)
28
30
  this.indicators = {}
29
31
  this.studies = {}
30
- this.isComputed = false
32
+ this.isComputed = false
33
+ this.studies = {
34
+ correlation
35
+ }
31
36
  return this
32
37
  }
33
38
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ohlcv-indicators",
3
- "version": "1.5.5",
3
+ "version": "1.5.6",
4
4
  "description": "A JavaScript library featuring optimized trading indicators for OHLCV arrays [{open, high, low, close, value}]. This library is optimized for backtesting and trading bot development.",
5
5
  "main": "index.js",
6
6
  "type": "module",