lightweight-charts-indicators 0.1.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.
Files changed (149) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +271 -0
  3. package/dist/adr.d.ts +57 -0
  4. package/dist/adr.d.ts.map +1 -0
  5. package/dist/adx.d.ts +34 -0
  6. package/dist/adx.d.ts.map +1 -0
  7. package/dist/alma.d.ts +61 -0
  8. package/dist/alma.d.ts.map +1 -0
  9. package/dist/aroon.d.ts +34 -0
  10. package/dist/aroon.d.ts.map +1 -0
  11. package/dist/atr.d.ts +59 -0
  12. package/dist/atr.d.ts.map +1 -0
  13. package/dist/awesome-oscillator.d.ts +34 -0
  14. package/dist/awesome-oscillator.d.ts.map +1 -0
  15. package/dist/bb-bandwidth.d.ts +41 -0
  16. package/dist/bb-bandwidth.d.ts.map +1 -0
  17. package/dist/bb-percent-b.d.ts +37 -0
  18. package/dist/bb-percent-b.d.ts.map +1 -0
  19. package/dist/bb.d.ts +65 -0
  20. package/dist/bb.d.ts.map +1 -0
  21. package/dist/bbtrend.d.ts +36 -0
  22. package/dist/bbtrend.d.ts.map +1 -0
  23. package/dist/bop.d.ts +57 -0
  24. package/dist/bop.d.ts.map +1 -0
  25. package/dist/bull-bear-power.d.ts +32 -0
  26. package/dist/bull-bear-power.d.ts.map +1 -0
  27. package/dist/cci.d.ts +33 -0
  28. package/dist/cci.d.ts.map +1 -0
  29. package/dist/chaikin-mf.d.ts +33 -0
  30. package/dist/chaikin-mf.d.ts.map +1 -0
  31. package/dist/chaikin-oscillator.d.ts +37 -0
  32. package/dist/chaikin-oscillator.d.ts.map +1 -0
  33. package/dist/chande-kroll-stop.d.ts +47 -0
  34. package/dist/chande-kroll-stop.d.ts.map +1 -0
  35. package/dist/chande-mo.d.ts +32 -0
  36. package/dist/chande-mo.d.ts.map +1 -0
  37. package/dist/choppiness.d.ts +34 -0
  38. package/dist/choppiness.d.ts.map +1 -0
  39. package/dist/coppock-curve.d.ts +37 -0
  40. package/dist/coppock-curve.d.ts.map +1 -0
  41. package/dist/dema.d.ts +33 -0
  42. package/dist/dema.d.ts.map +1 -0
  43. package/dist/dmi.d.ts +49 -0
  44. package/dist/dmi.d.ts.map +1 -0
  45. package/dist/donchian.d.ts +60 -0
  46. package/dist/donchian.d.ts.map +1 -0
  47. package/dist/dpo.d.ts +34 -0
  48. package/dist/dpo.d.ts.map +1 -0
  49. package/dist/ease-of-movement.d.ts +35 -0
  50. package/dist/ease-of-movement.d.ts.map +1 -0
  51. package/dist/elder-force.d.ts +33 -0
  52. package/dist/elder-force.d.ts.map +1 -0
  53. package/dist/ema.d.ts +33 -0
  54. package/dist/ema.d.ts.map +1 -0
  55. package/dist/envelope.d.ts +38 -0
  56. package/dist/envelope.d.ts.map +1 -0
  57. package/dist/fisher-transform.d.ts +44 -0
  58. package/dist/fisher-transform.d.ts.map +1 -0
  59. package/dist/historical-volatility.d.ts +36 -0
  60. package/dist/historical-volatility.d.ts.map +1 -0
  61. package/dist/hma.d.ts +32 -0
  62. package/dist/hma.d.ts.map +1 -0
  63. package/dist/ichimoku.d.ts +64 -0
  64. package/dist/ichimoku.d.ts.map +1 -0
  65. package/dist/index.cjs +5532 -0
  66. package/dist/index.d.ts +207 -0
  67. package/dist/index.d.ts.map +1 -0
  68. package/dist/index.mjs +5511 -0
  69. package/dist/keltner.d.ts +68 -0
  70. package/dist/keltner.d.ts.map +1 -0
  71. package/dist/klinger.d.ts +46 -0
  72. package/dist/klinger.d.ts.map +1 -0
  73. package/dist/lsma.d.ts +33 -0
  74. package/dist/lsma.d.ts.map +1 -0
  75. package/dist/ma-cross.d.ts +34 -0
  76. package/dist/ma-cross.d.ts.map +1 -0
  77. package/dist/ma-ribbon.d.ts +63 -0
  78. package/dist/ma-ribbon.d.ts.map +1 -0
  79. package/dist/macd.d.ts +34 -0
  80. package/dist/macd.d.ts.map +1 -0
  81. package/dist/mass-index.d.ts +31 -0
  82. package/dist/mass-index.d.ts.map +1 -0
  83. package/dist/mcginley-dynamic.d.ts +32 -0
  84. package/dist/mcginley-dynamic.d.ts.map +1 -0
  85. package/dist/median.d.ts +35 -0
  86. package/dist/median.d.ts.map +1 -0
  87. package/dist/mfi.d.ts +32 -0
  88. package/dist/mfi.d.ts.map +1 -0
  89. package/dist/momentum.d.ts +32 -0
  90. package/dist/momentum.d.ts.map +1 -0
  91. package/dist/obv.d.ts +30 -0
  92. package/dist/obv.d.ts.map +1 -0
  93. package/dist/parabolic-sar.d.ts +62 -0
  94. package/dist/parabolic-sar.d.ts.map +1 -0
  95. package/dist/price-oscillator.d.ts +40 -0
  96. package/dist/price-oscillator.d.ts.map +1 -0
  97. package/dist/pvt.d.ts +30 -0
  98. package/dist/pvt.d.ts.map +1 -0
  99. package/dist/rma.d.ts +33 -0
  100. package/dist/rma.d.ts.map +1 -0
  101. package/dist/roc.d.ts +32 -0
  102. package/dist/roc.d.ts.map +1 -0
  103. package/dist/rsi.d.ts +32 -0
  104. package/dist/rsi.d.ts.map +1 -0
  105. package/dist/rvi.d.ts +32 -0
  106. package/dist/rvi.d.ts.map +1 -0
  107. package/dist/sma.d.ts +61 -0
  108. package/dist/sma.d.ts.map +1 -0
  109. package/dist/smi-ergodic-oscillator.d.ts +36 -0
  110. package/dist/smi-ergodic-oscillator.d.ts.map +1 -0
  111. package/dist/smi-ergodic.d.ts +37 -0
  112. package/dist/smi-ergodic.d.ts.map +1 -0
  113. package/dist/smma.d.ts +32 -0
  114. package/dist/smma.d.ts.map +1 -0
  115. package/dist/stdev.d.ts +31 -0
  116. package/dist/stdev.d.ts.map +1 -0
  117. package/dist/stoch-rsi.d.ts +38 -0
  118. package/dist/stoch-rsi.d.ts.map +1 -0
  119. package/dist/stoch.d.ts +33 -0
  120. package/dist/stoch.d.ts.map +1 -0
  121. package/dist/supertrend.d.ts +60 -0
  122. package/dist/supertrend.d.ts.map +1 -0
  123. package/dist/tema.d.ts +33 -0
  124. package/dist/tema.d.ts.map +1 -0
  125. package/dist/trend-strength.d.ts +34 -0
  126. package/dist/trend-strength.d.ts.map +1 -0
  127. package/dist/trix.d.ts +43 -0
  128. package/dist/trix.d.ts.map +1 -0
  129. package/dist/tsi.d.ts +36 -0
  130. package/dist/tsi.d.ts.map +1 -0
  131. package/dist/ultimate-oscillator.d.ts +48 -0
  132. package/dist/ultimate-oscillator.d.ts.map +1 -0
  133. package/dist/volume-oscillator.d.ts +34 -0
  134. package/dist/volume-oscillator.d.ts.map +1 -0
  135. package/dist/vortex.d.ts +32 -0
  136. package/dist/vortex.d.ts.map +1 -0
  137. package/dist/vwma.d.ts +32 -0
  138. package/dist/vwma.d.ts.map +1 -0
  139. package/dist/williams-alligator.d.ts +44 -0
  140. package/dist/williams-alligator.d.ts.map +1 -0
  141. package/dist/williams-r.d.ts +33 -0
  142. package/dist/williams-r.d.ts.map +1 -0
  143. package/dist/wma.d.ts +32 -0
  144. package/dist/wma.d.ts.map +1 -0
  145. package/dist/woodies-cci.d.ts +35 -0
  146. package/dist/woodies-cci.d.ts.map +1 -0
  147. package/dist/zigzag.d.ts +73 -0
  148. package/dist/zigzag.d.ts.map +1 -0
  149. package/package.json +65 -0
