ohlcv-indicators 1.5.7 → 1.6.0

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/package.json CHANGED
@@ -1,17 +1,19 @@
1
1
  {
2
2
  "name": "ohlcv-indicators",
3
- "version": "1.5.7",
3
+ "version": "1.6.0",
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",
7
7
  "scripts": {
8
8
  "test": "node test/test.js",
9
9
  "study": "node test/study.js",
10
+ "knn": "node test/knn.js",
10
11
  "build": "npx webpack"
11
12
  },
12
13
  "author": "https://jaimelias.com/",
13
14
  "license": "ISC",
14
15
  "dependencies": {
16
+ "ml-knn": "^3.0.0",
15
17
  "trading-signals": "^5.0.4"
16
18
  },
17
19
  "devDependencies": {
@@ -3,14 +3,14 @@ import {BollingerBands, FasterBollingerBands, Big} from 'trading-signals';
3
3
 
4
4
  export const bollingerBands = (main, size, times) => {
5
5
 
6
- const {verticalOhlcv, precision} = main
6
+ const {verticalOhlcv} = main
7
7
  const {close} = verticalOhlcv
8
8
 
9
- const col = getBollingerBands(close, size, times, precision)
9
+ const col = getBollingerBands(close, size, times)
10
10
  return col
11
11
  }
12
12
 
13
- export const getBollingerBands = (data, size = 20, times = 2, precision) => {
13
+ export const getBollingerBands = (data, size = 20, times = 2) => {
14
14
 
15
15
  const dataLength = data.length
16
16
  const bollinger_bands_upper = Array(dataLength).fill(null)
@@ -21,22 +21,12 @@ export const getBollingerBands = (data, size = 20, times = 2, precision) => {
21
21
  let range = null
22
22
  let height = null
23
23
 
24
- let getRange
25
- let instance
24
+ let getRange = (value, upper, lower) => ({
25
+ range: ((value - lower) / (upper - lower)) * 100,
26
+ height: ((upper-lower)/lower) * 100
27
+ })
28
+ let instance = new FasterBollingerBands(size, times)
26
29
 
27
- if (precision) {
28
- instance = new BollingerBands(size, times)
29
- getRange = (value, upper, lower) => ({
30
- range: ((value.minus(lower)).div((upper.minus(lower)))).times(100),
31
- height: ((upper.minus(lower)).div(lower)).times(100)
32
- })
33
- } else {
34
- instance = new FasterBollingerBands(size, times)
35
- getRange = (value, upper, lower) => ({
36
- range: ((value - lower) / (upper - lower)) * 100,
37
- height: ((upper-lower)/lower) * 100
38
- })
39
- }
40
30
 
41
31
  for (let x = 0; x < dataLength; x++) {
42
32
  let obj = {};
@@ -1,12 +1,12 @@
1
1
  export const donchianChannels = (main, period, offset) => {
2
2
 
3
- const {verticalOhlcv, precision, len} = main
3
+ const {verticalOhlcv, len} = main
4
4
  const {high, low} = verticalOhlcv
5
5
 
6
- return getDonchianChannels(high, low, period, offset, precision, len)
6
+ return getDonchianChannels(high, low, period, offset, len)
7
7
  }
8
8
 
9
- export const getDonchianChannels = (high, low, period, offset, precision, len) => {
9
+ export const getDonchianChannels = (high, low, period, offset, len) => {
10
10
  const donchian_channel_upper = new Array(len).fill(null)
11
11
  const donchian_channel_lower = new Array(len).fill(null)
12
12
  const donchian_channel_basis = new Array(len).fill(null)
@@ -14,10 +14,8 @@ export const getDonchianChannels = (high, low, period, offset, precision, len) =
14
14
  const maxQueue = []
15
15
  const minQueue = []
16
16
 
17
- const avg = (precision)
18
- ? ((h, l) => (h.plus(l)).div(2))
19
- : ((h, l) => (h + l) / 2)
20
-
17
+ const avg = ((h, l) => (h + l) / 2)
18
+
21
19
  for (let i = 0; i < len; i++) {
22
20
 
23
21
  while (maxQueue.length && maxQueue[0] <= i - period) {
@@ -3,27 +3,27 @@ import {EMA, FasterEMA} from 'trading-signals'
3
3
 
4
4
  export const ema = (main, size) => {
5
5
 
6
- const {verticalOhlcv, precision} = main
6
+ const {verticalOhlcv} = main
7
7
  const {close} = verticalOhlcv
8
8
 
9
- const col = getEMA(close, size, precision)
9
+ const col = getEMA(close, size)
10
10
 
11
11
  return {
12
12
  [`ema_${size}`]: col
13
13
  }
14
14
  }
15
15
 
16
- export const getEMA = (data, size, precision) => {
16
+ export const getEMA = (data, size) => {
17
17
 
18
18
 
19
- if(typeof precision === 'undefined' || typeof data === 'undefined' || typeof size === 'undefined')
19
+ if(typeof data === 'undefined' || typeof size === 'undefined')
20
20
  {
21
21
  throw Error('undefined param in getEMA')
22
22
  }
23
23
 
24
24
  const dataLength = data.length
25
25
  const output = new Array(dataLength).fill(null)
26
- const instance = (precision) ? new EMA(size) : new FasterEMA(size)
26
+ const instance = new FasterEMA(size)
27
27
 
28
28
  for(let x = 0; x < dataLength; x++)
29
29
  {
@@ -4,26 +4,21 @@ import {EMA, MACD, FasterEMA, FasterMACD} from 'trading-signals';
4
4
 
5
5
  export const macd = (main, fastLine, slowLine, signalLine) => {
6
6
 
7
- const {verticalOhlcv, precision} = main
7
+ const {verticalOhlcv} = main
8
8
  const {close} = verticalOhlcv
9
- const col = getMACD(close, fastLine, slowLine, signalLine, precision)
9
+ const col = getMACD(close, fastLine, slowLine, signalLine)
10
10
 
11
11
  return col
12
12
  }
13
13
 
14
- export const getMACD = (data, fastLine = 12, slowLine = 26, signalLine = 9, precision) => {
14
+ export const getMACD = (data, fastLine = 12, slowLine = 26, signalLine = 9) => {
15
15
 
16
16
  const dataLength = data.length
17
17
  const diff = new Array(dataLength).fill(null)
18
18
  const dea = new Array(dataLength).fill(null)
19
19
  const histogram = new Array(dataLength).fill(null)
20
20
 
21
- const instance = (precision) ? new MACD({
22
- indicator: EMA,
23
- shortInterval: fastLine,
24
- longInterval: slowLine,
25
- signalInterval: signalLine
26
- }) : new FasterMACD(new FasterEMA(fastLine), new FasterEMA(slowLine), new FasterEMA(signalLine))
21
+ const instance = new FasterMACD(new FasterEMA(fastLine), new FasterEMA(slowLine), new FasterEMA(signalLine))
27
22
 
28
23
  for(let x = 0; x < dataLength; x++)
29
24
  {
@@ -44,7 +39,7 @@ export const getMACD = (data, fastLine = 12, slowLine = 26, signalLine = 9, prec
44
39
  histogram[x] = obj.histogram
45
40
  }
46
41
 
47
- const x = findCrosses({fast: diff, slow: dea, precision})
42
+ const x = findCrosses({fast: diff, slow: dea})
48
43
 
49
44
  return {
50
45
  macd_diff: diff,
@@ -3,27 +3,26 @@ import {SMA, FasterSMA} from 'trading-signals';
3
3
 
4
4
  export const sma = (main, size) => {
5
5
 
6
- const {verticalOhlcv, precision} = main
6
+ const {verticalOhlcv} = main
7
7
  const {close} = verticalOhlcv
8
8
 
9
- const col = getSMA(close, size, precision)
9
+ const col = getSMA(close, size)
10
10
 
11
11
  return {
12
12
  [`sma_${size}`]: col
13
13
  }
14
14
  }
15
15
 
16
- export const getSMA = (data, size, precision) => {
16
+ export const getSMA = (data, size) => {
17
17
 
18
- if(typeof precision === 'undefined' || typeof data === 'undefined' || typeof size === 'undefined')
18
+ if(typeof data === 'undefined' || typeof size === 'undefined')
19
19
  {
20
20
  throw Error('undefined param in getSMA')
21
21
  }
22
22
 
23
23
  const dataLength = data.length
24
24
  const output = new Array(dataLength).fill(null)
25
- const instance = (precision) ? new SMA(size) : new FasterSMA(size)
26
-
25
+ const instance = new FasterSMA(size)
27
26
 
28
27
  for(let x = 0; x < dataLength; x++)
29
28
  {
@@ -1,13 +1,12 @@
1
- import { findCrosses } from "./findCrosses.js"
1
+ import { findCrosses } from "../studies/findCrosses.js"
2
2
 
3
3
  export const orb = main => {
4
- const {inputOhlcv, len, precision, verticalOhlcv} = main
5
- const {close} = verticalOhlcv
6
- const cols = getOrbOfTheFirstCandle(inputOhlcv, close, len, precision)
4
+ const {inputOhlcv, len} = main
5
+ const cols = getOrbOfTheFirstCandle(inputOhlcv, len)
7
6
  return cols
8
7
  }
9
8
 
10
- const getOrbOfTheFirstCandle = (inputOhlcv, close, len, precision) => {
9
+ const getOrbOfTheFirstCandle = (inputOhlcv, len) => {
11
10
  const orb_high = new Array(len).fill(0)
12
11
  const orb_low = new Array(len).fill(0)
13
12
  let startIndex = 0
@@ -7,7 +7,7 @@ const ma = {getSMA, getEMA}
7
7
 
8
8
  export const rsi = (main, period, movingAverage, movingAveragePeriod) => {
9
9
 
10
- const {verticalOhlcv, precision} = main
10
+ const {verticalOhlcv} = main
11
11
  const {close} = verticalOhlcv
12
12
 
13
13
  if(typeof period === 'number' && typeof movingAveragePeriod === 'undefined')
@@ -15,12 +15,12 @@ export const rsi = (main, period, movingAverage, movingAveragePeriod) => {
15
15
  movingAveragePeriod = period
16
16
  }
17
17
 
18
- const col = getRSI(close, period, movingAverage, movingAveragePeriod, precision)
18
+ const col = getRSI(close, period, movingAverage, movingAveragePeriod)
19
19
 
20
20
  return col
21
21
  }
22
22
 
23
- export const getRSI = (data, period = 14, movingAverage = 'SMA', movingAveragePeriod = 14, precision) => {
23
+ export const getRSI = (data, period = 14, movingAverage = 'SMA', movingAveragePeriod = 14) => {
24
24
 
25
25
  const dataLength = data.length
26
26
 
@@ -29,7 +29,7 @@ export const getRSI = (data, period = 14, movingAverage = 'SMA', movingAveragePe
29
29
  }
30
30
 
31
31
  let rsi = new Array(dataLength).fill(null)
32
- const instance = (precision) ? new RSI(period) : new FasterRSI(period)
32
+ const instance = new FasterRSI(period)
33
33
 
34
34
  for(let x = 0; x < dataLength; x++)
35
35
  {
@@ -58,9 +58,9 @@ export const getRSI = (data, period = 14, movingAverage = 'SMA', movingAveragePe
58
58
  {
59
59
  if(ma.hasOwnProperty(`get${movingAverage}`))
60
60
  {
61
- const rsi_smoothed = ma[`get${movingAverage}`](rsi, movingAveragePeriod, precision)
61
+ const rsi_smoothed = ma[`get${movingAverage}`](rsi, movingAveragePeriod)
62
62
  output[`rsi_${movingAverage}_${movingAveragePeriod}`] = rsi_smoothed
63
- output[`rsi_${period}_x_rsi_${movingAverage}_${movingAveragePeriod}`] = findCrosses({fast: rsi, slow: rsi_smoothed, precision})
63
+ output[`rsi_${period}_x_rsi_${movingAverage}_${movingAveragePeriod}`] = findCrosses({fast: rsi, slow: rsi_smoothed})
64
64
  }
65
65
  }
66
66
 
@@ -28,13 +28,16 @@ const getCandlesStudies = (inputOhlcv, period = 20, len) => {
28
28
 
29
29
  //instances
30
30
  let bodyInstance = new FasterSMA(period)
31
+ let gapInstance = new FasterSMA(parseInt(period/2))
31
32
 
32
33
  for(let x = 0; x < len; x++)
33
34
  {
34
- const prev = inputOhlcv[x-1]
35
35
  const {open, high, low, close} = inputOhlcv[x]
36
- const gapSize = (typeof prev !== 'undefined') ? Math.abs(prev.close - open) : null
36
+ const gapSize = (typeof inputOhlcv[x-1] !== 'undefined')
37
+ ? calculateHighLowEmptyGaps(inputOhlcv[x], inputOhlcv[x-1])
38
+ : null
37
39
  let bodySizeMean = null
40
+ let gapSizeMean = null
38
41
  const bodySize = getSize(open, close)
39
42
  let topSize
40
43
  let bottomSize
@@ -53,28 +56,36 @@ const getCandlesStudies = (inputOhlcv, period = 20, len) => {
53
56
 
54
57
  bodyInstance.update(bodySize)
55
58
 
59
+ if(gapSize)
60
+ {
61
+ gapInstance.update(gapSize)
62
+ }
63
+
64
+
56
65
  try
57
66
  {
58
67
  bodySizeMean = bodyInstance.getResult()
68
+ gapSizeMean = gapInstance.getResult()
59
69
  }
60
70
  catch(err)
61
71
  {
62
72
  bodySizeMean = null
73
+ gapSizeMean = null
63
74
  }
64
75
 
65
76
  candle_direction[x] = candleDirection
66
77
 
67
78
  //body
68
- candle_body_size[x] = classifySize(bodySize, bodySizeMean)
79
+ candle_body_size[x] = classifySize(bodySize, bodySizeMean, 0.25)
69
80
 
70
81
  //top
71
- candle_top_size[x] = classifySize(topSize, bodySizeMean)
82
+ candle_top_size[x] = classifySize(topSize, bodySizeMean, 0.25)
72
83
 
73
84
  //bottom
74
- candle_bottom_size[x] = classifySize(bottomSize, bodySizeMean)
85
+ candle_bottom_size[x] = classifySize(bottomSize, bodySizeMean, 0.25)
75
86
 
76
87
  //gap
77
- candle_gap_size[x] = classifySize(gapSize, bodySizeMean)
88
+ candle_gap_size[x] = classifySize(gapSize, gapSizeMean, 0.25)
78
89
  }
79
90
 
80
91
  return {
@@ -88,10 +99,46 @@ const getCandlesStudies = (inputOhlcv, period = 20, len) => {
88
99
 
89
100
 
90
101
  // 1 for large, 0.5 for medium and 0 for small
91
- const classifySize = (value, mean) => {
102
+ const classifySize = (value, mean, number = 0.25) => {
92
103
 
93
104
  if(value === null || mean === null) return null
94
- if(value > mean * 1.25) return 1
95
- else if(value < mean * 0.75) return 0
96
- else return 0.5
105
+ if(value > mean * (number*5)) return 1
106
+ else if(value < mean * (number*3)) return 0
107
+ else return number * 2
108
+ }
109
+
110
+ const calculateHighLowEmptyGaps = (current, prev) => {
111
+ // This function calculates the empty gaps between the current high/low and the previous high/low.
112
+ // Gaps are zones where the highest highs and lowest lows of the previous and current candles do not touch.
113
+ // If any of the values overlap, the gapSize is 0.
114
+
115
+ if (!prev) return null; // No previous candle, so no gap
116
+
117
+ const {open, high, low, close } = current;
118
+ const { high: prevHigh, low: prevLow } = prev;
119
+
120
+ const highs = [high, prevHigh]
121
+ const lows = [low, prevLow]
122
+
123
+
124
+ if(close > open)
125
+ {
126
+ highs.push(close)
127
+ lows.push(open)
128
+ }
129
+ else
130
+ {
131
+ highs.push(open)
132
+ lows.push(close)
133
+ }
134
+
135
+
136
+ const maxHigh = Math.max(high, prevHigh)
137
+ const minLow = Math.min(low, prevLow)
138
+ const fullSize = maxHigh - minLow
139
+ const prevSize = Math.abs(prevHigh - prevLow)
140
+ const currentSize = Math.abs(high-low)
141
+ const gapSize = fullSize - (prevSize+currentSize)
142
+
143
+ return (gapSize > 0) ? gapSize : 0.01
97
144
  }
@@ -1,6 +1,10 @@
1
+ const eq = (a, b) => a === b
2
+ const gt = (a, b) => a > b
3
+ const lt = (a, b) => a < b
4
+
1
5
 
2
6
  // Function to find crosses between two arrays: fast and slow
3
- export const findCrosses = ({fast, slow, precision}) => {
7
+ export const findCrosses = ({fast, slow}) => {
4
8
  // Map states based on comparison of fast and slow arrays
5
9
 
6
10
  const dataLength = fast.length
@@ -10,23 +14,6 @@ export const findCrosses = ({fast, slow, precision}) => {
10
14
  throw Error('fast and slow do not have the same length')
11
15
  }
12
16
 
13
- let eq
14
- let gt
15
- let lt
16
-
17
- if(precision)
18
- {
19
- eq = (a, b) => a.eq(b)
20
- gt = (a, b) => a.gt(b)
21
- lt = (a, b) => a.lt(b)
22
- }
23
- else
24
- {
25
- eq = (a, b) => a === b
26
- gt = (a, b) => a > b
27
- lt = (a, b) => a < b
28
- }
29
-
30
17
  const state = new Array(dataLength).fill(null)
31
18
 
32
19
  for(let x = 0; x < dataLength; x++)
@@ -39,19 +26,19 @@ export const findCrosses = ({fast, slow, precision}) => {
39
26
  else if(eq(f, s)){
40
27
  if(gt(fast[x-1], slow[x-1]))
41
28
  {
42
- value = 'up'
29
+ value = 1 //up
43
30
  }
44
31
  else if(lt(fast[x-1], slow[x-1]))
45
32
  {
46
- value = 'down'
33
+ value = 0 //down
47
34
  }
48
35
  else
49
36
  {
50
- value = 'neutral'
37
+ value = 0.5 //neutral
51
38
  }
52
39
  }
53
- else if(gt(f, s)) value = 'up'
54
- else if(lt(f, s)) value = 'down'
40
+ else if(gt(f, s)) value = 1
41
+ else if(lt(f, s)) value = 0
55
42
 
56
43
  state[x] = value
57
44
  }
@@ -59,9 +46,14 @@ export const findCrosses = ({fast, slow, precision}) => {
59
46
 
60
47
 
61
48
  const groups = groupConsecutiveValues(state)
62
- const groupLengths = groups.map(g => g.length)
63
49
 
64
- //console.log(JSON.stringify(groups))
50
+ return flatGroupsToNumArr(groups)
51
+ }
52
+
53
+
54
+ const flatGroupsToNumArr = groups => {
55
+
56
+ const groupLengths = groups.map(g => g.length)
65
57
 
66
58
  return groups.map((group, gIndex) => {
67
59
  let initialValue = groupLengths[gIndex]
@@ -69,15 +61,15 @@ export const findCrosses = ({fast, slow, precision}) => {
69
61
  return group.map((s, i) => {
70
62
  let v = initialValue - i
71
63
 
72
- if(s === 'neutral')
64
+ if(s === 0.5)
73
65
  {
74
66
  v = 0
75
67
  }
76
- if(s === 'up')
68
+ if(s === 1)
77
69
  {
78
70
  v = v * 1
79
71
  }
80
- if(s === 'down')
72
+ if(s === 0)
81
73
  {
82
74
  v = v * -1
83
75
  }
@@ -85,11 +77,11 @@ export const findCrosses = ({fast, slow, precision}) => {
85
77
  return v
86
78
  }).reverse()
87
79
  }).flat()
88
-
89
80
  }
90
81
 
82
+
91
83
  // Helper function to group consecutive values
92
- const groupConsecutiveValues = arr => {
84
+ export const groupConsecutiveValues = arr => {
93
85
  if (arr.length === 0) return []
94
86
 
95
87
  return arr.reduce((acc, currentValue, index, array) => {
@@ -118,7 +110,7 @@ const groupConsecutiveValues = arr => {
118
110
 
119
111
  export const crossPairs = (main, arr) => {
120
112
 
121
- const {verticalOhlcv, precision, big, len} = main
113
+ const {verticalOhlcv, len} = main
122
114
  const slowNumArrCache = {};
123
115
  const x = {}
124
116
  const c = {}
@@ -130,7 +122,7 @@ export const crossPairs = (main, arr) => {
130
122
  // Prepare slowNumArr if 'slow' is a number
131
123
  if (typeof slow === 'number' && !slowNumArrCache[slow]) {
132
124
 
133
- slowNumArrCache[slow] = Array(len).fill(big(slow))
125
+ slowNumArrCache[slow] = Array(len).fill(slow)
134
126
  }
135
127
 
136
128
  const crossName = `${fast}_x_${slow}`
@@ -153,7 +145,7 @@ export const crossPairs = (main, arr) => {
153
145
  //cross created from 2 columns
154
146
  else if (verticalOhlcv[fast] && verticalOhlcv[slow]) {
155
147
 
156
- const cross = findCrosses({fast: verticalOhlcv[fast], slow: verticalOhlcv[slow], precision});
148
+ const cross = findCrosses({fast: verticalOhlcv[fast], slow: verticalOhlcv[slow]});
157
149
  x[crossName] = cross
158
150
 
159
151
  if(typeof count !== 'undefined')
@@ -164,7 +156,7 @@ export const crossPairs = (main, arr) => {
164
156
  }
165
157
  //cross created from 1 column and an number
166
158
  else if (verticalOhlcv[fast] && slowNumArrCache[slow]) {
167
- const cross = findCrosses({fast: verticalOhlcv[fast], slow: slowNumArrCache[slow], precision})
159
+ const cross = findCrosses({fast: verticalOhlcv[fast], slow: slowNumArrCache[slow]})
168
160
  x[crossName] = cross
169
161
 
170
162
  if(typeof count !== 'undefined'){
@@ -177,4 +169,54 @@ export const crossPairs = (main, arr) => {
177
169
  }
178
170
 
179
171
  return {x, c}
172
+ }
173
+
174
+
175
+ export const findLinearDirection = (main, keyName) => {
176
+
177
+ const {verticalOhlcv} = main
178
+
179
+ if(!verticalOhlcv.hasOwnProperty(keyName)) throw Error(`property ${keyName} not found in verticalOhlcv. Invoked by findDirectionCross.`)
180
+
181
+ const arr = verticalOhlcv[keyName]
182
+ const len = arr.length
183
+ const state = new Array(len).fill(null)
184
+
185
+
186
+ for(let x = 0; x < len; x++)
187
+ {
188
+ if(x > 0 && arr[x] !== null)
189
+ {
190
+ let curr = arr[x]
191
+ let prev = arr[x-1]
192
+
193
+ if(gt(curr, prev))
194
+ {
195
+ state[x] = 1 //up
196
+ }
197
+ else if(lt(curr, prev))
198
+ {
199
+ state[x] = 0 //down
200
+ }
201
+ else
202
+ {
203
+ state[x] = 0.5 //neutral
204
+ }
205
+ }
206
+ }
207
+
208
+ return state
209
+ }
210
+
211
+ export const findDirectionCross = (main, keyName) => {
212
+
213
+
214
+ const {verticalOhlcv} = main
215
+
216
+ if(!verticalOhlcv.hasOwnProperty(keyName)) throw Error(`property ${keyName} not found in verticalOhlcv. Invoked by findDirectionCross.`)
217
+
218
+ const state = findLinearDirection(main, keyName)
219
+ const groups = groupConsecutiveValues(state)
220
+
221
+ return flatGroupsToNumArr(groups)
180
222
  }
@@ -1,7 +1,7 @@
1
1
  //true if first row date starts with yyyy-mm-dd date
2
2
  const validateFirstDate = arr => arr[0].hasOwnProperty('date') && typeof arr[0].date === 'string' && /^\d{4}-\d{2}-\d{2}/.test(arr[0].date)
3
3
 
4
- export const parseOhlcvToVertical = (input, len, big) => {
4
+ export const parseOhlcvToVertical = (input, len) => {
5
5
  const numberColsKeys = ['open', 'high', 'low', 'close', 'volume']
6
6
  const numberColsKeysSet = new Set(numberColsKeys)
7
7
  const verticalOhlcv = {}
@@ -38,12 +38,11 @@ export const parseOhlcvToVertical = (input, len, big) => {
38
38
  for (let x = 0; x < len; x++) {
39
39
  const current = input[x]
40
40
 
41
- // Process numerical columns with 'big' function
42
- verticalOhlcv.open[x] = big(current.open)
43
- verticalOhlcv.high[x] = big(current.high)
44
- verticalOhlcv.low[x] = big(current.low)
45
- verticalOhlcv.close[x] = big(current.close)
46
- verticalOhlcv.volume[x] = big(current.volume)
41
+ verticalOhlcv.open[x] = current.open
42
+ verticalOhlcv.high[x] = current.high
43
+ verticalOhlcv.low[x] = current.low
44
+ verticalOhlcv.close[x] = current.close
45
+ verticalOhlcv.volume[x] = current.volume
47
46
 
48
47
  // Process other keys
49
48
  for (const key of otherKeys) {
@@ -67,8 +66,4 @@ export const parseOhlcvToVertical = (input, len, big) => {
67
66
  }
68
67
 
69
68
  return verticalOhlcv
70
- }
71
-
72
-
73
-
74
-
69
+ }