ohlcv-indicators 3.2.3 → 3.2.5

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.
package/index.js CHANGED
@@ -424,14 +424,14 @@ export default class OHLCV_INDICATORS {
424
424
  }
425
425
 
426
426
 
427
- candleVectors(size = 20, options = {}) {
427
+ candleVectors(size = 200, options = {}) {
428
428
  isAlreadyComputed(this);
429
429
 
430
430
  if (typeof size !== 'number' || size <= 0) {
431
431
  throw new Error('"size" must be a positive number greater than 0 in candleVectors.');
432
432
  }
433
433
 
434
- const { stdDev = 0.5, lag = 0, scale = 0.05, patternSize = 1, autoMinMax = false } = options;
434
+ const { stdDev = 1, lag = 0, scale = 0.05, patternSize = 1, autoMinMax = false } = options;
435
435
 
436
436
 
437
437
  if (typeof stdDev !== 'number' || stdDev <= 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ohlcv-indicators",
3
- "version": "3.2.3",
3
+ "version": "3.2.5",
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",
@@ -96,7 +96,7 @@ export const candleVectors = (main, index, size, {stdDev, patternSize, lag, scal
96
96
  const bodySize = diff(currClose, currOpen)
97
97
 
98
98
  // Update instances with current absolute values
99
- bodyInstance.update(bodySize, lastIndexReplace)
99
+ bodyInstance.update(Math.abs(bodySize), lastIndexReplace)
100
100
 
101
101
  try {
102
102
  bodyBoll = bodyInstance.getResult()