lightweight-charts-indicators 0.17.0 → 0.18.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/README.md CHANGED
@@ -10,7 +10,7 @@
10
10
  npm install lightweight-charts-indicators oakscriptjs lightweight-charts
11
11
  ```
12
12
 
13
- `oakscriptjs` is a peer dependency: version 0.11.2 or later, below 0.12. `lightweight-charts` 5 is only needed for
13
+ `oakscriptjs` is a peer dependency: version 0.14.0 or later, below 0.15. `lightweight-charts` 5 is only needed for
14
14
  the renderer.
15
15
 
16
16
  ## Quick Start
@@ -7,8 +7,9 @@
7
7
  * 3. Stochastic normalize result again, smooth with factor
8
8
  * The original is an overlay (drawn on the price chart) and draws its one STC plot only ('Schaff_TC', red,
9
9
  * width 1): no markers, bands, fills or middle line.
10
- * Pine semantics: the stochastics' lowest / highest are na until their window is full; meanwhile f1 / f2 keep their
11
- * previous value (0 at first), so the STC is 0 from the first bar until both windows are full.
10
+ * Pine semantics: the stochastics' lowest / highest are na for the first `length - 1` bars and skip the na values of
11
+ * their window (the MACD is na until the slow EMA starts); while they are na f1 / f2 keep their previous value (0 at
12
+ * first), so the STC is 0 until the MACD has its first values.
12
13
  *
13
14
  * Reference: "Schaff Trend Cycle" by LazyBear
14
15
  */
@@ -1 +1 @@
1
- {"version":3,"file":"schaff-trend-cycle.d.ts","sourceRoot":"","sources":["../../src/community/schaff-trend-cycle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAuB,KAAK,eAAe,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,KAAK,GAAG,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAEtI,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,UAAU,CA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12 +10988,12 @@ var metadata96 = {
10988
10988
  function windowExtreme(a, i, len, max35) {
10989
10989
  if (i - len + 1 < 0)
10990
10990
  return NaN;
10991
- let out = a[i];
10991
+ let out = NaN;
10992
10992
  for (let k = i - len + 1; k <= i; k++) {
10993
10993
  const v = a[k];
10994
10994
  if (Number.isNaN(v))
10995
- return NaN;
10996
- if (max35 ? v > out : v < out)
10995
+ continue;
10996
+ if (Number.isNaN(out) || (max35 ? v > out : v < out))
10997
10997
  out = v;
10998
10998
  }
10999
10999
  return out;
@@ -407961,4 +407961,4 @@ var registryPart12 = [
407961
407961
  }
407962
407962
  ];
407963
407963
  var indicatorRegistry = [...registryPart1, ...registryPart11, ...registryPart2, ...registryPart3, ...registryPart4, ...registryPart5, ...registryPart6, ...registryPart7, ...registryPart8, ...registryPart9, ...registryPart10, ...registryPart12].map(withReferenceNames).map(withValueFormat).map(withStyleOutputs).map(withAlertConditions);
407964
- var version = "0.17.0";
407964
+ var version = "0.18.0";
package/dist/index.d.ts CHANGED
@@ -3717,5 +3717,5 @@ export type { ChartContext, VisibleRange, SymbolRequest, SymbolInfo } from './ch
3717
3717
  export { MissingSymbolDataError, symbolBarsOf } from './chart-context';
3718
3718
  export { mintickOf, timezoneOf, tickeridOf, tickerOf, symbolTypeOf, currencyOf, basecurrencyOf, rootOf, foregroundColorOf, backgroundColorOf, lastBarConfirmedOf, nowOf, visibleRangeOf, } from './chart-context';
3719
3719
  export { securityOther, securityOtherValues, securityLowerTf, otherSymbolChart, spreadSymbols, spreadBars, spreadOptions, type OtherSymbolOptions, type OtherSymbolChart, type SymbolCalendar, } from './other-symbol';
3720
- export declare const version = "0.17.0";
3720
+ export declare const version = "0.18.0";
3721
3721
  //# sourceMappingURL=index.d.ts.map
package/dist/index.mjs CHANGED
@@ -7412,12 +7412,12 @@ var metadata96 = {
7412
7412
  function windowExtreme(a, i, len, max35) {
7413
7413
  if (i - len + 1 < 0)
7414
7414
  return NaN;
7415
- let out = a[i];
7415
+ let out = NaN;
7416
7416
  for (let k = i - len + 1; k <= i; k++) {
7417
7417
  const v = a[k];
7418
7418
  if (Number.isNaN(v))
7419
- return NaN;
7420
- if (max35 ? v > out : v < out)
7419
+ continue;
7420
+ if (Number.isNaN(out) || (max35 ? v > out : v < out))
7421
7421
  out = v;
7422
7422
  }
7423
7423
  return out;
@@ -408286,7 +408286,7 @@ var registryPart12 = [
408286
408286
  }
408287
408287
  ];
408288
408288
  var indicatorRegistry = [...registryPart1, ...registryPart11, ...registryPart2, ...registryPart3, ...registryPart4, ...registryPart5, ...registryPart6, ...registryPart7, ...registryPart8, ...registryPart9, ...registryPart10, ...registryPart12].map(withReferenceNames).map(withValueFormat).map(withStyleOutputs).map(withAlertConditions);
408289
- var version = "0.17.0";
408289
+ var version = "0.18.0";
408290
408290
  export {
408291
408291
  ADR,
408292
408292
  ADX,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lightweight-charts-indicators",
3
- "version": "0.17.0",
3
+ "version": "0.18.0",
4
4
  "type": "module",
5
5
  "description": "1869 technical analysis indicators for the lightweight-charts library",
6
6
  "main": "dist/index.cjs",
@@ -73,7 +73,7 @@
73
73
  "homepage": "https://github.com/deepentropy/lightweight-charts-indicators#readme",
74
74
  "peerDependencies": {
75
75
  "lightweight-charts": ">=5.2.0 <6.0.0",
76
- "oakscriptjs": ">=0.13.0 <0.14.0"
76
+ "oakscriptjs": ">=0.14.0 <0.15.0"
77
77
  },
78
78
  "peerDependenciesMeta": {
79
79
  "lightweight-charts": {
@@ -84,7 +84,7 @@
84
84
  "@types/node": "^20.10.6",
85
85
  "esbuild": "^0.19.11",
86
86
  "lightweight-charts": "^5.2.1",
87
- "oakscriptjs": "^0.13.2",
87
+ "oakscriptjs": "^0.14.0",
88
88
  "rimraf": "^6.1.0",
89
89
  "typescript": "^5.3.3",
90
90
  "vite": "^5.4.0",