garch 1.2.2 → 1.2.3

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/README.md CHANGED
@@ -33,7 +33,8 @@ const result = predict(candles, '4h');
33
33
  // {
34
34
  // currentPrice: 97500,
35
35
  // sigma: 0.012, // 1.2% per-period volatility
36
- // move: 1177, // upward expected move (upper - current)
36
+ // move: 1177, // upward expected move (upper - current), in dollars
37
+ // movePercent: 1.21, // upward expected move, in percent (0–100)
37
38
  // upperPrice: 98677, // P·exp(+σ) — ceiling
38
39
  // lowerPrice: 96337, // P·exp(-σ) — floor
39
40
  // modelType: 'egarch',
@@ -87,7 +88,8 @@ Higher confidence = wider corridor. `sigma` stays the same (it's the model's vol
87
88
  interface PredictionResult {
88
89
  currentPrice: number; // Reference price
89
90
  sigma: number; // One-period volatility (decimal, e.g. 0.012 = 1.2%)
90
- move: number; // Upward price move = upperPrice - currentPrice
91
+ move: number; // Upward price move = upperPrice - currentPrice (dollars)
92
+ movePercent: number; // Upward price move in percent (0–100), e.g. 1.21 = 1.21%
91
93
  upperPrice: number; // P · exp(+z·σ)
92
94
  lowerPrice: number; // P · exp(-z·σ)
93
95
  modelType: 'garch' | 'egarch' | 'gjr-garch' | 'har-rv' | 'novas'; // Auto-selected model
@@ -108,7 +110,8 @@ const range = predictRange(candles, '4h', 5);
108
110
  // {
109
111
  // currentPrice: 97500,
110
112
  // sigma: 0.027, // cumulative ~2.7% over 5 candles
111
- // move: 2669, // upward expected move
113
+ // move: 2669, // upward expected move, in dollars
114
+ // movePercent: 2.74, // upward expected move, in percent (0–100)
112
115
  // upperPrice: 100169, // P·exp(+z·σ)
113
116
  // lowerPrice: 94901, // P·exp(-z·σ)
114
117
  // modelType: 'egarch',
package/build/index.cjs CHANGED
@@ -1793,6 +1793,7 @@ function predict(candles, interval, currentPrice, confidence = 0.6827) {
1793
1793
  currentPrice,
1794
1794
  sigma,
1795
1795
  move: upperPrice - currentPrice,
1796
+ movePercent: (upperPrice / currentPrice - 1) * 100,
1796
1797
  upperPrice,
1797
1798
  lowerPrice,
1798
1799
  reliable: checkReliable(fit),
@@ -1819,6 +1820,7 @@ function predictRange(candles, interval, steps, currentPrice, confidence = 0.682
1819
1820
  currentPrice,
1820
1821
  sigma,
1821
1822
  move: upperPrice - currentPrice,
1823
+ movePercent: (upperPrice / currentPrice - 1) * 100,
1822
1824
  upperPrice,
1823
1825
  lowerPrice,
1824
1826
  reliable: checkReliable(fit),
package/build/index.mjs CHANGED
@@ -1791,6 +1791,7 @@ function predict(candles, interval, currentPrice, confidence = 0.6827) {
1791
1791
  currentPrice,
1792
1792
  sigma,
1793
1793
  move: upperPrice - currentPrice,
1794
+ movePercent: (upperPrice / currentPrice - 1) * 100,
1794
1795
  upperPrice,
1795
1796
  lowerPrice,
1796
1797
  reliable: checkReliable(fit),
@@ -1817,6 +1818,7 @@ function predictRange(candles, interval, steps, currentPrice, confidence = 0.682
1817
1818
  currentPrice,
1818
1819
  sigma,
1819
1820
  move: upperPrice - currentPrice,
1821
+ movePercent: (upperPrice / currentPrice - 1) * 100,
1820
1822
  upperPrice,
1821
1823
  lowerPrice,
1822
1824
  reliable: checkReliable(fit),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "garch",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "description": "GARCH and EGARCH volatility models for TypeScript",
5
5
  "type": "module",
6
6
  "main": "./build/index.cjs",
package/types.d.ts CHANGED
@@ -501,6 +501,7 @@ interface PredictionResult {
501
501
  currentPrice: number;
502
502
  sigma: number;
503
503
  move: number;
504
+ movePercent: number;
504
505
  upperPrice: number;
505
506
  lowerPrice: number;
506
507
  modelType: 'garch' | 'egarch' | 'gjr-garch' | 'har-rv' | 'novas';