@alphacharts/indicators 0.0.0-stage → 0.1.1

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 (50) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +106 -2
  3. package/dist/all-_xzUPrL7.js +21 -0
  4. package/dist/all-_xzUPrL7.js.map +1 -0
  5. package/dist/all.js +10 -0
  6. package/dist/all.js.map +1 -0
  7. package/dist/define-XUgQMhSl.js +687 -0
  8. package/dist/define-XUgQMhSl.js.map +1 -0
  9. package/dist/index.js +744 -0
  10. package/dist/index.js.map +1 -0
  11. package/dist/registry-DdYYyZN_.js +53 -0
  12. package/dist/registry-DdYYyZN_.js.map +1 -0
  13. package/dist/runner-B53M0IsJ.js +237 -0
  14. package/dist/runner-B53M0IsJ.js.map +1 -0
  15. package/dist/studies.js +1 -0
  16. package/dist/tv-volume-BYSbfrVk.js +3454 -0
  17. package/dist/tv-volume-BYSbfrVk.js.map +1 -0
  18. package/dist/types/all.d.ts +3 -0
  19. package/dist/types/chart/marker-floor.d.ts +9 -0
  20. package/dist/types/chart/studies.d.ts +192 -0
  21. package/dist/types/define.d.ts +46 -0
  22. package/dist/types/engine/feed.d.ts +88 -0
  23. package/dist/types/engine/graph.d.ts +136 -0
  24. package/dist/types/engine/kernels.d.ts +9 -0
  25. package/dist/types/engine/study.d.ts +40 -0
  26. package/dist/types/index.d.ts +15 -0
  27. package/dist/types/registry.d.ts +7 -0
  28. package/dist/types/runner.d.ts +91 -0
  29. package/dist/types/studies/all.d.ts +2 -0
  30. package/dist/types/studies/cycle.d.ts +7 -0
  31. package/dist/types/studies/index.d.ts +13 -0
  32. package/dist/types/studies/ma.d.ts +26 -0
  33. package/dist/types/studies/math.d.ts +28 -0
  34. package/dist/types/studies/momentum.d.ts +30 -0
  35. package/dist/types/studies/overlap.d.ts +14 -0
  36. package/dist/types/studies/patterns.d.ts +62 -0
  37. package/dist/types/studies/price.d.ts +6 -0
  38. package/dist/types/studies/sar.d.ts +2 -0
  39. package/dist/types/studies/statistic.d.ts +9 -0
  40. package/dist/types/studies/tv-osc.d.ts +18 -0
  41. package/dist/types/studies/tv-trend.d.ts +20 -0
  42. package/dist/types/studies/tv-volume.d.ts +15 -0
  43. package/dist/types/studies/volatility.d.ts +3 -0
  44. package/dist/types/studies/volume.d.ts +3 -0
  45. package/dist/types/types.d.ts +169 -0
  46. package/dist/types/wasm.d.ts +2 -0
  47. package/dist/types/worker.d.ts +1 -0
  48. package/dist/worker.js +8 -0
  49. package/dist/worker.js.map +1 -0
  50. package/package.json +72 -3
