@tradejs/core 1.0.8 → 1.0.10

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 (41) hide show
  1. package/dist/backtest.d.mts +109 -9
  2. package/dist/backtest.d.ts +109 -9
  3. package/dist/backtest.js +487 -145
  4. package/dist/backtest.mjs +414 -82
  5. package/dist/chunk-7P2KNFD4.mjs +11847 -0
  6. package/dist/{chunk-JLORHLL6.mjs → chunk-DXJ4NCFJ.mjs} +65 -6
  7. package/dist/chunk-OJPHC3S2.mjs +8 -0
  8. package/dist/{chunk-PQETJ42A.mjs → chunk-PNBS6J3G.mjs} +22 -1
  9. package/dist/constants.d.mts +26 -5
  10. package/dist/constants.d.ts +26 -5
  11. package/dist/constants.js +81 -9
  12. package/dist/constants.mjs +31 -5
  13. package/dist/data.mjs +3 -5
  14. package/dist/grid.d.mts +9 -0
  15. package/dist/grid.d.ts +9 -0
  16. package/dist/grid.js +168 -0
  17. package/dist/grid.mjs +98 -0
  18. package/dist/indicators-Da_i06-8.d.mts +288 -0
  19. package/dist/indicators-Da_i06-8.d.ts +288 -0
  20. package/dist/indicators.d.mts +4 -39
  21. package/dist/indicators.d.ts +4 -39
  22. package/dist/indicators.js +10488 -423
  23. package/dist/indicators.mjs +11 -3
  24. package/dist/strategies.d.mts +31 -12
  25. package/dist/strategies.d.ts +31 -12
  26. package/dist/strategies.js +11283 -336
  27. package/dist/strategies.mjs +1246 -119
  28. package/dist/{time-BMkFD4Kd.d.mts → time-BQ3AXmxo.d.mts} +3 -1
  29. package/dist/{time-BMkFD4Kd.d.ts → time-BQ3AXmxo.d.ts} +3 -1
  30. package/dist/time.d.mts +1 -1
  31. package/dist/time.d.ts +1 -1
  32. package/dist/time.js +38 -0
  33. package/dist/time.mjs +6 -2
  34. package/dist/trade.d.mts +54 -0
  35. package/dist/trade.d.ts +54 -0
  36. package/dist/trade.js +352 -0
  37. package/dist/trade.mjs +264 -0
  38. package/package.json +19 -5
  39. package/dist/chunk-622V7IAT.mjs +0 -1810
  40. package/dist/indicators-B-GGjP5F.d.mts +0 -65
  41. package/dist/indicators-B-GGjP5F.d.ts +0 -65
