ohlcv-indicators 3.5.43 → 3.5.44

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,6 +1,6 @@
1
1
  {
2
2
  "name": "ohlcv-indicators",
3
- "version": "3.5.43",
3
+ "version": "3.5.44",
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",
@@ -65,8 +65,8 @@ export const vidya = (main, index, size, momentum, options = {}) => {
65
65
  const vol = verticalOhlcv.volume[index];
66
66
  const prevCross = index > 0 ? verticalOhlcv[keys.cross][index - 1] : 0;
67
67
 
68
- const highest = (inst.liquidity.high.length === liquidityLookback) ? Math.max(...inst.liquidity.high) : NaN
69
- const lowest = (inst.liquidity.low.length === liquidityLookback) ? Math.min(...inst.liquidity.low) : NaN
68
+ const highestHigh = (inst.liquidity.high.length === liquidityLookback) ? Math.max(...inst.liquidity.high) : NaN
69
+ const lowestLow = (inst.liquidity.low.length === liquidityLookback) ? Math.min(...inst.liquidity.low) : NaN
70
70
 
71
71
  // Compute ATR (Wilder's RMA)
72
72
  if (index > 0) {
@@ -145,20 +145,16 @@ export const vidya = (main, index, size, momentum, options = {}) => {
145
145
  const deltaPct = (inst.upVol - inst.downVol) / avgVol;
146
146
 
147
147
  // Trend-based boundary (reset on crossover)
148
- const trendValue = (!crossUp && !crossDown)
149
- ? (inst.isTrendUp ? lower : upper)
150
- : NaN;
151
-
152
-
148
+ const trendValue = (inst.isTrendUp) ? lower : upper;
153
149
  let liquidity = NaN
154
150
 
155
151
  if(cross > 0)
156
152
  {
157
- liquidity = lowest
153
+ liquidity = lowestLow
158
154
  }
159
155
  else if(cross < 0)
160
156
  {
161
- liquidity = highest
157
+ liquidity = highestHigh
162
158
  }
163
159
 
164
160
  // Push outputs