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
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Donchian Channels (DC) Indicator
|
|
3
|
+
*
|
|
4
|
+
* Hand-optimized implementation using oakscriptjs.
|
|
5
|
+
* A trend-following indicator that shows the highest high and lowest low
|
|
6
|
+
* over a specified period, with a midline (basis).
|
|
7
|
+
*/
|
|
8
|
+
import { type IndicatorResult, type InputConfig, type PlotConfig, type Bar } from 'oakscriptjs';
|
|
9
|
+
/**
|
|
10
|
+
* Donchian Channels indicator input parameters
|
|
11
|
+
*/
|
|
12
|
+
export interface DonchianInputs {
|
|
13
|
+
/** Lookback period */
|
|
14
|
+
length: number;
|
|
15
|
+
/** Plot offset */
|
|
16
|
+
offset: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Default input values matching TradingView defaults
|
|
20
|
+
*/
|
|
21
|
+
export declare const defaultInputs: DonchianInputs;
|
|
22
|
+
/**
|
|
23
|
+
* Input configuration for UI
|
|
24
|
+
*/
|
|
25
|
+
export declare const inputConfig: InputConfig[];
|
|
26
|
+
/**
|
|
27
|
+
* Plot configuration - order matches CSV: Basis, Upper, Lower
|
|
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 Donchian Channels 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<DonchianInputs>): IndicatorResult;
|
|
46
|
+
/**
|
|
47
|
+
* Donchian Channels indicator module
|
|
48
|
+
*/
|
|
49
|
+
export declare const DonchianChannels: {
|
|
50
|
+
calculate: typeof calculate;
|
|
51
|
+
metadata: {
|
|
52
|
+
title: string;
|
|
53
|
+
shortTitle: string;
|
|
54
|
+
overlay: boolean;
|
|
55
|
+
};
|
|
56
|
+
defaultInputs: DonchianInputs;
|
|
57
|
+
inputConfig: InputConfig[];
|
|
58
|
+
plotConfig: PlotConfig[];
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=donchian.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"donchian.d.ts","sourceRoot":"","sources":["../src/donchian.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAc,KAAK,eAAe,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,KAAK,GAAG,EAAE,MAAM,aAAa,CAAC;AAE5G;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,sBAAsB;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,kBAAkB;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,cAG3B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,WAAW,EAGpC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,UAAU,EAIlC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,QAAQ;;;;CAIpB,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,MAAM,GAAE,OAAO,CAAC,cAAc,CAAM,GAAG,eAAe,CAuD5F;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;CAM5B,CAAC"}
|
package/dist/dpo.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Detrended Price Oscillator (DPO) Indicator
|
|
3
|
+
*
|
|
4
|
+
* Removes trend from price to identify cycles.
|
|
5
|
+
* DPO = Close - SMA(Close, length)[length/2 + 1]
|
|
6
|
+
*/
|
|
7
|
+
import { type IndicatorResult, type InputConfig, type PlotConfig, type Bar } from 'oakscriptjs';
|
|
8
|
+
export interface DPOInputs {
|
|
9
|
+
/** Period length */
|
|
10
|
+
length: number;
|
|
11
|
+
/** Whether to center the DPO */
|
|
12
|
+
centered: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare const defaultInputs: DPOInputs;
|
|
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<DPOInputs>): IndicatorResult;
|
|
23
|
+
export declare const DPO: {
|
|
24
|
+
calculate: typeof calculate;
|
|
25
|
+
metadata: {
|
|
26
|
+
title: string;
|
|
27
|
+
shortTitle: string;
|
|
28
|
+
overlay: boolean;
|
|
29
|
+
};
|
|
30
|
+
defaultInputs: DPOInputs;
|
|
31
|
+
inputConfig: InputConfig[];
|
|
32
|
+
plotConfig: PlotConfig[];
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=dpo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dpo.d.ts","sourceRoot":"","sources":["../src/dpo.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,oBAAoB;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,gCAAgC;IAChC,QAAQ,EAAE,OAAO,CAAC;CACnB;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,CAwCvF;AAED,eAAO,MAAM,GAAG;;;;;;;;;;CAMf,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ease of Movement Indicator
|
|
3
|
+
*
|
|
4
|
+
* Relates price change to volume, showing how easily price moves.
|
|
5
|
+
* EOM = SMA((high + low)/2 - (prev_high + prev_low)/2) * (high - low) / volume, length)
|
|
6
|
+
* The divisor is used to normalize the volume.
|
|
7
|
+
*/
|
|
8
|
+
import { type IndicatorResult, type InputConfig, type PlotConfig, type Bar } from 'oakscriptjs';
|
|
9
|
+
export interface EaseOfMovementInputs {
|
|
10
|
+
/** Period length */
|
|
11
|
+
length: number;
|
|
12
|
+
/** Volume divisor for normalization */
|
|
13
|
+
divisor: number;
|
|
14
|
+
}
|
|
15
|
+
export declare const defaultInputs: EaseOfMovementInputs;
|
|
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<EaseOfMovementInputs>): IndicatorResult;
|
|
24
|
+
export declare const EaseOfMovement: {
|
|
25
|
+
calculate: typeof calculate;
|
|
26
|
+
metadata: {
|
|
27
|
+
title: string;
|
|
28
|
+
shortTitle: string;
|
|
29
|
+
overlay: boolean;
|
|
30
|
+
};
|
|
31
|
+
defaultInputs: EaseOfMovementInputs;
|
|
32
|
+
inputConfig: InputConfig[];
|
|
33
|
+
plotConfig: PlotConfig[];
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=ease-of-movement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ease-of-movement.d.ts","sourceRoot":"","sources":["../src/ease-of-movement.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,oBAAoB;IACnC,oBAAoB;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,uCAAuC;IACvC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,aAAa,EAAE,oBAG3B,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,oBAAoB,CAAM,GAAG,eAAe,CA0ClG;AAED,eAAO,MAAM,cAAc;;;;;;;;;;CAM1B,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Elder Force Index (EFI) Indicator
|
|
3
|
+
*
|
|
4
|
+
* Measures the power behind price movements using
|
|
5
|
+
* price change and volume.
|
|
6
|
+
* EFI = EMA(change(close) * volume, length)
|
|
7
|
+
*/
|
|
8
|
+
import { type IndicatorResult, type InputConfig, type PlotConfig, type Bar } from 'oakscriptjs';
|
|
9
|
+
export interface ElderForceInputs {
|
|
10
|
+
/** EMA period length */
|
|
11
|
+
length: number;
|
|
12
|
+
}
|
|
13
|
+
export declare const defaultInputs: ElderForceInputs;
|
|
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<ElderForceInputs>): IndicatorResult;
|
|
22
|
+
export declare const ElderForceIndex: {
|
|
23
|
+
calculate: typeof calculate;
|
|
24
|
+
metadata: {
|
|
25
|
+
title: string;
|
|
26
|
+
shortTitle: string;
|
|
27
|
+
overlay: boolean;
|
|
28
|
+
};
|
|
29
|
+
defaultInputs: ElderForceInputs;
|
|
30
|
+
inputConfig: InputConfig[];
|
|
31
|
+
plotConfig: PlotConfig[];
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=elder-force.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elder-force.d.ts","sourceRoot":"","sources":["../src/elder-force.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,wBAAwB;IACxB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,aAAa,EAAE,gBAE3B,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,gBAAgB,CAAM,GAAG,eAAe,CA8B9F;AAED,eAAO,MAAM,eAAe;;;;;;;;;;CAM3B,CAAC"}
|
package/dist/ema.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Exponential Moving Average (EMA) Indicator
|
|
3
|
+
*
|
|
4
|
+
* Hand-optimized implementation using oakscriptjs.
|
|
5
|
+
* A weighted moving average that gives more weight to recent prices.
|
|
6
|
+
*/
|
|
7
|
+
import { type IndicatorResult, type InputConfig, type PlotConfig, type Bar, type SourceType } from 'oakscriptjs';
|
|
8
|
+
export interface EMAInputs {
|
|
9
|
+
length: number;
|
|
10
|
+
src: SourceType;
|
|
11
|
+
offset: number;
|
|
12
|
+
}
|
|
13
|
+
export declare const defaultInputs: EMAInputs;
|
|
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<EMAInputs>): IndicatorResult;
|
|
22
|
+
export declare const EMA: {
|
|
23
|
+
calculate: typeof calculate;
|
|
24
|
+
metadata: {
|
|
25
|
+
title: string;
|
|
26
|
+
shortTitle: string;
|
|
27
|
+
overlay: boolean;
|
|
28
|
+
};
|
|
29
|
+
defaultInputs: EMAInputs;
|
|
30
|
+
inputConfig: InputConfig[];
|
|
31
|
+
plotConfig: PlotConfig[];
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=ema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ema.d.ts","sourceRoot":"","sources":["../src/ema.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;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,aAAa,EAAE,SAI3B,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,SAAS,CAAM,GAAG,eAAe,CAcvF;AAED,eAAO,MAAM,GAAG;;;;;;;;;;CAAkE,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Envelope Indicator
|
|
3
|
+
*
|
|
4
|
+
* Price envelope with a moving average basis and upper/lower bands
|
|
5
|
+
* at a fixed percentage distance from the basis.
|
|
6
|
+
*/
|
|
7
|
+
import { type IndicatorResult, type InputConfig, type PlotConfig, type Bar, type SourceType } from 'oakscriptjs';
|
|
8
|
+
export interface EnvelopeInputs {
|
|
9
|
+
/** Period length */
|
|
10
|
+
length: number;
|
|
11
|
+
/** Percent distance for bands */
|
|
12
|
+
percent: number;
|
|
13
|
+
/** Price source */
|
|
14
|
+
src: SourceType;
|
|
15
|
+
/** Use exponential MA */
|
|
16
|
+
exponential: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare const defaultInputs: EnvelopeInputs;
|
|
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<EnvelopeInputs>): IndicatorResult;
|
|
27
|
+
export declare const Envelope: {
|
|
28
|
+
calculate: typeof calculate;
|
|
29
|
+
metadata: {
|
|
30
|
+
title: string;
|
|
31
|
+
shortTitle: string;
|
|
32
|
+
overlay: boolean;
|
|
33
|
+
};
|
|
34
|
+
defaultInputs: EnvelopeInputs;
|
|
35
|
+
inputConfig: InputConfig[];
|
|
36
|
+
plotConfig: PlotConfig[];
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=envelope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"envelope.d.ts","sourceRoot":"","sources":["../src/envelope.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,cAAc;IAC7B,oBAAoB;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,iCAAiC;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,mBAAmB;IACnB,GAAG,EAAE,UAAU,CAAC;IAChB,yBAAyB;IACzB,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,eAAO,MAAM,aAAa,EAAE,cAK3B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,WAAW,EAKpC,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,UAAU,EAIlC,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;CAIpB,CAAC;AAEF,wBAAgB,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,MAAM,GAAE,OAAO,CAAC,cAAc,CAAM,GAAG,eAAe,CAqC5F;AAED,eAAO,MAAM,QAAQ;;;;;;;;;;CAMpB,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fisher Transform Indicator
|
|
3
|
+
*
|
|
4
|
+
* Converts prices into a Gaussian normal distribution, making
|
|
5
|
+
* turning points easier to identify.
|
|
6
|
+
*
|
|
7
|
+
* Based on TradingView's Fisher Transform indicator.
|
|
8
|
+
*/
|
|
9
|
+
import type { Bar } from 'oakscriptjs';
|
|
10
|
+
import type { InputConfig, PlotConfig } from './index.js';
|
|
11
|
+
export interface FisherTransformInputs {
|
|
12
|
+
/** Lookback period for highest/lowest calculation */
|
|
13
|
+
length: number;
|
|
14
|
+
}
|
|
15
|
+
export declare const defaultInputs: FisherTransformInputs;
|
|
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
|
+
/**
|
|
24
|
+
* Calculate Fisher Transform
|
|
25
|
+
*
|
|
26
|
+
* Algorithm:
|
|
27
|
+
* 1. Calculate hl2 (midpoint of high and low)
|
|
28
|
+
* 2. Normalize to range [-1, 1] using highest/lowest over length
|
|
29
|
+
* 3. Apply smoothing with previous value
|
|
30
|
+
* 4. Apply Fisher Transform: 0.5 * ln((1+x)/(1-x))
|
|
31
|
+
*/
|
|
32
|
+
export declare function calculate(bars: Bar[], inputs?: Partial<FisherTransformInputs>): ReturnType<typeof import('./index.js').SMA.calculate>;
|
|
33
|
+
export declare const FisherTransform: {
|
|
34
|
+
calculate: typeof calculate;
|
|
35
|
+
metadata: {
|
|
36
|
+
title: string;
|
|
37
|
+
shortTitle: string;
|
|
38
|
+
overlay: boolean;
|
|
39
|
+
};
|
|
40
|
+
defaultInputs: FisherTransformInputs;
|
|
41
|
+
inputConfig: InputConfig[];
|
|
42
|
+
plotConfig: PlotConfig[];
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=fisher-transform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fisher-transform.d.ts","sourceRoot":"","sources":["../src/fisher-transform.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,qBAAqB;IACpC,qDAAqD;IACrD,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,aAAa,EAAE,qBAE3B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,WAAW,EAEpC,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,UAAU,EAGlC,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;CAIpB,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,MAAM,GAAE,OAAO,CAAC,qBAAqB,CAAM,GAAG,UAAU,CAAC,cAAc,YAAY,EAAE,GAAG,CAAC,SAAS,CAAC,CAgEzI;AAED,eAAO,MAAM,eAAe;;;;;;;;;;CAM3B,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Historical Volatility (HV) Indicator
|
|
3
|
+
*
|
|
4
|
+
* Measures the annualized standard deviation of log returns.
|
|
5
|
+
* HV = 100 * stdev(ln(close/close[1]), length) * sqrt(annual/per)
|
|
6
|
+
*/
|
|
7
|
+
import { type IndicatorResult, type InputConfig, type PlotConfig, type Bar } from 'oakscriptjs';
|
|
8
|
+
export interface HistoricalVolatilityInputs {
|
|
9
|
+
/** Period length */
|
|
10
|
+
length: number;
|
|
11
|
+
/** Annual trading days */
|
|
12
|
+
annual: number;
|
|
13
|
+
/** Period multiplier (1 for daily, 7 for weekly) */
|
|
14
|
+
per: number;
|
|
15
|
+
}
|
|
16
|
+
export declare const defaultInputs: HistoricalVolatilityInputs;
|
|
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<HistoricalVolatilityInputs>): IndicatorResult;
|
|
25
|
+
export declare const HistoricalVolatility: {
|
|
26
|
+
calculate: typeof calculate;
|
|
27
|
+
metadata: {
|
|
28
|
+
title: string;
|
|
29
|
+
shortTitle: string;
|
|
30
|
+
overlay: boolean;
|
|
31
|
+
};
|
|
32
|
+
defaultInputs: HistoricalVolatilityInputs;
|
|
33
|
+
inputConfig: InputConfig[];
|
|
34
|
+
plotConfig: PlotConfig[];
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=historical-volatility.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"historical-volatility.d.ts","sourceRoot":"","sources":["../src/historical-volatility.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,0BAA0B;IACzC,oBAAoB;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,0BAA0B;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,oDAAoD;IACpD,GAAG,EAAE,MAAM,CAAC;CACb;AAED,eAAO,MAAM,aAAa,EAAE,0BAI3B,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,0BAA0B,CAAM,GAAG,eAAe,CAgCxG;AAED,eAAO,MAAM,oBAAoB;;;;;;;;;;CAMhC,CAAC"}
|
package/dist/hma.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hull Moving Average (HMA) Indicator
|
|
3
|
+
*
|
|
4
|
+
* Hand-optimized implementation using oakscriptjs.
|
|
5
|
+
* Reduces lag while maintaining smoothness using weighted moving averages.
|
|
6
|
+
*/
|
|
7
|
+
import { type IndicatorResult, type InputConfig, type PlotConfig, type Bar, type SourceType } from 'oakscriptjs';
|
|
8
|
+
export interface HMAInputs {
|
|
9
|
+
length: number;
|
|
10
|
+
src: SourceType;
|
|
11
|
+
}
|
|
12
|
+
export declare const defaultInputs: HMAInputs;
|
|
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<HMAInputs>): IndicatorResult;
|
|
21
|
+
export declare const HMA: {
|
|
22
|
+
calculate: typeof calculate;
|
|
23
|
+
metadata: {
|
|
24
|
+
title: string;
|
|
25
|
+
shortTitle: string;
|
|
26
|
+
overlay: boolean;
|
|
27
|
+
};
|
|
28
|
+
defaultInputs: HMAInputs;
|
|
29
|
+
inputConfig: InputConfig[];
|
|
30
|
+
plotConfig: PlotConfig[];
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=hma.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hma.d.ts","sourceRoot":"","sources":["../src/hma.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,CAsBvF;AAED,eAAO,MAAM,GAAG;;;;;;;;;;CAAkE,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ichimoku Cloud Indicator
|
|
3
|
+
*
|
|
4
|
+
* Hand-optimized implementation using oakscriptjs.
|
|
5
|
+
* A comprehensive trend-following system that shows support/resistance,
|
|
6
|
+
* momentum, and trend direction all at once.
|
|
7
|
+
*/
|
|
8
|
+
import { type IndicatorResult, type InputConfig, type PlotConfig, type Bar } from 'oakscriptjs';
|
|
9
|
+
/**
|
|
10
|
+
* Ichimoku Cloud indicator input parameters
|
|
11
|
+
*/
|
|
12
|
+
export interface IchimokuInputs {
|
|
13
|
+
/** Conversion Line (Tenkan-sen) period */
|
|
14
|
+
conversionPeriods: number;
|
|
15
|
+
/** Base Line (Kijun-sen) period */
|
|
16
|
+
basePeriods: number;
|
|
17
|
+
/** Leading Span B (Senkou Span B) period */
|
|
18
|
+
laggingSpan2Periods: number;
|
|
19
|
+
/** Displacement for Leading Spans and Lagging Span */
|
|
20
|
+
displacement: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Default input values matching TradingView defaults
|
|
24
|
+
*/
|
|
25
|
+
export declare const defaultInputs: IchimokuInputs;
|
|
26
|
+
/**
|
|
27
|
+
* Input configuration for UI
|
|
28
|
+
*/
|
|
29
|
+
export declare const inputConfig: InputConfig[];
|
|
30
|
+
/**
|
|
31
|
+
* Plot configuration - order matches CSV columns
|
|
32
|
+
*/
|
|
33
|
+
export declare const plotConfig: PlotConfig[];
|
|
34
|
+
/**
|
|
35
|
+
* Indicator metadata
|
|
36
|
+
*/
|
|
37
|
+
export declare const metadata: {
|
|
38
|
+
title: string;
|
|
39
|
+
shortTitle: string;
|
|
40
|
+
overlay: boolean;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Calculate Ichimoku Cloud indicator
|
|
44
|
+
*
|
|
45
|
+
* @param bars - OHLCV bar data
|
|
46
|
+
* @param inputs - Indicator parameters (optional, uses defaults)
|
|
47
|
+
* @returns Indicator result with plot data
|
|
48
|
+
*/
|
|
49
|
+
export declare function calculate(bars: Bar[], inputs?: Partial<IchimokuInputs>): IndicatorResult;
|
|
50
|
+
/**
|
|
51
|
+
* Ichimoku Cloud indicator module
|
|
52
|
+
*/
|
|
53
|
+
export declare const IchimokuCloud: {
|
|
54
|
+
calculate: typeof calculate;
|
|
55
|
+
metadata: {
|
|
56
|
+
title: string;
|
|
57
|
+
shortTitle: string;
|
|
58
|
+
overlay: boolean;
|
|
59
|
+
};
|
|
60
|
+
defaultInputs: IchimokuInputs;
|
|
61
|
+
inputConfig: InputConfig[];
|
|
62
|
+
plotConfig: PlotConfig[];
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=ichimoku.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ichimoku.d.ts","sourceRoot":"","sources":["../src/ichimoku.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAc,KAAK,eAAe,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,KAAK,GAAG,EAAE,MAAM,aAAa,CAAC;AAE5G;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,0CAA0C;IAC1C,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mCAAmC;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,4CAA4C;IAC5C,mBAAmB,EAAE,MAAM,CAAC;IAC5B,sDAAsD;IACtD,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,cAK3B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,WAAW,EAKpC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,UAAU,EAMlC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,QAAQ;;;;CAIpB,CAAC;AAWF;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,MAAM,GAAE,OAAO,CAAC,cAAc,CAAM,GAAG,eAAe,CAuF5F;AAED;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;CAMzB,CAAC"}
|