@@ -1,65 +0,0 @@
1
- import { Candle, MlCandleIndicatorsSnapshot, IndicatorSnapshot, IndicatorsHistorySnapshot } from '@tradejs/types';
2
-
3
- declare const buildMlCandleIndicators: (candles: Candle[], btcCandles: Candle[]) => MlCandleIndicatorsSnapshot;
4
- type IndicatorValue = number | null | undefined;
5
- type TrendlineIndicatorHistoryPush = (key: string, value: number | null | undefined) => void;
6
- type TrendlineIndicators = {
7
- maFast: IndicatorValue;
8
- maMedium: IndicatorValue;
9
- maSlow: IndicatorValue;
10
- atr: IndicatorValue;
11
- atrPct: IndicatorValue;
12
- bbUpper: IndicatorValue;
13
- bbMiddle: IndicatorValue;
14
- bbLower: IndicatorValue;
15
- obv: IndicatorValue;
16
- smaObv: IndicatorValue;
17
- macd: IndicatorValue;
18
- macdSignal: IndicatorValue;
19
- macdHistogram: IndicatorValue;
20
- price24hPcnt: IndicatorValue;
21
- price1hPcnt: IndicatorValue;
22
- highPrice1h: IndicatorValue;
23
- lowPrice1h: IndicatorValue;
24
- volume1h: IndicatorValue;
25
- highPrice24h: IndicatorValue;
26
- lowPrice24h: IndicatorValue;
27
- volume24h: IndicatorValue;
28
- highLevel: IndicatorValue;
29
- lowLevel: IndicatorValue;
30
- prevClose: IndicatorValue;
31
- correlation: IndicatorValue;
32
- spread: IndicatorValue;
33
- };
34
- type CreateIndicatorsOptions = {
35
- includeMlPayload?: boolean;
36
- btcBinanceData?: Candle[];
37
- btcCoinbaseData?: Candle[];
38
- pluginRegistryScope?: string;
39
- };
40
- interface IndicatorPeriods {
41
- maFast: number;
42
- maMedium: number;
43
- maSlow: number;
44
- obvSma: number;
45
- atr: number;
46
- atrPctShort: number;
47
- atrPctLong: number;
48
- bb: number;
49
- bbStd: number;
50
- macdFast: number;
51
- macdSlow: number;
52
- macdSignal: number;
53
- levelLookback: number;
54
- levelDelay: number;
55
- }
56
- declare const applyIndicatorsToHistory: (indicators: TrendlineIndicators, pushIndicator: TrendlineIndicatorHistoryPush) => void;
57
- declare const createIndicators: (data: Candle[], btcData?: Candle[], options?: CreateIndicatorsOptions & {
58
- periods?: Partial<IndicatorPeriods>;
59
- }) => {
60
- next: (candle: Candle, btcCandle?: Candle) => IndicatorSnapshot | null;
61
- result: () => IndicatorsHistorySnapshot;
62
- };
63
- declare const buildMlTimeframeIndicators: (candles: Candle[], periods?: Partial<IndicatorPeriods>) => Record<string, number[]>;
64
-
65
- export { type IndicatorPeriods as I, applyIndicatorsToHistory as a, buildMlCandleIndicators as b, buildMlTimeframeIndicators as c, createIndicators as d };
@@ -1,65 +0,0 @@
1
- import { Candle, MlCandleIndicatorsSnapshot, IndicatorSnapshot, IndicatorsHistorySnapshot } from '@tradejs/types';
2
-
3
- declare const buildMlCandleIndicators: (candles: Candle[], btcCandles: Candle[]) => MlCandleIndicatorsSnapshot;
4
- type IndicatorValue = number | null | undefined;
5
- type TrendlineIndicatorHistoryPush = (key: string, value: number | null | undefined) => void;
6
- type TrendlineIndicators = {
7
- maFast: IndicatorValue;
8
- maMedium: IndicatorValue;
9
- maSlow: IndicatorValue;
10
- atr: IndicatorValue;
11
- atrPct: IndicatorValue;
12
- bbUpper: IndicatorValue;
13
- bbMiddle: IndicatorValue;
14
- bbLower: IndicatorValue;
15
- obv: IndicatorValue;
16
- smaObv: IndicatorValue;
17
- macd: IndicatorValue;
18
- macdSignal: IndicatorValue;
19
- macdHistogram: IndicatorValue;
20
- price24hPcnt: IndicatorValue;
21
- price1hPcnt: IndicatorValue;
22
- highPrice1h: IndicatorValue;
23
- lowPrice1h: IndicatorValue;
24
- volume1h: IndicatorValue;
25
- highPrice24h: IndicatorValue;
26
- lowPrice24h: IndicatorValue;
27
- volume24h: IndicatorValue;
28
- highLevel: IndicatorValue;
29
- lowLevel: IndicatorValue;
30
- prevClose: IndicatorValue;
31
- correlation: IndicatorValue;
32
- spread: IndicatorValue;
33
- };
34
- type CreateIndicatorsOptions = {
35
- includeMlPayload?: boolean;
36
- btcBinanceData?: Candle[];
37
- btcCoinbaseData?: Candle[];
38
- pluginRegistryScope?: string;
39
- };
40
- interface IndicatorPeriods {
41
- maFast: number;
42
- maMedium: number;
43
- maSlow: number;
44
- obvSma: number;
45
- atr: number;
46
- atrPctShort: number;
47
- atrPctLong: number;
48
- bb: number;
49
- bbStd: number;
50
- macdFast: number;
51
- macdSlow: number;
52
- macdSignal: number;
53
- levelLookback: number;
54
- levelDelay: number;
55
- }
56
- declare const applyIndicatorsToHistory: (indicators: TrendlineIndicators, pushIndicator: TrendlineIndicatorHistoryPush) => void;
57
- declare const createIndicators: (data: Candle[], btcData?: Candle[], options?: CreateIndicatorsOptions & {
58
- periods?: Partial<IndicatorPeriods>;
59
- }) => {
60
- next: (candle: Candle, btcCandle?: Candle) => IndicatorSnapshot | null;
61
- result: () => IndicatorsHistorySnapshot;
62
- };
63
- declare const buildMlTimeframeIndicators: (candles: Candle[], periods?: Partial<IndicatorPeriods>) => Record<string, number[]>;
64
-
65
- export { type IndicatorPeriods as I, applyIndicatorsToHistory as a, buildMlCandleIndicators as b, buildMlTimeframeIndicators as c, createIndicators as d };