@@ -0,0 +1,13 @@
1
+ export * from "./overlap.js";
2
+ export * from "./momentum.js";
3
+ export * from "./volume.js";
4
+ export * from "./volatility.js";
5
+ export * from "./price.js";
6
+ export * from "./statistic.js";
7
+ export * from "./math.js";
8
+ export * from "./cycle.js";
9
+ export * from "./sar.js";
10
+ export * from "./patterns.js";
11
+ export * from "./tv-trend.js";
12
+ export * from "./tv-osc.js";
13
+ export * from "./tv-volume.js";
@@ -0,0 +1,26 @@
1
+ import type { Col, Graph, Node } from "../engine/graph.js";
2
+ export declare const MA_TYPES: readonly ["sma", "ema", "wma", "rma", "dema", "tema", "trima", "kama", "t3"];
3
+ export type MaType = (typeof MA_TYPES)[number];
4
+ /** Kaufman's adaptive MA: efficiency ratio over p bars, fast/slow smoothing limits. TA-Lib seeds with the bar before the first output. */
5
+ export declare function kama(g: Graph, x: Col, p: number, fast?: number, slow?: number): Node;
6
+ /** Tillson T3: six EMAs, volume factor `a`. */
7
+ export declare function t3(g: Graph, x: Col, p: number, a?: number): Node;
8
+ export declare function dema(g: Graph, x: Col, p: number): Node;
9
+ export declare function tema(g: Graph, x: Col, p: number): Node;
10
+ /** Triangular MA: an SMA of an SMA with the periods TA-Lib splits p into. */
11
+ export declare function trima(g: Graph, x: Col, p: number): Node;
12
+ /**
13
+ * EMA that starts at the first bar `gate` is valid, seeded with the simple
14
+ * mean of the p values ending there (TA-Lib seeds MACD's fast EMA at the slow
15
+ * EMA's first bar this way).
16
+ */
17
+ export declare function emaGated(g: Graph, x: Col, p: number, alpha: number, gate: Col): Node;
18
+ /** EMA seeded with the first value instead of a mean (TA-Lib ADOSC). */
19
+ export declare function emaFirst(g: Graph, x: Col, alpha: number): Node;
20
+ /** One moving average of the given type. */
21
+ export declare function ma(g: Graph, type: MaType, x: Col, p: number): Node;
22
+ /**
23
+ * `ma`, except that an EMA starts where `gate` first has a value (TA-Lib's APO,
24
+ * PPO and MACD compute the fast average from the slow average's first bar).
25
+ */
26
+ export declare function maGated(g: Graph, type: MaType, x: Col, p: number, gate: Col): Node;
@@ -0,0 +1,28 @@
1
+ import type { Col } from "../engine/graph.js";
2
+ export declare const acos: import("../types.js").StudyDef;
3
+ export declare const asin: import("../types.js").StudyDef;
4
+ export declare const atan: import("../types.js").StudyDef;
5
+ export declare const ceil: import("../types.js").StudyDef;
6
+ export declare const cos: import("../types.js").StudyDef;
7
+ export declare const cosh: import("../types.js").StudyDef;
8
+ export declare const exp: import("../types.js").StudyDef;
9
+ export declare const floor: import("../types.js").StudyDef;
10
+ export declare const ln: import("../types.js").StudyDef;
11
+ export declare const log10: import("../types.js").StudyDef;
12
+ export declare const sin: import("../types.js").StudyDef;
13
+ export declare const sinh: import("../types.js").StudyDef;
14
+ export declare const sqrt: import("../types.js").StudyDef;
15
+ export declare const tan: import("../types.js").StudyDef;
16
+ export declare const tanh: import("../types.js").StudyDef;
17
+ export declare const add: import("../types.js").StudyDef;
18
+ export declare const sub: import("../types.js").StudyDef;
19
+ export declare const mult: import("../types.js").StudyDef;
20
+ export declare const div: import("../types.js").StudyDef;
21
+ export declare const max: import("../types.js").StudyDef;
22
+ export declare const min: import("../types.js").StudyDef;
23
+ export declare const sum: import("../types.js").StudyDef;
24
+ export declare const maxindex: import("../types.js").StudyDef;
25
+ export declare const minindex: import("../types.js").StudyDef;
26
+ export declare const minmax: import("../types.js").StudyDef;
27
+ export declare const minmaxindex: import("../types.js").StudyDef;
28
+ export type { Col };
@@ -0,0 +1,30 @@
1
+ export declare const rsi: import("../types.js").StudyDef;
2
+ export declare const cmo: import("../types.js").StudyDef;
3
+ export declare const mom: import("../types.js").StudyDef;
4
+ export declare const roc: import("../types.js").StudyDef;
5
+ export declare const rocp: import("../types.js").StudyDef;
6
+ export declare const rocr: import("../types.js").StudyDef;
7
+ export declare const rocr100: import("../types.js").StudyDef;
8
+ export declare const trix: import("../types.js").StudyDef;
9
+ export declare const apo: import("../types.js").StudyDef;
10
+ export declare const ppo: import("../types.js").StudyDef;
11
+ export declare const macd: import("../types.js").StudyDef;
12
+ export declare const macdfix: import("../types.js").StudyDef;
13
+ export declare const macdext: import("../types.js").StudyDef;
14
+ export declare const stoch: import("../types.js").StudyDef;
15
+ export declare const stochf: import("../types.js").StudyDef;
16
+ export declare const stochrsi: import("../types.js").StudyDef;
17
+ export declare const willr: import("../types.js").StudyDef;
18
+ export declare const cci: import("../types.js").StudyDef;
19
+ export declare const bop: import("../types.js").StudyDef;
20
+ export declare const mfi: import("../types.js").StudyDef;
21
+ export declare const ultosc: import("../types.js").StudyDef;
22
+ export declare const aroon: import("../types.js").StudyDef;
23
+ export declare const aroonosc: import("../types.js").StudyDef;
24
+ export declare const adx: import("../types.js").StudyDef;
25
+ export declare const adxr: import("../types.js").StudyDef;
26
+ export declare const dx: import("../types.js").StudyDef;
27
+ export declare const plusDi: import("../types.js").StudyDef;
28
+ export declare const minusDi: import("../types.js").StudyDef;
29
+ export declare const plusDm: import("../types.js").StudyDef;
30
+ export declare const minusDm: import("../types.js").StudyDef;
@@ -0,0 +1,14 @@
1
+ export declare const sma: import("../types.js").StudyDef;
2
+ export declare const ema: import("../types.js").StudyDef;
3
+ export declare const wma: import("../types.js").StudyDef;
4
+ export declare const dema: import("../types.js").StudyDef;
5
+ export declare const tema: import("../types.js").StudyDef;
6
+ export declare const trima: import("../types.js").StudyDef;
7
+ export declare const kama: import("../types.js").StudyDef;
8
+ export declare const t3: import("../types.js").StudyDef;
9
+ export declare const ma: import("../types.js").StudyDef;
10
+ export declare const bbands: import("../types.js").StudyDef;
11
+ export declare const bbpb: import("../types.js").StudyDef;
12
+ export declare const bbw: import("../types.js").StudyDef;
13
+ export declare const midpoint: import("../types.js").StudyDef;
14
+ export declare const midprice: import("../types.js").StudyDef;
@@ -0,0 +1,62 @@
1
+ import type { StudyDef } from "../types.js";
2
+ export declare const cdl2Crows: StudyDef;
3
+ export declare const cdl3BlackCrows: StudyDef;
4
+ export declare const cdl3Inside: StudyDef;
5
+ export declare const cdl3LineStrike: StudyDef;
6
+ export declare const cdl3Outside: StudyDef;
7
+ export declare const cdl3StarsInSouth: StudyDef;
8
+ export declare const cdl3WhiteSoldiers: StudyDef;
9
+ export declare const cdlAbandonedBaby: StudyDef;
10
+ export declare const cdlAdvanceBlock: StudyDef;
11
+ export declare const cdlBeltHold: StudyDef;
12
+ export declare const cdlBreakaway: StudyDef;
13
+ export declare const cdlClosingMarubozu: StudyDef;
14
+ export declare const cdlConcealBabySwall: StudyDef;
15
+ export declare const cdlCounterAttack: StudyDef;
16
+ export declare const cdlDarkCloudCover: StudyDef;
17
+ export declare const cdlDoji: StudyDef;
18
+ export declare const cdlDojiStar: StudyDef;
19
+ export declare const cdlDragonflyDoji: StudyDef;
20
+ export declare const cdlEngulfing: StudyDef;
21
+ export declare const cdlEveningDojiStar: StudyDef;
22
+ export declare const cdlEveningStar: StudyDef;
23
+ export declare const cdlGapSideSideWhite: StudyDef;
24
+ export declare const cdlGravestoneDoji: StudyDef;
25
+ export declare const cdlHammer: StudyDef;
26
+ export declare const cdlHangingMan: StudyDef;
27
+ export declare const cdlHarami: StudyDef;
28
+ export declare const cdlHaramiCross: StudyDef;
29
+ export declare const cdlHighWave: StudyDef;
30
+ export declare const cdlHikkake: StudyDef;
31
+ export declare const cdlHikkakeMod: StudyDef;
32
+ export declare const cdlHomingPigeon: StudyDef;
33
+ export declare const cdlIdentical3Crows: StudyDef;
34
+ export declare const cdlInNeck: StudyDef;
35
+ export declare const cdlInvertedHammer: StudyDef;
36
+ export declare const cdlKicking: StudyDef;
37
+ export declare const cdlKickingByLength: StudyDef;
38
+ export declare const cdlLadderBottom: StudyDef;
39
+ export declare const cdlLongLeggedDoji: StudyDef;
40
+ export declare const cdlLongLine: StudyDef;
41
+ export declare const cdlMarubozu: StudyDef;
42
+ export declare const cdlMatchingLow: StudyDef;
43
+ export declare const cdlMatHold: StudyDef;
44
+ export declare const cdlMorningDojiStar: StudyDef;
45
+ export declare const cdlMorningStar: StudyDef;
46
+ export declare const cdlOnNeck: StudyDef;
47
+ export declare const cdlPiercing: StudyDef;
48
+ export declare const cdlRickshawMan: StudyDef;
49
+ export declare const cdlRiseFall3Methods: StudyDef;
50
+ export declare const cdlSeparatingLines: StudyDef;
51
+ export declare const cdlShootingStar: StudyDef;
52
+ export declare const cdlShortLine: StudyDef;
53
+ export declare const cdlSpinningTop: StudyDef;
54
+ export declare const cdlStalledPattern: StudyDef;
55
+ export declare const cdlStickSandwich: StudyDef;
56
+ export declare const cdlTakuri: StudyDef;
57
+ export declare const cdlTasukiGap: StudyDef;
58
+ export declare const cdlThrusting: StudyDef;
59
+ export declare const cdlTriStar: StudyDef;
60
+ export declare const cdlUnique3River: StudyDef;
61
+ export declare const cdlUpsideGap2Crows: StudyDef;
62
+ export declare const cdlXSideGap3Methods: StudyDef;
@@ -0,0 +1,6 @@
1
+ import type { Col } from "../engine/graph.js";
2
+ export declare const avgprice: import("../types.js").StudyDef;
3
+ export declare const medprice: import("../types.js").StudyDef;
4
+ export declare const typprice: import("../types.js").StudyDef;
5
+ export declare const wclprice: import("../types.js").StudyDef;
6
+ export type { Col };
@@ -0,0 +1,2 @@
1
+ export declare const sar: import("../types.js").StudyDef;
2
+ export declare const sarext: import("../types.js").StudyDef;
@@ -0,0 +1,9 @@
1
+ export declare const linearreg: import("../types.js").StudyDef;
2
+ export declare const linearregSlope: import("../types.js").StudyDef;
3
+ export declare const linearregIntercept: import("../types.js").StudyDef;
4
+ export declare const linearregAngle: import("../types.js").StudyDef;
5
+ export declare const tsf: import("../types.js").StudyDef;
6
+ export declare const stddev: import("../types.js").StudyDef;
7
+ export declare const variance: import("../types.js").StudyDef;
8
+ export declare const correl: import("../types.js").StudyDef;
9
+ export declare const beta: import("../types.js").StudyDef;
@@ -0,0 +1,18 @@
1
+ export declare const fisher: import("../types.js").StudyDef;
2
+ export declare const kst: import("../types.js").StudyDef;
3
+ export declare const tsi: import("../types.js").StudyDef;
4
+ export declare const vortex: import("../types.js").StudyDef;
5
+ export declare const coppock: import("../types.js").StudyDef;
6
+ export declare const connorsRsi: import("../types.js").StudyDef;
7
+ export declare const choppiness: import("../types.js").StudyDef;
8
+ export declare const rviVigor: import("../types.js").StudyDef;
9
+ export declare const rviVolatility: import("../types.js").StudyDef;
10
+ export declare const smiErgodic: import("../types.js").StudyDef;
11
+ export declare const rankCorr: import("../types.js").StudyDef;
12
+ export declare const bullBearPower: import("../types.js").StudyDef;
13
+ export declare const awesome: import("../types.js").StudyDef;
14
+ export declare const accelerator: import("../types.js").StudyDef;
15
+ export declare const massIndex: import("../types.js").StudyDef;
16
+ export declare const dpo: import("../types.js").StudyDef;
17
+ export declare const schaffTc: import("../types.js").StudyDef;
18
+ export declare const stochTv: import("../types.js").StudyDef;
@@ -0,0 +1,20 @@
1
+ export declare const smma: import("../types.js").StudyDef;
2
+ export declare const vwma: import("../types.js").StudyDef;
3
+ export declare const hma: import("../types.js").StudyDef;
4
+ export declare const alma: import("../types.js").StudyDef;
5
+ export declare const lsma: import("../types.js").StudyDef;
6
+ export declare const mcginley: import("../types.js").StudyDef;
7
+ export declare const maRibbon: import("../types.js").StudyDef;
8
+ export declare const maCross: import("../types.js").StudyDef;
9
+ export declare const envelopes: import("../types.js").StudyDef;
10
+ export declare const keltner: import("../types.js").StudyDef;
11
+ export declare const donchian: import("../types.js").StudyDef;
12
+ export declare const priceChannel: import("../types.js").StudyDef;
13
+ export declare const chandeKrollStop: import("../types.js").StudyDef;
14
+ export declare const linregChannel: import("../types.js").StudyDef;
15
+ export declare const median: import("../types.js").StudyDef;
16
+ export declare const ichimoku: import("../types.js").StudyDef;
17
+ export declare const supertrend: import("../types.js").StudyDef;
18
+ export declare const alligator: import("../types.js").StudyDef;
19
+ export declare const fractals: import("../types.js").StudyDef;
20
+ export declare const zigzag: import("../types.js").StudyDef;
@@ -0,0 +1,15 @@
1
+ export type Period = "day" | "week" | "month" | "year";
2
+ export declare const volume: import("../types.js").StudyDef;
3
+ export declare const volumeOsc: import("../types.js").StudyDef;
4
+ export declare const pvt: import("../types.js").StudyDef;
5
+ export declare const netVolume: import("../types.js").StudyDef;
6
+ export declare const elderForce: import("../types.js").StudyDef;
7
+ export declare const eom: import("../types.js").StudyDef;
8
+ export declare const chaikinMf: import("../types.js").StudyDef;
9
+ export declare const klinger: import("../types.js").StudyDef;
10
+ export declare const vwap: import("../types.js").StudyDef;
11
+ export declare const anchoredVwap: import("../types.js").StudyDef;
12
+ export declare const pivotPoints: import("../types.js").StudyDef;
13
+ export declare const histVol: import("../types.js").StudyDef;
14
+ export declare const adr: import("../types.js").StudyDef;
15
+ export declare const barsPerYear: import("../types.js").StudyDef;
@@ -0,0 +1,3 @@
1
+ export declare const trange: import("../types.js").StudyDef;
2
+ export declare const atr: import("../types.js").StudyDef;
3
+ export declare const natr: import("../types.js").StudyDef;
@@ -0,0 +1,3 @@
1
+ export declare const ad: import("../types.js").StudyDef;
2
+ export declare const adosc: import("../types.js").StudyDef;
3
+ export declare const obv: import("../types.js").StudyDef;
@@ -0,0 +1,169 @@
1
+ import type { Col, Graph } from "./engine/graph.js";
2
+ export type InputType = "int" | "float" | "bool" | "source" | "select";
3
+ export type InputValue = number | boolean | string;
4
+ export interface InputDef {
5
+ key: string;
6
+ label: string;
7
+ type: InputType;
8
+ default: InputValue;
9
+ min?: number;
10
+ max?: number;
11
+ step?: number;
12
+ /** Allowed values of a "select" (strings) or "source" input. */
13
+ options?: readonly string[];
14
+ }
15
+ /** Resolved parameters passed to `build`: every input has a value. */
16
+ export interface Params {
17
+ readonly [key: string]: any;
18
+ }
19
+ export type LineStyleName = "solid" | "dashed" | "dotted";
20
+ export type MarkerShape = "circle" | "square" | "triangleUp" | "triangleDown" | "arrowUp" | "arrowDown" | "cross" | "diamond";
21
+ interface PlotBase {
22
+ /** Unique within the study; keys style overrides and the output series id. */
23
+ key: string;
24
+ title: string;
25
+ }
26
+ export type PlotDef = (PlotBase & {
27
+ kind: "line";
28
+ col: string;
29
+ color: string;
30
+ width?: number;
31
+ style?: LineStyleName;
32
+ /** Shift in bars (positive = into the future). Negative shifts and `connect` draw on the overlay. A function is worked out from the study's inputs (`-right`). */
33
+ offset?: number | ((p: Params) => number);
34
+ /** Join across absent bars (drawn on the overlay). */
35
+ connect?: boolean;
36
+ /**
37
+ * Per-point colour: where column `col` is present and not zero, the line segment arriving at that bar is drawn in
38
+ * `color` instead of the plot's own. The column is an ordinary one (a 0/1 condition), computed with the rest.
39
+ */
40
+ colorBy?: {
41
+ col: string;
42
+ color: string;
43
+ };
44
+ }) | (PlotBase & {
45
+ kind: "histogram";
46
+ col: string;
47
+ color: string;
48
+ colorDown?: string;
49
+ }) | (PlotBase & {
50
+ kind: "area";
51
+ col: string;
52
+ color: string;
53
+ })
54
+ /** Two boundary lines with a fill between them. */
55
+ | (PlotBase & {
56
+ kind: "band";
57
+ upper: string;
58
+ lower: string;
59
+ color: string;
60
+ fill: string;
61
+ width?: number;
62
+ })
63
+ /** A fill between two columns, no boundary lines. */
64
+ | (PlotBase & {
65
+ kind: "fill";
66
+ a: string;
67
+ b: string;
68
+ color: string;
69
+ }) | (PlotBase & {
70
+ kind: "hline";
71
+ value: number | ((p: Params) => number);
72
+ color: string;
73
+ style?: LineStyleName;
74
+ }) | (PlotBase & {
75
+ kind: "markers";
76
+ /**
77
+ * Non-NaN (and for text markers non-zero) marks a bar. "value" places it at the value, "above"/"below" at the
78
+ * bar's high/low, "sign" below the bar for a positive value and above it for a negative one (candlestick scores).
79
+ */
80
+ col: string;
81
+ shape: MarkerShape;
82
+ position: "value" | "above" | "below" | "sign";
83
+ color: string;
84
+ /** Shift in bars (positive = into the future); Fractals confirm two bars late and shift back. A function is worked out from the study's inputs (`-right`). */
85
+ offset?: number | ((p: Params) => number);
86
+ /** Draw the value as text (pattern scores) instead of a shape. */
87
+ text?: boolean;
88
+ /** Keep only the most recent `last` marked bars. Decided from the finished columns each time they are drawn, so a tick or a batch gives the same marks. */
89
+ last?: number;
90
+ /** Keep only marks on the final `within` bars. */
91
+ within?: number;
92
+ })
93
+ /**
94
+ * Colours the candles (or OHLC bars) of the study's source series on every bar where column `col` is present and
95
+ * not zero. Several barcolor plots (and several studies) compose: the latest one that applies to a bar wins; a bar none
96
+ * applies to keeps its up/down colours. Needs an OHLC source.
97
+ */
98
+ | (PlotBase & {
99
+ kind: "barcolor";
100
+ col: string;
101
+ color: string;
102
+ })
103
+ /**
104
+ * Shades the background of the study's pane (the source's pane for an overlay) on every bar where column `col` is
105
+ * present and not zero. Takes no part in autoscale.
106
+ */
107
+ | (PlotBase & {
108
+ kind: "bgcolor";
109
+ col: string;
110
+ color: string;
111
+ })
112
+ /** ZigZag: `price` at the confirmation bar and `back` bars to the pivot; joined by straight lines. */
113
+ | (PlotBase & {
114
+ kind: "zigzag";
115
+ price: string;
116
+ back: string;
117
+ color: string;
118
+ width?: number;
119
+ });
120
+ export type StudyFamily = "overlap" | "momentum" | "volume" | "volatility" | "price" | "cycle" | "pattern" | "statistic" | "math" | "trend" | "levels" | "tv";
121
+ /** What bars a study reads: one value series, OHLC, or OHLC with volume. */
122
+ export type StudyNeeds = "value" | "ohlc" | "ohlcv";
123
+ export interface StudyDef {
124
+ id: string;
125
+ name: string;
126
+ family: StudyFamily;
127
+ inputs: readonly InputDef[];
128
+ needs: StudyNeeds;
129
+ /** Where it is drawn: on the source's pane or in a pane of its own. */
130
+ pane: "overlay" | "new";
131
+ /**
132
+ * Which price scale its series use: "right" (default) or the chart's "left" axis, so a series of another magnitude
133
+ * shares the pane without flattening the price. Either side needs the chart to show that axis to be read.
134
+ */
135
+ scale?: "right" | "left";
136
+ /** Names of the computed columns, in the order `build` returns them. */
137
+ columns: readonly string[];
138
+ plots: readonly PlotDef[];
139
+ /** Declare nodes on the graph and return the output columns, one per `columns` entry. */
140
+ build(g: Graph, p: Params): readonly Col[];
141
+ /**
142
+ * Smallest step of the values a separate-pane study shows on its axis and in
143
+ * labels. Default: two decimals, and more once the values are below 1.
144
+ */
145
+ minMove?: number;
146
+ /** Short title suffix from the parameters, e.g. "14" -> "RSI (14)". */
147
+ label?(p: Params): string;
148
+ /** Reference this study is verified against, shown in the README. */
149
+ reference?: string;
150
+ }
151
+ /** One bar for the streaming engine. */
152
+ export interface BarInput {
153
+ time: number;
154
+ open: number;
155
+ high: number;
156
+ low: number;
157
+ close: number;
158
+ volume: number;
159
+ }
160
+ /** Columnar bars. A value-only source passes just `close`. */
161
+ export interface BarColumns {
162
+ time: Float64Array;
163
+ open?: Float64Array;
164
+ high?: Float64Array;
165
+ low?: Float64Array;
166
+ close: Float64Array;
167
+ volume?: Float64Array;
168
+ }
169
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare function enableWasm(): Promise<void>;
2
+ export declare function disableWasm(): void;
@@ -0,0 +1 @@
1
+ export {};
package/dist/worker.js ADDED
@@ -0,0 +1,8 @@
1
+ import { o as e } from "./runner-B53M0IsJ.js";
2
+ import { t } from "./all-_xzUPrL7.js";
3
+ //#region src/worker.ts
4
+ var n = new Map(t.map((e) => [e.id, e])), r = self, i = e((e, t) => r.postMessage(e, t), (e) => n.get(e));
5
+ r.onmessage = (e) => i(e.data);
6
+ //#endregion
7
+
8
+ //# sourceMappingURL=worker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worker.js","names":["serveWorker","byId","ALL_STUDIES","s","scope","handle","m","id"],"sources":["../src/worker.ts"],"sourcesContent":["// Worker entry: `new Worker(new URL(\"@alphacharts/indicators/worker\", import.meta.url), { type: \"module\" })`.\n// Knows every built-in study; imports the full set because a worker is not on\n// the page's critical path.\n\nimport { serveWorker } from \"./runner.js\";\nimport { ALL_STUDIES } from \"./studies/all.js\";\n\nconst byId = new Map(ALL_STUDIES.map((s) => [s.id, s]));\nconst scope = self as unknown as { postMessage(m: unknown, t?: Transferable[]): void; onmessage: ((e: { data: unknown }) => void) | null };\nconst handle = serveWorker((m, t) => scope.postMessage(m, t), (id) => byId.get(id));\nscope.onmessage = (e) => handle(e.data);\n"],"mappings":";;;AAOA,IAAMC,IAAO,IAAI,IAAIC,EAAY,KAAK,MAAM,CAACC,EAAE,IAAIA,CAAC,CAAC,CAAC,GAChDC,IAAQ,MACRC,IAASL,GAAa,GAAG,MAAMI,EAAM,YAAYE,GAAG,CAAC,IAAI,MAAOL,EAAK,IAAIM,CAAE,CAAC;AAClF,EAAM,aAAa,MAAMF,EAAO,EAAE,IAAI"}
package/package.json CHANGED
@@ -1,6 +1,75 @@
1
1
  {
2
2
  "name": "@alphacharts/indicators",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.1",
4
+ "description": "Technical studies for alphacharts: a typed study model, an incremental engine, a Web Worker runner and 211 studies.",
5
+ "keywords": [
6
+ "indicators",
7
+ "technical-analysis",
8
+ "ta-lib",
9
+ "rsi",
10
+ "macd",
11
+ "chart"
12
+ ],
13
+ "license": "MIT",
14
+ "author": "Alphabench",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/alphabench/alphacharts.git",
18
+ "directory": "packages/indicators"
19
+ },
20
+ "homepage": "https://github.com/alphabench/alphacharts#readme",
21
+ "bugs": {
22
+ "url": "https://github.com/alphabench/alphacharts/issues"
23
+ },
24
+ "publishConfig": {
25
+ "access": "public"
26
+ },
27
+ "type": "module",
28
+ "sideEffects": [
29
+ "./dist/worker.js",
30
+ "./src/worker.ts"
31
+ ],
32
+ "main": "./dist/index.js",
33
+ "module": "./dist/index.js",
34
+ "types": "./dist/types/index.d.ts",
35
+ "exports": {
36
+ ".": {
37
+ "types": "./dist/types/index.d.ts",
38
+ "default": "./dist/index.js"
39
+ },
40
+ "./all": {
41
+ "types": "./dist/types/all.d.ts",
42
+ "default": "./dist/all.js"
43
+ },
44
+ "./studies": {
45
+ "types": "./dist/types/studies/index.d.ts",
46
+ "default": "./dist/studies.js"
47
+ },
48
+ "./worker": {
49
+ "types": "./dist/types/worker.d.ts",
50
+ "default": "./dist/worker.js"
51
+ }
52
+ },
53
+ "files": [
54
+ "dist"
55
+ ],
56
+ "dependencies": {
57
+ "@alphacharts/wasm": "0.1.0"
58
+ },
59
+ "peerDependencies": {
60
+ "@alphacharts/core": "^0.1.1"
61
+ },
62
+ "devDependencies": {
63
+ "typescript": "5.9.3",
64
+ "vite": "8.3.1",
65
+ "vitest": "5.0.2",
66
+ "@alphacharts/core": "0.1.1"
67
+ },
68
+ "scripts": {
69
+ "build": "vite build && tsc -p tsconfig.build.json",
70
+ "typecheck": "tsc -p tsconfig.json",
71
+ "typecheck:dist": "tsc -p tsconfig.dist.json",
72
+ "test": "vitest run",
73
+ "fixtures": "python scripts/gen_fixtures.py"
74
+ }
6
75
  }