ohlcv-indicators 1.7.5 → 1.7.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ohlcv-indicators",
3
- "version": "1.7.5",
3
+ "version": "1.7.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",
@@ -122,17 +122,17 @@ const classifyChange = (value, mean, standardDeviation = 0.5) => {
122
122
  if (value >= largePositiveThreshold) {
123
123
  return 1; // Large positive
124
124
  } else if (value >= mediumPositiveThreshold) {
125
- return 0.75; // Medium positive
125
+ return 0.875; // Medium positive
126
126
  } else if (value >= smallPositiveThreshold) {
127
- return 0.25; // Small positive
127
+ return 0.625; // Small positive
128
128
  } else if (value <= largeNegativeThreshold) {
129
- return -1; // Large negative
129
+ return 0; // Large negative
130
130
  } else if (value <= mediumNegativeThreshold) {
131
- return -0.75; // Medium negative
131
+ return 0.125; // Medium negative
132
132
  } else if (value <= smallNegativeThreshold) {
133
- return -0.25; // Small negative
133
+ return 0.375; // Small negative
134
134
  } else {
135
- return 0; // No significant change
135
+ return 0.5; // No significant change
136
136
  }
137
137
  };
138
138
 
@@ -147,14 +147,14 @@ const classifySize = (value, mean, standardDeviation = 1.5) => {
147
147
  const verySmallThreshold = mean - (1.5 * standardDeviation); // Very small (1.5σ below mean)
148
148
 
149
149
  if (value > largeThreshold) {
150
- return 1; // Large
150
+ return 1; // Large
151
151
  } else if (value > mediumThreshold) {
152
- return 0.75; // Medium
152
+ return 0.875; // Medium
153
153
  } else if (value > smallThreshold) {
154
- return 0.5; // Small
154
+ return 0.625; // Small
155
155
  } else if (value > verySmallThreshold) {
156
- return 0.25; // Very small
156
+ return 0.375; // Very small
157
157
  } else {
158
- return 0; // Insignificant
158
+ return 0.125; // Insignificant
159
159
  }
160
160
  };