ohlcv-indicators 1.7.1 → 1.7.2
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.
|
|
3
|
+
"version": "1.7.2",
|
|
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",
|
|
@@ -139,18 +139,13 @@ const getCandlesStudies = (inputOhlcv, period = 20, len) => {
|
|
|
139
139
|
const classifySize = (value, mean, threshold = 0.25) => {
|
|
140
140
|
if (value === null || mean === null) return null;
|
|
141
141
|
|
|
142
|
-
const largeThreshold = mean * (1 + threshold * 4); //
|
|
143
|
-
const
|
|
144
|
-
const smallThreshold = mean * (1 - threshold * 2); // Sensitively tuned for small
|
|
142
|
+
const largeThreshold = mean * (1 + threshold * 4); // Adjusted threshold for 'large'
|
|
143
|
+
const smallThreshold = mean * (1 - threshold * 2); // Adjusted threshold for 'small'
|
|
145
144
|
|
|
146
145
|
if (value > largeThreshold) {
|
|
147
146
|
return 1; // Large
|
|
148
|
-
} else if (value > mediumThreshold) {
|
|
149
|
-
return 0.75; // Medium-Large
|
|
150
|
-
} else if (value > mean) {
|
|
151
|
-
return 0.5; // Medium
|
|
152
147
|
} else if (value > smallThreshold) {
|
|
153
|
-
return 0.
|
|
148
|
+
return 0.5; // Medium
|
|
154
149
|
} else {
|
|
155
150
|
return 0; // Small
|
|
156
151
|
}
|