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.
- package/LICENSE +21 -0
- package/README.md +271 -0
- package/dist/adr.d.ts +57 -0
- package/dist/adr.d.ts.map +1 -0
- package/dist/adx.d.ts +34 -0
- package/dist/adx.d.ts.map +1 -0
- package/dist/alma.d.ts +61 -0
- package/dist/alma.d.ts.map +1 -0
- package/dist/aroon.d.ts +34 -0
- package/dist/aroon.d.ts.map +1 -0
- package/dist/atr.d.ts +59 -0
- package/dist/atr.d.ts.map +1 -0
- package/dist/awesome-oscillator.d.ts +34 -0
- package/dist/awesome-oscillator.d.ts.map +1 -0
- package/dist/bb-bandwidth.d.ts +41 -0
- package/dist/bb-bandwidth.d.ts.map +1 -0
- package/dist/bb-percent-b.d.ts +37 -0
- package/dist/bb-percent-b.d.ts.map +1 -0
- package/dist/bb.d.ts +65 -0
- package/dist/bb.d.ts.map +1 -0
- package/dist/bbtrend.d.ts +36 -0
- package/dist/bbtrend.d.ts.map +1 -0
- package/dist/bop.d.ts +57 -0
- package/dist/bop.d.ts.map +1 -0
- package/dist/bull-bear-power.d.ts +32 -0
- package/dist/bull-bear-power.d.ts.map +1 -0
- package/dist/cci.d.ts +33 -0
- package/dist/cci.d.ts.map +1 -0
- package/dist/chaikin-mf.d.ts +33 -0
- package/dist/chaikin-mf.d.ts.map +1 -0
- package/dist/chaikin-oscillator.d.ts +37 -0
- package/dist/chaikin-oscillator.d.ts.map +1 -0
- package/dist/chande-kroll-stop.d.ts +47 -0
- package/dist/chande-kroll-stop.d.ts.map +1 -0
- package/dist/chande-mo.d.ts +32 -0
- package/dist/chande-mo.d.ts.map +1 -0
- package/dist/choppiness.d.ts +34 -0
- package/dist/choppiness.d.ts.map +1 -0
- package/dist/coppock-curve.d.ts +37 -0
- package/dist/coppock-curve.d.ts.map +1 -0
- package/dist/dema.d.ts +33 -0
- package/dist/dema.d.ts.map +1 -0
- package/dist/dmi.d.ts +49 -0
- package/dist/dmi.d.ts.map +1 -0
- package/dist/donchian.d.ts +60 -0
- package/dist/donchian.d.ts.map +1 -0
- package/dist/dpo.d.ts +34 -0
- package/dist/dpo.d.ts.map +1 -0
- package/dist/ease-of-movement.d.ts +35 -0
- package/dist/ease-of-movement.d.ts.map +1 -0
- package/dist/elder-force.d.ts +33 -0
- package/dist/elder-force.d.ts.map +1 -0
- package/dist/ema.d.ts +33 -0
- package/dist/ema.d.ts.map +1 -0
- package/dist/envelope.d.ts +38 -0
- package/dist/envelope.d.ts.map +1 -0
- package/dist/fisher-transform.d.ts +44 -0
- package/dist/fisher-transform.d.ts.map +1 -0
- package/dist/historical-volatility.d.ts +36 -0
- package/dist/historical-volatility.d.ts.map +1 -0
- package/dist/hma.d.ts +32 -0
- package/dist/hma.d.ts.map +1 -0
- package/dist/ichimoku.d.ts +64 -0
- package/dist/ichimoku.d.ts.map +1 -0
- package/dist/index.cjs +5532 -0
- package/dist/index.d.ts +207 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +5511 -0
- package/dist/keltner.d.ts +68 -0
- package/dist/keltner.d.ts.map +1 -0
- package/dist/klinger.d.ts +46 -0
- package/dist/klinger.d.ts.map +1 -0
- package/dist/lsma.d.ts +33 -0
- package/dist/lsma.d.ts.map +1 -0
- package/dist/ma-cross.d.ts +34 -0
- package/dist/ma-cross.d.ts.map +1 -0
- package/dist/ma-ribbon.d.ts +63 -0
- package/dist/ma-ribbon.d.ts.map +1 -0
- package/dist/macd.d.ts +34 -0
- package/dist/macd.d.ts.map +1 -0
- package/dist/mass-index.d.ts +31 -0
- package/dist/mass-index.d.ts.map +1 -0
- package/dist/mcginley-dynamic.d.ts +32 -0
- package/dist/mcginley-dynamic.d.ts.map +1 -0
- package/dist/median.d.ts +35 -0
- package/dist/median.d.ts.map +1 -0
- package/dist/mfi.d.ts +32 -0
- package/dist/mfi.d.ts.map +1 -0
- package/dist/momentum.d.ts +32 -0
- package/dist/momentum.d.ts.map +1 -0
- package/dist/obv.d.ts +30 -0
- package/dist/obv.d.ts.map +1 -0
- package/dist/parabolic-sar.d.ts +62 -0
- package/dist/parabolic-sar.d.ts.map +1 -0
- package/dist/price-oscillator.d.ts +40 -0
- package/dist/price-oscillator.d.ts.map +1 -0
- package/dist/pvt.d.ts +30 -0
- package/dist/pvt.d.ts.map +1 -0
- package/dist/rma.d.ts +33 -0
- package/dist/rma.d.ts.map +1 -0
- package/dist/roc.d.ts +32 -0
- package/dist/roc.d.ts.map +1 -0
- package/dist/rsi.d.ts +32 -0
- package/dist/rsi.d.ts.map +1 -0
- package/dist/rvi.d.ts +32 -0
- package/dist/rvi.d.ts.map +1 -0
- package/dist/sma.d.ts +61 -0
- package/dist/sma.d.ts.map +1 -0
- package/dist/smi-ergodic-oscillator.d.ts +36 -0
- package/dist/smi-ergodic-oscillator.d.ts.map +1 -0
- package/dist/smi-ergodic.d.ts +37 -0
- package/dist/smi-ergodic.d.ts.map +1 -0
- package/dist/smma.d.ts +32 -0
- package/dist/smma.d.ts.map +1 -0
- package/dist/stdev.d.ts +31 -0
- package/dist/stdev.d.ts.map +1 -0
- package/dist/stoch-rsi.d.ts +38 -0
- package/dist/stoch-rsi.d.ts.map +1 -0
- package/dist/stoch.d.ts +33 -0
- package/dist/stoch.d.ts.map +1 -0
- package/dist/supertrend.d.ts +60 -0
- package/dist/supertrend.d.ts.map +1 -0
- package/dist/tema.d.ts +33 -0
- package/dist/tema.d.ts.map +1 -0
- package/dist/trend-strength.d.ts +34 -0
- package/dist/trend-strength.d.ts.map +1 -0
- package/dist/trix.d.ts +43 -0
- package/dist/trix.d.ts.map +1 -0
- package/dist/tsi.d.ts +36 -0
- package/dist/tsi.d.ts.map +1 -0
- package/dist/ultimate-oscillator.d.ts +48 -0
- package/dist/ultimate-oscillator.d.ts.map +1 -0
- package/dist/volume-oscillator.d.ts +34 -0
- package/dist/volume-oscillator.d.ts.map +1 -0
- package/dist/vortex.d.ts +32 -0
- package/dist/vortex.d.ts.map +1 -0
- package/dist/vwma.d.ts +32 -0
- package/dist/vwma.d.ts.map +1 -0
- package/dist/williams-alligator.d.ts +44 -0
- package/dist/williams-alligator.d.ts.map +1 -0
- package/dist/williams-r.d.ts +33 -0
- package/dist/williams-r.d.ts.map +1 -0
- package/dist/wma.d.ts +32 -0
- package/dist/wma.d.ts.map +1 -0
- package/dist/woodies-cci.d.ts +35 -0
- package/dist/woodies-cci.d.ts.map +1 -0
- package/dist/zigzag.d.ts +73 -0
- package/dist/zigzag.d.ts.map +1 -0
- package/package.json +65 -0
package/dist/pvt.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Price Volume Trend (PVT) Indicator
|
|
3
|
+
*
|
|
4
|
+
* Cumulative volume indicator that relates volume to price change.
|
|
5
|
+
* PVT = cumulative(change(close) / close[1] * volume)
|
|
6
|
+
*/
|
|
7
|
+
import { type IndicatorResult, type InputConfig, type PlotConfig, type Bar } from 'oakscriptjs';
|
|
8
|
+
export interface PVTInputs {
|
|
9
|
+
}
|
|
10
|
+
export declare const defaultInputs: PVTInputs;
|
|
11
|
+
export declare const inputConfig: InputConfig[];
|
|
12
|
+
export declare const plotConfig: PlotConfig[];
|
|
13
|
+
export declare const metadata: {
|
|
14
|
+
title: string;
|
|
15
|
+
shortTitle: string;
|
|
16
|
+
overlay: boolean;
|
|
17
|
+
};
|
|
18
|
+
export declare function calculate(bars: Bar[], inputs?: Partial<PVTInputs>): IndicatorResult;
|
|
19
|
+
export declare const PVT: {
|
|
20
|
+
calculate: typeof calculate;
|
|
21
|
+
metadata: {
|
|
22
|
+
title: string;
|
|
23
|
+
shortTitle: string;
|
|
24
|
+
overlay: boolean;
|
|
25
|
+
};
|
|
26
|
+
defaultInputs: PVTInputs;
|
|
27
|
+
inputConfig: InputConfig[];
|
|
28
|
+
plotConfig: PlotConfig[];
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=pvt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pvt.d.ts","sourceRoot":"","sources":["../src/pvt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,KAAK,GAAG,EAAE,MAAM,aAAa,CAAC;AAEhG,MAAM,WAAW,SAAS;CAEzB;AAED,eAAO,MAAM,aAAa,EAAE,SAAc,CAAC;AAE3C,eAAO,MAAM,WAAW,EAAE,WAAW,EAAO,CAAC;AAE7C,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,CAsCvF;AAED,eAAO,MAAM,GAAG;;;;;;;;;;CAMf,CAAC"}
|
package/dist/rma.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Smoothed Moving Average (RMA/SMMA) Indicator
|
|
3
|
+
*
|
|
4
|
+
* Hand-optimized implementation using oakscriptjs.
|
|
5
|
+
* Also known as Wilder's Smoothing or SMMA. Uses exponential smoothing with alpha = 1/length.
|
|
6
|
+
* First value is SMA, subsequent values use: (prev * (len - 1) + src) / len
|
|
7
|
+
*/
|
|
8
|
+
import { type IndicatorResult, type InputConfig, type PlotConfig, type Bar, type SourceType } from 'oakscriptjs';
|
|
9
|
+
export interface RMAInputs {
|
|
10
|
+
len: number;
|
|
11
|
+
src: SourceType;
|
|
12
|
+
}
|
|
13
|
+
export declare const defaultInputs: RMAInputs;
|
|
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<RMAInputs>): IndicatorResult;
|
|
22
|
+
export declare const RMA: {
|
|
23
|
+
calculate: typeof calculate;
|
|
24
|
+
metadata: {
|
|
25
|
+
title: string;
|
|
26
|
+
shortTitle: string;
|
|
27
|
+
overlay: boolean;
|
|
28
|
+
};
|
|
29
|
+
defaultInputs: RMAInputs;
|
|
30
|
+
inputConfig: InputConfig[];
|
|
31
|
+
plotConfig: PlotConfig[];
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=rma.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rma.d.ts","sourceRoot":"","sources":["../src/rma.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;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,GAAG,EAAE,MAAM,CAAC;IACZ,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,CAgCvF;AAED,eAAO,MAAM,GAAG;;;;;;;;;;CAAkE,CAAC"}
|
package/dist/roc.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rate of Change (ROC) Indicator
|
|
3
|
+
*
|
|
4
|
+
* Hand-optimized implementation using oakscriptjs.
|
|
5
|
+
* Measures the percentage change in price over a specified period.
|
|
6
|
+
*/
|
|
7
|
+
import { type IndicatorResult, type InputConfig, type PlotConfig, type Bar, type SourceType } from 'oakscriptjs';
|
|
8
|
+
export interface ROCInputs {
|
|
9
|
+
length: number;
|
|
10
|
+
src: SourceType;
|
|
11
|
+
}
|
|
12
|
+
export declare const defaultInputs: ROCInputs;
|
|
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<ROCInputs>): IndicatorResult;
|
|
21
|
+
export declare const ROC: {
|
|
22
|
+
calculate: typeof calculate;
|
|
23
|
+
metadata: {
|
|
24
|
+
title: string;
|
|
25
|
+
shortTitle: string;
|
|
26
|
+
overlay: boolean;
|
|
27
|
+
};
|
|
28
|
+
defaultInputs: ROCInputs;
|
|
29
|
+
inputConfig: InputConfig[];
|
|
30
|
+
plotConfig: PlotConfig[];
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=roc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"roc.d.ts","sourceRoot":"","sources":["../src/roc.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"}
|
package/dist/rsi.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Relative Strength Index (RSI) Indicator
|
|
3
|
+
*
|
|
4
|
+
* Hand-optimized implementation using oakscriptjs.
|
|
5
|
+
* Momentum oscillator measuring the speed and magnitude of price changes.
|
|
6
|
+
*/
|
|
7
|
+
import { type IndicatorResult, type InputConfig, type PlotConfig, type Bar, type SourceType } from 'oakscriptjs';
|
|
8
|
+
export interface RSIInputs {
|
|
9
|
+
length: number;
|
|
10
|
+
src: SourceType;
|
|
11
|
+
}
|
|
12
|
+
export declare const defaultInputs: RSIInputs;
|
|
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<RSIInputs>): IndicatorResult;
|
|
21
|
+
export declare const RSI: {
|
|
22
|
+
calculate: typeof calculate;
|
|
23
|
+
metadata: {
|
|
24
|
+
title: string;
|
|
25
|
+
shortTitle: string;
|
|
26
|
+
overlay: boolean;
|
|
27
|
+
};
|
|
28
|
+
defaultInputs: RSIInputs;
|
|
29
|
+
inputConfig: InputConfig[];
|
|
30
|
+
plotConfig: PlotConfig[];
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=rsi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rsi.d.ts","sourceRoot":"","sources":["../src/rsi.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"}
|
package/dist/rvi.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Relative Vigor Index (RVI/RVGI) Indicator
|
|
3
|
+
*
|
|
4
|
+
* Measures the conviction of a recent price action.
|
|
5
|
+
* Based on the relationship between close-open and high-low.
|
|
6
|
+
*/
|
|
7
|
+
import { type IndicatorResult, type InputConfig, type PlotConfig, type Bar } from 'oakscriptjs';
|
|
8
|
+
export interface RVIInputs {
|
|
9
|
+
/** Period length */
|
|
10
|
+
length: number;
|
|
11
|
+
}
|
|
12
|
+
export declare const defaultInputs: RVIInputs;
|
|
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<RVIInputs>): IndicatorResult;
|
|
21
|
+
export declare const RVI: {
|
|
22
|
+
calculate: typeof calculate;
|
|
23
|
+
metadata: {
|
|
24
|
+
title: string;
|
|
25
|
+
shortTitle: string;
|
|
26
|
+
overlay: boolean;
|
|
27
|
+
};
|
|
28
|
+
defaultInputs: RVIInputs;
|
|
29
|
+
inputConfig: InputConfig[];
|
|
30
|
+
plotConfig: PlotConfig[];
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=rvi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rvi.d.ts","sourceRoot":"","sources":["../src/rvi.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,KAAK,GAAG,EAAE,MAAM,aAAa,CAAC;AAEhG,MAAM,WAAW,SAAS;IACxB,oBAAoB;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,aAAa,EAAE,SAE3B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,WAAW,EAEpC,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,UAAU,EAGlC,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;CAIpB,CAAC;AAmBF,wBAAgB,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,MAAM,GAAE,OAAO,CAAC,SAAS,CAAM,GAAG,eAAe,CA2DvF;AAED,eAAO,MAAM,GAAG;;;;;;;;;;CAMf,CAAC"}
|
package/dist/sma.d.ts
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simple Moving Average (SMA) Indicator
|
|
3
|
+
*
|
|
4
|
+
* Hand-optimized implementation using oakscriptjs.
|
|
5
|
+
* Matches TradingView's built-in SMA indicator.
|
|
6
|
+
*/
|
|
7
|
+
import { type IndicatorResult, type InputConfig, type PlotConfig, type Bar, type SourceType } from 'oakscriptjs';
|
|
8
|
+
/**
|
|
9
|
+
* SMA indicator input parameters
|
|
10
|
+
*/
|
|
11
|
+
export interface SMAInputs {
|
|
12
|
+
/** SMA period length */
|
|
13
|
+
len: number;
|
|
14
|
+
/** Price source */
|
|
15
|
+
src: SourceType;
|
|
16
|
+
/** Plot offset */
|
|
17
|
+
offset: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Default input values
|
|
21
|
+
*/
|
|
22
|
+
export declare const defaultInputs: SMAInputs;
|
|
23
|
+
/**
|
|
24
|
+
* Input configuration for UI
|
|
25
|
+
*/
|
|
26
|
+
export declare const inputConfig: InputConfig[];
|
|
27
|
+
/**
|
|
28
|
+
* Plot configuration
|
|
29
|
+
*/
|
|
30
|
+
export declare const plotConfig: PlotConfig[];
|
|
31
|
+
/**
|
|
32
|
+
* Indicator metadata
|
|
33
|
+
*/
|
|
34
|
+
export declare const metadata: {
|
|
35
|
+
title: string;
|
|
36
|
+
shortTitle: string;
|
|
37
|
+
overlay: boolean;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Calculate SMA indicator
|
|
41
|
+
*
|
|
42
|
+
* @param bars - OHLCV bar data
|
|
43
|
+
* @param inputs - Indicator parameters (optional, uses defaults)
|
|
44
|
+
* @returns Indicator result with plot data
|
|
45
|
+
*/
|
|
46
|
+
export declare function calculate(bars: Bar[], inputs?: Partial<SMAInputs>): IndicatorResult;
|
|
47
|
+
/**
|
|
48
|
+
* SMA indicator module
|
|
49
|
+
*/
|
|
50
|
+
export declare const SMA: {
|
|
51
|
+
calculate: typeof calculate;
|
|
52
|
+
metadata: {
|
|
53
|
+
title: string;
|
|
54
|
+
shortTitle: string;
|
|
55
|
+
overlay: boolean;
|
|
56
|
+
};
|
|
57
|
+
defaultInputs: SMAInputs;
|
|
58
|
+
inputConfig: InputConfig[];
|
|
59
|
+
plotConfig: PlotConfig[];
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=sma.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sma.d.ts","sourceRoot":"","sources":["../src/sma.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;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,wBAAwB;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,mBAAmB;IACnB,GAAG,EAAE,UAAU,CAAC;IAChB,kBAAkB;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,SAI3B,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,SAAS,CAAM,GAAG,eAAe,CAyBvF;AAED;;GAEG;AACH,eAAO,MAAM,GAAG;;;;;;;;;;CAMf,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SMI Ergodic Oscillator
|
|
3
|
+
*
|
|
4
|
+
* The difference between SMI Ergodic and its signal line, displayed as a histogram.
|
|
5
|
+
* Oscillator = SMI - Signal
|
|
6
|
+
*/
|
|
7
|
+
import { type IndicatorResult, type InputConfig, type PlotConfig, type Bar } from 'oakscriptjs';
|
|
8
|
+
export interface SMIErgodicOscInputs {
|
|
9
|
+
/** Long period */
|
|
10
|
+
longLength: number;
|
|
11
|
+
/** Short period */
|
|
12
|
+
shortLength: number;
|
|
13
|
+
/** Signal period */
|
|
14
|
+
signalLength: number;
|
|
15
|
+
}
|
|
16
|
+
export declare const defaultInputs: SMIErgodicOscInputs;
|
|
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<SMIErgodicOscInputs>): IndicatorResult;
|
|
25
|
+
export declare const SMIErgodicOscillator: {
|
|
26
|
+
calculate: typeof calculate;
|
|
27
|
+
metadata: {
|
|
28
|
+
title: string;
|
|
29
|
+
shortTitle: string;
|
|
30
|
+
overlay: boolean;
|
|
31
|
+
};
|
|
32
|
+
defaultInputs: SMIErgodicOscInputs;
|
|
33
|
+
inputConfig: InputConfig[];
|
|
34
|
+
plotConfig: PlotConfig[];
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=smi-ergodic-oscillator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smi-ergodic-oscillator.d.ts","sourceRoot":"","sources":["../src/smi-ergodic-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,mBAAmB;IAClC,kBAAkB;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,oBAAoB;IACpB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,aAAa,EAAE,mBAI3B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,WAAW,EAIpC,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,mBAAmB,CAAM,GAAG,eAAe,CAiEjG;AAED,eAAO,MAAM,oBAAoB;;;;;;;;;;CAMhC,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SMI Ergodic Indicator
|
|
3
|
+
*
|
|
4
|
+
* A momentum oscillator based on True Strength Index.
|
|
5
|
+
* SMI = EMA(EMA(pc, shortLen), longLen) / EMA(EMA(|pc|, shortLen), longLen) * 100
|
|
6
|
+
* Signal = EMA(SMI, signalLen)
|
|
7
|
+
*/
|
|
8
|
+
import { type IndicatorResult, type InputConfig, type PlotConfig, type Bar } from 'oakscriptjs';
|
|
9
|
+
export interface SMIErgodicInputs {
|
|
10
|
+
/** Long period */
|
|
11
|
+
longLength: number;
|
|
12
|
+
/** Short period */
|
|
13
|
+
shortLength: number;
|
|
14
|
+
/** Signal period */
|
|
15
|
+
signalLength: number;
|
|
16
|
+
}
|
|
17
|
+
export declare const defaultInputs: SMIErgodicInputs;
|
|
18
|
+
export declare const inputConfig: InputConfig[];
|
|
19
|
+
export declare const plotConfig: PlotConfig[];
|
|
20
|
+
export declare const metadata: {
|
|
21
|
+
title: string;
|
|
22
|
+
shortTitle: string;
|
|
23
|
+
overlay: boolean;
|
|
24
|
+
};
|
|
25
|
+
export declare function calculate(bars: Bar[], inputs?: Partial<SMIErgodicInputs>): IndicatorResult;
|
|
26
|
+
export declare const SMIErgodic: {
|
|
27
|
+
calculate: typeof calculate;
|
|
28
|
+
metadata: {
|
|
29
|
+
title: string;
|
|
30
|
+
shortTitle: string;
|
|
31
|
+
overlay: boolean;
|
|
32
|
+
};
|
|
33
|
+
defaultInputs: SMIErgodicInputs;
|
|
34
|
+
inputConfig: InputConfig[];
|
|
35
|
+
plotConfig: PlotConfig[];
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=smi-ergodic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smi-ergodic.d.ts","sourceRoot":"","sources":["../src/smi-ergodic.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,gBAAgB;IAC/B,kBAAkB;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,oBAAoB;IACpB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,aAAa,EAAE,gBAI3B,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,gBAAgB,CAAM,GAAG,eAAe,CA8D9F;AAED,eAAO,MAAM,UAAU;;;;;;;;;;CAMtB,CAAC"}
|
package/dist/smma.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Smoothed Moving Average (SMMA)
|
|
3
|
+
*
|
|
4
|
+
* Also known as RMA or Wilder's Smoothing.
|
|
5
|
+
* SMMA = (prev_smma * (length - 1) + src) / length
|
|
6
|
+
*/
|
|
7
|
+
import { type IndicatorResult, type InputConfig, type PlotConfig, type Bar } from 'oakscriptjs';
|
|
8
|
+
export interface SMMAInputs {
|
|
9
|
+
/** Period length */
|
|
10
|
+
length: number;
|
|
11
|
+
}
|
|
12
|
+
export declare const defaultInputs: SMMAInputs;
|
|
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<SMMAInputs>): IndicatorResult;
|
|
21
|
+
export declare const SMMA: {
|
|
22
|
+
calculate: typeof calculate;
|
|
23
|
+
metadata: {
|
|
24
|
+
title: string;
|
|
25
|
+
shortTitle: string;
|
|
26
|
+
overlay: boolean;
|
|
27
|
+
};
|
|
28
|
+
defaultInputs: SMMAInputs;
|
|
29
|
+
inputConfig: InputConfig[];
|
|
30
|
+
plotConfig: PlotConfig[];
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=smma.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smma.d.ts","sourceRoot":"","sources":["../src/smma.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,UAAU;IACzB,oBAAoB;IACpB,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,wBAAgB,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,MAAM,GAAE,OAAO,CAAC,UAAU,CAAM,GAAG,eAAe,CAwBxF;AAED,eAAO,MAAM,IAAI;;;;;;;;;;CAMhB,CAAC"}
|
package/dist/stdev.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Standard Deviation Indicator
|
|
3
|
+
*
|
|
4
|
+
* Measures volatility by calculating the standard deviation of price.
|
|
5
|
+
*/
|
|
6
|
+
import { type IndicatorResult, type InputConfig, type PlotConfig, type Bar } from 'oakscriptjs';
|
|
7
|
+
export interface StDevInputs {
|
|
8
|
+
/** Period length */
|
|
9
|
+
length: number;
|
|
10
|
+
}
|
|
11
|
+
export declare const defaultInputs: StDevInputs;
|
|
12
|
+
export declare const inputConfig: InputConfig[];
|
|
13
|
+
export declare const plotConfig: PlotConfig[];
|
|
14
|
+
export declare const metadata: {
|
|
15
|
+
title: string;
|
|
16
|
+
shortTitle: string;
|
|
17
|
+
overlay: boolean;
|
|
18
|
+
};
|
|
19
|
+
export declare function calculate(bars: Bar[], inputs?: Partial<StDevInputs>): IndicatorResult;
|
|
20
|
+
export declare const StandardDeviation: {
|
|
21
|
+
calculate: typeof calculate;
|
|
22
|
+
metadata: {
|
|
23
|
+
title: string;
|
|
24
|
+
shortTitle: string;
|
|
25
|
+
overlay: boolean;
|
|
26
|
+
};
|
|
27
|
+
defaultInputs: StDevInputs;
|
|
28
|
+
inputConfig: InputConfig[];
|
|
29
|
+
plotConfig: PlotConfig[];
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=stdev.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stdev.d.ts","sourceRoot":"","sources":["../src/stdev.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAc,KAAK,eAAe,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,KAAK,GAAG,EAAE,MAAM,aAAa,CAAC;AAE5G,MAAM,WAAW,WAAW;IAC1B,oBAAoB;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,aAAa,EAAE,WAE3B,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,WAAW,CAAM,GAAG,eAAe,CAuBzF;AAED,eAAO,MAAM,iBAAiB;;;;;;;;;;CAM7B,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stochastic RSI Indicator
|
|
3
|
+
*
|
|
4
|
+
* Applies the Stochastic formula to RSI values.
|
|
5
|
+
* More sensitive than standard RSI.
|
|
6
|
+
*/
|
|
7
|
+
import { type IndicatorResult, type InputConfig, type PlotConfig, type Bar } from 'oakscriptjs';
|
|
8
|
+
export interface StochRSIInputs {
|
|
9
|
+
/** K smoothing period */
|
|
10
|
+
smoothK: number;
|
|
11
|
+
/** D smoothing period */
|
|
12
|
+
smoothD: number;
|
|
13
|
+
/** RSI period */
|
|
14
|
+
lengthRSI: number;
|
|
15
|
+
/** Stochastic period */
|
|
16
|
+
lengthStoch: number;
|
|
17
|
+
}
|
|
18
|
+
export declare const defaultInputs: StochRSIInputs;
|
|
19
|
+
export declare const inputConfig: InputConfig[];
|
|
20
|
+
export declare const plotConfig: PlotConfig[];
|
|
21
|
+
export declare const metadata: {
|
|
22
|
+
title: string;
|
|
23
|
+
shortTitle: string;
|
|
24
|
+
overlay: boolean;
|
|
25
|
+
};
|
|
26
|
+
export declare function calculate(bars: Bar[], inputs?: Partial<StochRSIInputs>): IndicatorResult;
|
|
27
|
+
export declare const StochRSI: {
|
|
28
|
+
calculate: typeof calculate;
|
|
29
|
+
metadata: {
|
|
30
|
+
title: string;
|
|
31
|
+
shortTitle: string;
|
|
32
|
+
overlay: boolean;
|
|
33
|
+
};
|
|
34
|
+
defaultInputs: StochRSIInputs;
|
|
35
|
+
inputConfig: InputConfig[];
|
|
36
|
+
plotConfig: PlotConfig[];
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=stoch-rsi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stoch-rsi.d.ts","sourceRoot":"","sources":["../src/stoch-rsi.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,cAAc;IAC7B,yBAAyB;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,yBAAyB;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,wBAAwB;IACxB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,aAAa,EAAE,cAK3B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,WAAW,EAKpC,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,cAAc,CAAM,GAAG,eAAe,CA2C5F;AAED,eAAO,MAAM,QAAQ;;;;;;;;;;CAMpB,CAAC"}
|
package/dist/stoch.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stochastic Oscillator Indicator
|
|
3
|
+
*
|
|
4
|
+
* Hand-optimized implementation using oakscriptjs.
|
|
5
|
+
* Compares closing price to its price range over a given period.
|
|
6
|
+
*/
|
|
7
|
+
import { type IndicatorResult, type InputConfig, type PlotConfig, type Bar } from 'oakscriptjs';
|
|
8
|
+
export interface StochasticInputs {
|
|
9
|
+
periodK: number;
|
|
10
|
+
smoothK: number;
|
|
11
|
+
periodD: number;
|
|
12
|
+
}
|
|
13
|
+
export declare const defaultInputs: StochasticInputs;
|
|
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<StochasticInputs>): IndicatorResult;
|
|
22
|
+
export declare const Stochastic: {
|
|
23
|
+
calculate: typeof calculate;
|
|
24
|
+
metadata: {
|
|
25
|
+
title: string;
|
|
26
|
+
shortTitle: string;
|
|
27
|
+
overlay: boolean;
|
|
28
|
+
};
|
|
29
|
+
defaultInputs: StochasticInputs;
|
|
30
|
+
inputConfig: InputConfig[];
|
|
31
|
+
plotConfig: PlotConfig[];
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=stoch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stoch.d.ts","sourceRoot":"","sources":["../src/stoch.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,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,aAAa,EAAE,gBAI3B,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,gBAAgB,CAAM,GAAG,eAAe,CAiC9F;AAED,eAAO,MAAM,UAAU;;;;;;;;;;CAAkE,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Supertrend Indicator
|
|
3
|
+
*
|
|
4
|
+
* Hand-optimized implementation using oakscriptjs.
|
|
5
|
+
* A trend-following overlay indicator that uses ATR to calculate
|
|
6
|
+
* dynamic support/resistance levels.
|
|
7
|
+
*/
|
|
8
|
+
import { type IndicatorResult, type InputConfig, type PlotConfig, type Bar } from 'oakscriptjs';
|
|
9
|
+
/**
|
|
10
|
+
* Supertrend indicator input parameters
|
|
11
|
+
*/
|
|
12
|
+
export interface SupertrendInputs {
|
|
13
|
+
/** ATR period length */
|
|
14
|
+
atrPeriod: number;
|
|
15
|
+
/** ATR multiplier factor */
|
|
16
|
+
factor: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Default input values matching TradingView defaults
|
|
20
|
+
*/
|
|
21
|
+
export declare const defaultInputs: SupertrendInputs;
|
|
22
|
+
/**
|
|
23
|
+
* Input configuration for UI
|
|
24
|
+
*/
|
|
25
|
+
export declare const inputConfig: InputConfig[];
|
|
26
|
+
/**
|
|
27
|
+
* Plot configuration - order matches CSV: Up Trend, Down Trend
|
|
28
|
+
*/
|
|
29
|
+
export declare const plotConfig: PlotConfig[];
|
|
30
|
+
/**
|
|
31
|
+
* Indicator metadata
|
|
32
|
+
*/
|
|
33
|
+
export declare const metadata: {
|
|
34
|
+
title: string;
|
|
35
|
+
shortTitle: string;
|
|
36
|
+
overlay: boolean;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Calculate Supertrend indicator
|
|
40
|
+
*
|
|
41
|
+
* @param bars - OHLCV bar data
|
|
42
|
+
* @param inputs - Indicator parameters (optional, uses defaults)
|
|
43
|
+
* @returns Indicator result with plot data
|
|
44
|
+
*/
|
|
45
|
+
export declare function calculate(bars: Bar[], inputs?: Partial<SupertrendInputs>): IndicatorResult;
|
|
46
|
+
/**
|
|
47
|
+
* Supertrend indicator module
|
|
48
|
+
*/
|
|
49
|
+
export declare const Supertrend: {
|
|
50
|
+
calculate: typeof calculate;
|
|
51
|
+
metadata: {
|
|
52
|
+
title: string;
|
|
53
|
+
shortTitle: string;
|
|
54
|
+
overlay: boolean;
|
|
55
|
+
};
|
|
56
|
+
defaultInputs: SupertrendInputs;
|
|
57
|
+
inputConfig: InputConfig[];
|
|
58
|
+
plotConfig: PlotConfig[];
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=supertrend.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"supertrend.d.ts","sourceRoot":"","sources":["../src/supertrend.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAM,KAAK,eAAe,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,KAAK,GAAG,EAAE,MAAM,aAAa,CAAC;AAEpG;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,wBAAwB;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,4BAA4B;IAC5B,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,gBAG3B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,WAAW,EAGpC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,UAAU,EAGlC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,QAAQ;;;;CAIpB,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,MAAM,GAAE,OAAO,CAAC,gBAAgB,CAAM,GAAG,eAAe,CAiC9F;AAED;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;CAMtB,CAAC"}
|
package/dist/tema.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Triple Exponential Moving Average (TEMA) Indicator
|
|
3
|
+
*
|
|
4
|
+
* Hand-optimized implementation using oakscriptjs.
|
|
5
|
+
* Further reduces lag: TEMA = 3*EMA - 3*EMA(EMA) + EMA(EMA(EMA))
|
|
6
|
+
*/
|
|
7
|
+
import { type IndicatorResult, type InputConfig, type PlotConfig, type Bar, type SourceType } from 'oakscriptjs';
|
|
8
|
+
export interface TEMAInputs {
|
|
9
|
+
length: number;
|
|
10
|
+
src: SourceType;
|
|
11
|
+
offset: number;
|
|
12
|
+
}
|
|
13
|
+
export declare const defaultInputs: TEMAInputs;
|
|
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<TEMAInputs>): IndicatorResult;
|
|
22
|
+
export declare const TEMA: {
|
|
23
|
+
calculate: typeof calculate;
|
|
24
|
+
metadata: {
|
|
25
|
+
title: string;
|
|
26
|
+
shortTitle: string;
|
|
27
|
+
overlay: boolean;
|
|
28
|
+
};
|
|
29
|
+
defaultInputs: TEMAInputs;
|
|
30
|
+
inputConfig: InputConfig[];
|
|
31
|
+
plotConfig: PlotConfig[];
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=tema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tema.d.ts","sourceRoot":"","sources":["../src/tema.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,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,UAAU,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,aAAa,EAAE,UAI3B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,WAAW,EAIpC,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,CAmBxF;AAED,eAAO,MAAM,IAAI;;;;;;;;;;CAAkE,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trend Strength Index
|
|
3
|
+
*
|
|
4
|
+
* Measures trend strength using the Pearson correlation between
|
|
5
|
+
* closing prices and bar indices over a rolling window.
|
|
6
|
+
* Range: -1 to 1, where positive = uptrend, negative = downtrend.
|
|
7
|
+
* Formula: correlation(close, bar_index, length)
|
|
8
|
+
*/
|
|
9
|
+
import { type IndicatorResult, type InputConfig, type PlotConfig, type Bar } from 'oakscriptjs';
|
|
10
|
+
export interface TrendStrengthInputs {
|
|
11
|
+
/** Period length */
|
|
12
|
+
length: number;
|
|
13
|
+
}
|
|
14
|
+
export declare const defaultInputs: TrendStrengthInputs;
|
|
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<TrendStrengthInputs>): IndicatorResult;
|
|
23
|
+
export declare const TrendStrengthIndex: {
|
|
24
|
+
calculate: typeof calculate;
|
|
25
|
+
metadata: {
|
|
26
|
+
title: string;
|
|
27
|
+
shortTitle: string;
|
|
28
|
+
overlay: boolean;
|
|
29
|
+
};
|
|
30
|
+
defaultInputs: TrendStrengthInputs;
|
|
31
|
+
inputConfig: InputConfig[];
|
|
32
|
+
plotConfig: PlotConfig[];
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=trend-strength.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trend-strength.d.ts","sourceRoot":"","sources":["../src/trend-strength.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,mBAAmB;IAClC,oBAAoB;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,aAAa,EAAE,mBAE3B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,WAAW,EAEpC,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,UAAU,EAElC,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;CAIpB,CAAC;AAqCF,wBAAgB,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,MAAM,GAAE,OAAO,CAAC,mBAAmB,CAAM,GAAG,eAAe,CAyCjG;AAED,eAAO,MAAM,kBAAkB;;;;;;;;;;CAM9B,CAAC"}
|