ohlcv-indicators 3.5.79 → 3.5.80

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/webpack.config.js CHANGED
@@ -41,17 +41,6 @@ export default {
41
41
  plugins: ['@babel/plugin-proposal-class-properties']
42
42
  }
43
43
  }
44
- },
45
- {
46
- test: /\.js$/,
47
- include: /node_modules\/trading-signals/,
48
- use: {
49
- loader: 'babel-loader',
50
- options: {
51
- presets: ['@babel/preset-env'],
52
- plugins: ['@babel/plugin-proposal-class-properties']
53
- }
54
- }
55
44
  }
56
45
  ]
57
46
  }
@@ -1,45 +0,0 @@
1
- import { validateInputValues } from '../utilities/validators.js'
2
- import { initializeColumns } from '../core-functions/initializeColumns.js'
3
-
4
- export const mapCols = (main, index, newCols, callback, {lag, isPriceBased, callbackParams = {}}) => {
5
-
6
- const {verticalOhlcv, precision} = main
7
-
8
- if(index === 0)
9
- {
10
- if (callback === defaultMapColsCallback) {
11
- validateInputValues({ open: true, close: true }, verticalOhlcv, index, 'mapCols')
12
- }
13
-
14
- for(const key of newCols)
15
- {
16
- if(verticalOhlcv.hasOwnProperty(key)) {
17
- throw new Error(`New property "${key}" already exist in "verticalOhlcv" and can not be modified using mapCols.`)
18
- }
19
- }
20
-
21
- initializeColumns(main, newCols.map(key => ({
22
- key, type: 'Array', priceBased: precision && isPriceBased
23
- })), { lag })
24
- }
25
-
26
- const cols = callback({index, main, params: callbackParams})
27
-
28
- if(cols == null) return;
29
-
30
- for(const [key, value] of Object.entries(cols))
31
- {
32
- main.pushToMain({ index, key, value })
33
- }
34
- }
35
-
36
- export const defaultMapColsCallback = ({main, index}) => {
37
- const {verticalOhlcv} = main
38
-
39
- const close = verticalOhlcv.close[index]
40
- const open = verticalOhlcv.open[index-1]
41
-
42
- return {
43
- change: ((close - open) / open) * 100
44
- }
45
- }