package/dist/trix.d.ts ADDED
@@ -0,0 +1,43 @@
1
+ /**
2
+ * TRIX Indicator
3
+ *
4
+ * Triple Exponential Average Rate of Change.
5
+ * Shows the percent rate of change of a triple exponentially smoothed moving average.
6
+ *
7
+ * Based on TradingView's TRIX indicator.
8
+ */
9
+ import { type Bar, type IndicatorResult, type InputConfig, type PlotConfig } from 'oakscriptjs';
10
+ export interface TRIXInputs {
11
+ /** EMA period length */
12
+ length: number;
13
+ }
14
+ export declare const defaultInputs: TRIXInputs;
15
+ export declare const inputConfig: InputConfig[];
16
+ export declare const plotConfig: PlotConfig[];
17
+ export declare const metadata: {
18
+ title: string;
19
+ shortTitle: string;
20
+ overlay: boolean;
21
+ };
22
+ /**
23
+ * Calculate TRIX
24
+ *
25
+ * Algorithm:
26
+ * 1. Take log of close prices
27
+ * 2. Apply EMA three times
28
+ * 3. Calculate rate of change (1-bar difference)
29
+ * 4. Multiply by 10000 for readability
30
+ */
31
+ export declare function calculate(bars: Bar[], inputs?: Partial<TRIXInputs>): IndicatorResult;
32
+ export declare const TRIX: {
33
+ calculate: typeof calculate;
34
+ metadata: {
35
+ title: string;
36
+ shortTitle: string;
37
+ overlay: boolean;
38
+ };
39
+ defaultInputs: TRIXInputs;
40
+ inputConfig: InputConfig[];
41
+ plotConfig: PlotConfig[];
42
+ };
43
+ //# sourceMappingURL=trix.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trix.d.ts","sourceRoot":"","sources":["../src/trix.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAc,KAAK,GAAG,EAAE,KAAK,eAAe,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAE5G,MAAM,WAAW,UAAU;IACzB,wBAAwB;IACxB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,aAAa,EAAE,UAE3B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,WAAW,EAEpC,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,UAAU,EAElC,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;CAIpB,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,MAAM,GAAE,OAAO,CAAC,UAAU,CAAM,GAAG,eAAe,CA+BxF;AAED,eAAO,MAAM,IAAI;;;;;;;;;;CAMhB,CAAC"}
package/dist/tsi.d.ts ADDED
@@ -0,0 +1,36 @@
1
+ /**
2
+ * True Strength Index (TSI) Indicator
3
+ *
4
+ * A momentum oscillator that uses double-smoothed price changes.
5
+ * TSI = 100 * (double_smooth(pc) / double_smooth(|pc|))
6
+ */
7
+ import { type IndicatorResult, type InputConfig, type PlotConfig, type Bar } from 'oakscriptjs';
8
+ export interface TSIInputs {
9
+ /** Long EMA period */
10
+ longLength: number;
11
+ /** Short EMA period */
12
+ shortLength: number;
13
+ /** Signal line period */
14
+ signalLength: number;
15
+ }
16
+ export declare const defaultInputs: TSIInputs;
17
+ export declare const inputConfig: InputConfig[];
18
+ export declare const plotConfig: PlotConfig[];
19
+ export declare const metadata: {
20
+ title: string;
21
+ shortTitle: string;
22
+ overlay: boolean;
23
+ };
24
+ export declare function calculate(bars: Bar[], inputs?: Partial<TSIInputs>): IndicatorResult;
25
+ export declare const TSI: {
26
+ calculate: typeof calculate;
27
+ metadata: {
28
+ title: string;
29
+ shortTitle: string;
30
+ overlay: boolean;
31
+ };
32
+ defaultInputs: TSIInputs;
33
+ inputConfig: InputConfig[];
34
+ plotConfig: PlotConfig[];
35
+ };
36
+ //# sourceMappingURL=tsi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tsi.d.ts","sourceRoot":"","sources":["../src/tsi.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAc,KAAK,eAAe,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,KAAK,GAAG,EAAE,MAAM,aAAa,CAAC;AAE5G,MAAM,WAAW,SAAS;IACxB,sBAAsB;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,uBAAuB;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,yBAAyB;IACzB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,aAAa,EAAE,SAI3B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,WAAW,EAIpC,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,UAAU,EAGlC,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;CAIpB,CAAC;AAEF,wBAAgB,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,MAAM,GAAE,OAAO,CAAC,SAAS,CAAM,GAAG,eAAe,CA8DvF;AAED,eAAO,MAAM,GAAG;;;;;;;;;;CAMf,CAAC"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Ultimate Oscillator Indicator
3
+ *
4
+ * Multi-timeframe momentum oscillator that uses weighted average of three periods.
5
+ * Designed to capture momentum across short, medium, and long-term periods.
6
+ *
7
+ * Based on TradingView's Ultimate Oscillator indicator.
8
+ */
9
+ import type { Bar } from 'oakscriptjs';
10
+ import type { InputConfig, PlotConfig } from './index.js';
11
+ export interface UltimateOscillatorInputs {
12
+ /** Fast period length */
13
+ length1: number;
14
+ /** Medium period length */
15
+ length2: number;
16
+ /** Slow period length */
17
+ length3: number;
18
+ }
19
+ export declare const defaultInputs: UltimateOscillatorInputs;
20
+ export declare const inputConfig: InputConfig[];
21
+ export declare const plotConfig: PlotConfig[];
22
+ export declare const metadata: {
23
+ title: string;
24
+ shortTitle: string;
25
+ overlay: boolean;
26
+ };
27
+ /**
28
+ * Calculate Ultimate Oscillator
29
+ *
30
+ * Algorithm:
31
+ * 1. Calculate True Range: max(high, close[1]) - min(low, close[1])
32
+ * 2. Calculate Buying Pressure: close - min(low, close[1])
33
+ * 3. Calculate average BP/TR for each period
34
+ * 4. Combine with weights: 100 * (4*avg1 + 2*avg2 + avg3) / 7
35
+ */
36
+ export declare function calculate(bars: Bar[], inputs?: Partial<UltimateOscillatorInputs>): ReturnType<typeof import('./index.js').SMA.calculate>;
37
+ export declare const UltimateOscillator: {
38
+ calculate: typeof calculate;
39
+ metadata: {
40
+ title: string;
41
+ shortTitle: string;
42
+ overlay: boolean;
43
+ };
44
+ defaultInputs: UltimateOscillatorInputs;
45
+ inputConfig: InputConfig[];
46
+ plotConfig: PlotConfig[];
47
+ };
48
+ //# sourceMappingURL=ultimate-oscillator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ultimate-oscillator.d.ts","sourceRoot":"","sources":["../src/ultimate-oscillator.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE1D,MAAM,WAAW,wBAAwB;IACvC,yBAAyB;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,2BAA2B;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,yBAAyB;IACzB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,aAAa,EAAE,wBAI3B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,WAAW,EAIpC,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,UAAU,EAElC,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;CAIpB,CAAC;AAcF;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,MAAM,GAAE,OAAO,CAAC,wBAAwB,CAAM,GAAG,UAAU,CAAC,cAAc,YAAY,EAAE,GAAG,CAAC,SAAS,CAAC,CA2D5I;AAED,eAAO,MAAM,kBAAkB;;;;;;;;;;CAM9B,CAAC"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Volume Oscillator Indicator
3
+ *
4
+ * Measures the difference between two volume EMAs as a percentage.
5
+ * osc = 100 * (shortEMA - longEMA) / longEMA
6
+ */
7
+ import { type IndicatorResult, type InputConfig, type PlotConfig, type Bar } from 'oakscriptjs';
8
+ export interface VolumeOscillatorInputs {
9
+ /** Short EMA period */
10
+ shortLength: number;
11
+ /** Long EMA period */
12
+ longLength: number;
13
+ }
14
+ export declare const defaultInputs: VolumeOscillatorInputs;
15
+ export declare const inputConfig: InputConfig[];
16
+ export declare const plotConfig: PlotConfig[];
17
+ export declare const metadata: {
18
+ title: string;
19
+ shortTitle: string;
20
+ overlay: boolean;
21
+ };
22
+ export declare function calculate(bars: Bar[], inputs?: Partial<VolumeOscillatorInputs>): IndicatorResult;
23
+ export declare const VolumeOscillator: {
24
+ calculate: typeof calculate;
25
+ metadata: {
26
+ title: string;
27
+ shortTitle: string;
28
+ overlay: boolean;
29
+ };
30
+ defaultInputs: VolumeOscillatorInputs;
31
+ inputConfig: InputConfig[];
32
+ plotConfig: PlotConfig[];
33
+ };
34
+ //# sourceMappingURL=volume-oscillator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"volume-oscillator.d.ts","sourceRoot":"","sources":["../src/volume-oscillator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAc,KAAK,eAAe,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,KAAK,GAAG,EAAE,MAAM,aAAa,CAAC;AAE5G,MAAM,WAAW,sBAAsB;IACrC,uBAAuB;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,sBAAsB;IACtB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,aAAa,EAAE,sBAG3B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,WAAW,EAGpC,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,UAAU,EAElC,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;CAIpB,CAAC;AAEF,wBAAgB,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,MAAM,GAAE,OAAO,CAAC,sBAAsB,CAAM,GAAG,eAAe,CAwCpG;AAED,eAAO,MAAM,gBAAgB;;;;;;;;;;CAM5B,CAAC"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Vortex Indicator
3
+ *
4
+ * Identifies the start of a new trend or the continuation of an existing trend.
5
+ * Consists of two oscillators: VI+ (positive) and VI- (negative).
6
+ */
7
+ import { type IndicatorResult, type InputConfig, type PlotConfig, type Bar } from 'oakscriptjs';
8
+ export interface VortexInputs {
9
+ /** Period length */
10
+ length: number;
11
+ }
12
+ export declare const defaultInputs: VortexInputs;
13
+ export declare const inputConfig: InputConfig[];
14
+ export declare const plotConfig: PlotConfig[];
15
+ export declare const metadata: {
16
+ title: string;
17
+ shortTitle: string;
18
+ overlay: boolean;
19
+ };
20
+ export declare function calculate(bars: Bar[], inputs?: Partial<VortexInputs>): IndicatorResult;
21
+ export declare const VortexIndicator: {
22
+ calculate: typeof calculate;
23
+ metadata: {
24
+ title: string;
25
+ shortTitle: string;
26
+ overlay: boolean;
27
+ };
28
+ defaultInputs: VortexInputs;
29
+ inputConfig: InputConfig[];
30
+ plotConfig: PlotConfig[];
31
+ };
32
+ //# sourceMappingURL=vortex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vortex.d.ts","sourceRoot":"","sources":["../src/vortex.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAM,KAAK,eAAe,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,KAAK,GAAG,EAAE,MAAM,aAAa,CAAC;AAEpG,MAAM,WAAW,YAAY;IAC3B,oBAAoB;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,aAAa,EAAE,YAE3B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,WAAW,EAEpC,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,UAAU,EAGlC,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;CAIpB,CAAC;AAEF,wBAAgB,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,MAAM,GAAE,OAAO,CAAC,YAAY,CAAM,GAAG,eAAe,CAkF1F;AAED,eAAO,MAAM,eAAe;;;;;;;;;;CAM3B,CAAC"}
package/dist/vwma.d.ts ADDED
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Volume Weighted Moving Average (VWMA) Indicator
3
+ *
4
+ * Hand-optimized implementation using oakscriptjs.
5
+ * A moving average weighted by volume.
6
+ */
7
+ import { type IndicatorResult, type InputConfig, type PlotConfig, type Bar, type SourceType } from 'oakscriptjs';
8
+ export interface VWMAInputs {
9
+ length: number;
10
+ src: SourceType;
11
+ }
12
+ export declare const defaultInputs: VWMAInputs;
13
+ export declare const inputConfig: InputConfig[];
14
+ export declare const plotConfig: PlotConfig[];
15
+ export declare const metadata: {
16
+ title: string;
17
+ shortTitle: string;
18
+ overlay: boolean;
19
+ };
20
+ export declare function calculate(bars: Bar[], inputs?: Partial<VWMAInputs>): IndicatorResult;
21
+ export declare const VWMA: {
22
+ calculate: typeof calculate;
23
+ metadata: {
24
+ title: string;
25
+ shortTitle: string;
26
+ overlay: boolean;
27
+ };
28
+ defaultInputs: VWMAInputs;
29
+ inputConfig: InputConfig[];
30
+ plotConfig: PlotConfig[];
31
+ };
32
+ //# sourceMappingURL=vwma.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vwma.d.ts","sourceRoot":"","sources":["../src/vwma.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAA+B,KAAK,eAAe,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,KAAK,GAAG,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9I,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,UAAU,CAAC;CACjB;AAED,eAAO,MAAM,aAAa,EAAE,UAG3B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,WAAW,EAGpC,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,UAAU,EAElC,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;CAIpB,CAAC;AAEF,wBAAgB,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,MAAM,GAAE,OAAO,CAAC,UAAU,CAAM,GAAG,eAAe,CAexF;AAED,eAAO,MAAM,IAAI;;;;;;;;;;CAAkE,CAAC"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Williams Alligator Indicator
3
+ *
4
+ * A trend-following indicator consisting of three smoothed moving averages:
5
+ * - Jaw (Blue): 13-period SMMA, shifted 8 bars
6
+ * - Teeth (Red): 8-period SMMA, shifted 5 bars
7
+ * - Lips (Green): 5-period SMMA, shifted 3 bars
8
+ */
9
+ import { type IndicatorResult, type InputConfig, type PlotConfig, type Bar } from 'oakscriptjs';
10
+ export interface WilliamsAlligatorInputs {
11
+ /** Jaw period */
12
+ jawLength: number;
13
+ /** Jaw offset */
14
+ jawOffset: number;
15
+ /** Teeth period */
16
+ teethLength: number;
17
+ /** Teeth offset */
18
+ teethOffset: number;
19
+ /** Lips period */
20
+ lipsLength: number;
21
+ /** Lips offset */
22
+ lipsOffset: number;
23
+ }
24
+ export declare const defaultInputs: WilliamsAlligatorInputs;
25
+ export declare const inputConfig: InputConfig[];
26
+ export declare const plotConfig: PlotConfig[];
27
+ export declare const metadata: {
28
+ title: string;
29
+ shortTitle: string;
30
+ overlay: boolean;
31
+ };
32
+ export declare function calculate(bars: Bar[], inputs?: Partial<WilliamsAlligatorInputs>): IndicatorResult;
33
+ export declare const WilliamsAlligator: {
34
+ calculate: typeof calculate;
35
+ metadata: {
36
+ title: string;
37
+ shortTitle: string;
38
+ overlay: boolean;
39
+ };
40
+ defaultInputs: WilliamsAlligatorInputs;
41
+ inputConfig: InputConfig[];
42
+ plotConfig: PlotConfig[];
43
+ };
44
+ //# sourceMappingURL=williams-alligator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"williams-alligator.d.ts","sourceRoot":"","sources":["../src/williams-alligator.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,KAAK,GAAG,EAAE,MAAM,aAAa,CAAC;AAEhG,MAAM,WAAW,uBAAuB;IACtC,iBAAiB;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,mBAAmB;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,aAAa,EAAE,uBAO3B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,WAAW,EAOpC,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,UAAU,EAIlC,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;CAIpB,CAAC;AAkCF,wBAAgB,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,MAAM,GAAE,OAAO,CAAC,uBAAuB,CAAM,GAAG,eAAe,CAsDrG;AAED,eAAO,MAAM,iBAAiB;;;;;;;;;;CAM7B,CAAC"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Williams %R Indicator
3
+ *
4
+ * A momentum indicator showing the level of the close relative to the highest high
5
+ * over a lookback period. Range: -100 to 0.
6
+ * Williams %R = -100 * (highest - close) / (highest - lowest)
7
+ */
8
+ import { type IndicatorResult, type InputConfig, type PlotConfig, type Bar } from 'oakscriptjs';
9
+ export interface WilliamsRInputs {
10
+ /** Period length */
11
+ length: number;
12
+ }
13
+ export declare const defaultInputs: WilliamsRInputs;
14
+ export declare const inputConfig: InputConfig[];
15
+ export declare const plotConfig: PlotConfig[];
16
+ export declare const metadata: {
17
+ title: string;
18
+ shortTitle: string;
19
+ overlay: boolean;
20
+ };
21
+ export declare function calculate(bars: Bar[], inputs?: Partial<WilliamsRInputs>): IndicatorResult;
22
+ export declare const WilliamsPercentRange: {
23
+ calculate: typeof calculate;
24
+ metadata: {
25
+ title: string;
26
+ shortTitle: string;
27
+ overlay: boolean;
28
+ };
29
+ defaultInputs: WilliamsRInputs;
30
+ inputConfig: InputConfig[];
31
+ plotConfig: PlotConfig[];
32
+ };
33
+ //# sourceMappingURL=williams-r.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"williams-r.d.ts","sourceRoot":"","sources":["../src/williams-r.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAc,KAAK,eAAe,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,KAAK,GAAG,EAAE,MAAM,aAAa,CAAC;AAE5G,MAAM,WAAW,eAAe;IAC9B,oBAAoB;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,aAAa,EAAE,eAE3B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,WAAW,EAEpC,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,UAAU,EAElC,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;CAIpB,CAAC;AAEF,wBAAgB,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,MAAM,GAAE,OAAO,CAAC,eAAe,CAAM,GAAG,eAAe,CA+C7F;AAED,eAAO,MAAM,oBAAoB;;;;;;;;;;CAMhC,CAAC"}
package/dist/wma.d.ts ADDED
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Weighted Moving Average (WMA) Indicator
3
+ *
4
+ * Hand-optimized implementation using oakscriptjs.
5
+ * A moving average that assigns linearly increasing weights to more recent data.
6
+ */
7
+ import { type IndicatorResult, type InputConfig, type PlotConfig, type Bar, type SourceType } from 'oakscriptjs';
8
+ export interface WMAInputs {
9
+ length: number;
10
+ src: SourceType;
11
+ }
12
+ export declare const defaultInputs: WMAInputs;
13
+ export declare const inputConfig: InputConfig[];
14
+ export declare const plotConfig: PlotConfig[];
15
+ export declare const metadata: {
16
+ title: string;
17
+ shortTitle: string;
18
+ overlay: boolean;
19
+ };
20
+ export declare function calculate(bars: Bar[], inputs?: Partial<WMAInputs>): IndicatorResult;
21
+ export declare const WMA: {
22
+ calculate: typeof calculate;
23
+ metadata: {
24
+ title: string;
25
+ shortTitle: string;
26
+ overlay: boolean;
27
+ };
28
+ defaultInputs: WMAInputs;
29
+ inputConfig: InputConfig[];
30
+ plotConfig: PlotConfig[];
31
+ };
32
+ //# sourceMappingURL=wma.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wma.d.ts","sourceRoot":"","sources":["../src/wma.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAuB,KAAK,eAAe,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,KAAK,GAAG,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAEtI,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,UAAU,CAAC;CACjB;AAED,eAAO,MAAM,aAAa,EAAE,SAG3B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,WAAW,EAGpC,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,UAAU,EAElC,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;CAIpB,CAAC;AAEF,wBAAgB,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,MAAM,GAAE,OAAO,CAAC,SAAS,CAAM,GAAG,eAAe,CAcvF;AAED,eAAO,MAAM,GAAG;;;;;;;;;;CAAkE,CAAC"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Woodies CCI Indicator
3
+ *
4
+ * Consists of CCI with a turbo CCI for faster signals.
5
+ * CCI Turbo = 6-period CCI
6
+ * CCI 14 = 14-period CCI
7
+ */
8
+ import { type IndicatorResult, type InputConfig, type PlotConfig, type Bar } from 'oakscriptjs';
9
+ export interface WoodiesCCIInputs {
10
+ /** Turbo CCI period */
11
+ turboLength: number;
12
+ /** Standard CCI period */
13
+ cciLength: number;
14
+ }
15
+ export declare const defaultInputs: WoodiesCCIInputs;
16
+ export declare const inputConfig: InputConfig[];
17
+ export declare const plotConfig: PlotConfig[];
18
+ export declare const metadata: {
19
+ title: string;
20
+ shortTitle: string;
21
+ overlay: boolean;
22
+ };
23
+ export declare function calculate(bars: Bar[], inputs?: Partial<WoodiesCCIInputs>): IndicatorResult;
24
+ export declare const WoodiesCCI: {
25
+ calculate: typeof calculate;
26
+ metadata: {
27
+ title: string;
28
+ shortTitle: string;
29
+ overlay: boolean;
30
+ };
31
+ defaultInputs: WoodiesCCIInputs;
32
+ inputConfig: InputConfig[];
33
+ plotConfig: PlotConfig[];
34
+ };
35
+ //# sourceMappingURL=woodies-cci.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"woodies-cci.d.ts","sourceRoot":"","sources":["../src/woodies-cci.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,KAAK,GAAG,EAAE,MAAM,aAAa,CAAC;AAEhG,MAAM,WAAW,gBAAgB;IAC/B,uBAAuB;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,0BAA0B;IAC1B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,aAAa,EAAE,gBAG3B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,WAAW,EAGpC,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,UAAU,EAIlC,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;CAIpB,CAAC;AAuCF,wBAAgB,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,MAAM,GAAE,OAAO,CAAC,gBAAgB,CAAM,GAAG,eAAe,CAsC9F;AAED,eAAO,MAAM,UAAU;;;;;;;;;;CAMtB,CAAC"}
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Zig Zag Indicator
3
+ *
4
+ * Identifies trend reversals by connecting pivot highs and lows
5
+ * that exceed a specified percentage deviation threshold.
6
+ *
7
+ * Based on TradingView's ZigZag indicator v8.
8
+ */
9
+ import { type ZigZagPivot, type IndicatorResult, type Bar } from 'oakscriptjs';
10
+ import type { InputConfig, PlotConfig } from './index.js';
11
+ /**
12
+ * ZigZag indicator input parameters
13
+ */
14
+ export interface ZigZagInputs {
15
+ /** Minimum percentage deviation for reversal (default: 5.0) */
16
+ deviation: number;
17
+ /** Number of bars for pivot point detection (default: 10) */
18
+ depth: number;
19
+ /** Extend line from last pivot to current bar */
20
+ extendLast: boolean;
21
+ }
22
+ /**
23
+ * Extended result with pivot data
24
+ */
25
+ export interface ZigZagResult extends IndicatorResult {
26
+ /** Raw pivot data for advanced consumers */
27
+ pivots: ZigZagPivot[];
28
+ /** Extension line to current bar (if extendLast enabled) */
29
+ extension: ZigZagPivot | null;
30
+ }
31
+ /**
32
+ * Default input values
33
+ */
34
+ export declare const defaultInputs: ZigZagInputs;
35
+ /**
36
+ * Input configuration for UI
37
+ */
38
+ export declare const inputConfig: InputConfig[];
39
+ /**
40
+ * Plot configuration
41
+ */
42
+ export declare const plotConfig: PlotConfig[];
43
+ /**
44
+ * Indicator metadata
45
+ */
46
+ export declare const metadata: {
47
+ title: string;
48
+ shortTitle: string;
49
+ overlay: boolean;
50
+ };
51
+ /**
52
+ * Calculate ZigZag indicator
53
+ *
54
+ * @param bars - OHLCV bar data
55
+ * @param inputs - Indicator parameters (optional, uses defaults)
56
+ * @returns Indicator result with plot data and raw pivot information
57
+ */
58
+ export declare function calculate(bars: Bar[], inputs?: Partial<ZigZagInputs>): ZigZagResult;
59
+ /**
60
+ * ZigZag indicator module
61
+ */
62
+ export declare const ZigZag: {
63
+ calculate: typeof calculate;
64
+ metadata: {
65
+ title: string;
66
+ shortTitle: string;
67
+ overlay: boolean;
68
+ };
69
+ defaultInputs: ZigZagInputs;
70
+ inputConfig: InputConfig[];
71
+ plotConfig: PlotConfig[];
72
+ };
73
+ //# sourceMappingURL=zigzag.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zigzag.d.ts","sourceRoot":"","sources":["../src/zigzag.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,GAAG,EACT,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,+DAA+D;IAC/D,SAAS,EAAE,MAAM,CAAC;IAClB,6DAA6D;IAC7D,KAAK,EAAE,MAAM,CAAC;IACd,iDAAiD;IACjD,UAAU,EAAE,OAAO,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,YAAa,SAAQ,eAAe;IACnD,4CAA4C;IAC5C,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,4DAA4D;IAC5D,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;CAC/B;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,YAI3B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,WAAW,EAIpC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,UAAU,EAElC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,QAAQ;;;;CAIpB,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,MAAM,GAAE,OAAO,CAAC,YAAY,CAAM,GAAG,YAAY,CA8DvF;AAED;;GAEG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;CAMlB,CAAC"}
package/package.json ADDED
@@ -0,0 +1,65 @@
1
+ {
2
+ "name": "lightweight-charts-indicators",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "description": "Optimized technical indicators built with OakScriptJS for use with lightweight-charts",
6
+ "main": "dist/index.cjs",
7
+ "module": "dist/index.mjs",
8
+ "types": "dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.mjs",
13
+ "require": "./dist/index.cjs"
14
+ }
15
+ },
16
+ "files": [
17
+ "dist",
18
+ "README.md",
19
+ "LICENSE"
20
+ ],
21
+ "scripts": {
22
+ "prepublishOnly": "npm run build",
23
+ "build": "npm run clean && npm run build:esm && npm run build:cjs && npm run build:types",
24
+ "build:esm": "esbuild src/index.ts --bundle --format=esm --outfile=dist/index.mjs --platform=neutral --external:oakscriptjs --external:@types/*",
25
+ "build:cjs": "esbuild src/index.ts --bundle --format=cjs --outfile=dist/index.cjs --platform=neutral --external:oakscriptjs --external:@types/*",
26
+ "build:types": "tsc --emitDeclarationOnly --outDir dist",
27
+ "clean": "rimraf dist",
28
+ "dev": "tsc --watch",
29
+ "typecheck": "tsc --noEmit",
30
+ "test": "vitest run",
31
+ "test:watch": "vitest",
32
+ "test:pinesuite": "vitest run tests/regression/pinesuite-regression.test.ts"
33
+ },
34
+ "keywords": [
35
+ "lightweight-charts",
36
+ "pinescript",
37
+ "trading",
38
+ "technical-analysis",
39
+ "indicators",
40
+ "oakscript",
41
+ "ta",
42
+ "finance"
43
+ ],
44
+ "author": "Odyssée",
45
+ "license": "MIT",
46
+ "repository": {
47
+ "type": "git",
48
+ "url": "git+https://github.com/deepentropy/lightweight-charts-indicators.git"
49
+ },
50
+ "bugs": {
51
+ "url": "https://github.com/deepentropy/lightweight-charts-indicators/issues"
52
+ },
53
+ "homepage": "https://github.com/deepentropy/lightweight-charts-indicators#readme",
54
+ "peerDependencies": {
55
+ "oakscriptjs": "^0.1.0"
56
+ },
57
+ "devDependencies": {
58
+ "@types/node": "^20.10.6",
59
+ "esbuild": "^0.19.11",
60
+ "oakscriptjs": "^0.1.7",
61
+ "rimraf": "^6.1.0",
62
+ "typescript": "^5.3.3",
63
+ "vitest": "^1.6.0"
64
+ }
65
+ }