@tradejs/core 1.0.2 → 1.0.4

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.
@@ -218,8 +218,25 @@ import { SMA, ATR, BollingerBands, OBV, MACD } from "technicalindicators";
218
218
  var warn = (message, ...args) => {
219
219
  console.warn(`[core:indicators] ${message}`, ...args);
220
220
  };
221
- var pluginIndicatorEntries = /* @__PURE__ */ new Map();
222
- var registerIndicatorEntries = (entries, source) => {
221
+ var DEFAULT_INDICATOR_REGISTRY_SCOPE = "__default__";
222
+ var registryStateByScope = /* @__PURE__ */ new Map();
223
+ var normalizeScope = (scope) => {
224
+ const normalized = String(scope ?? "").trim();
225
+ return normalized || DEFAULT_INDICATOR_REGISTRY_SCOPE;
226
+ };
227
+ var getIndicatorRegistryState = (scope) => {
228
+ const normalizedScope = normalizeScope(scope);
229
+ let state = registryStateByScope.get(normalizedScope);
230
+ if (!state) {
231
+ state = {
232
+ pluginIndicatorEntries: /* @__PURE__ */ new Map()
233
+ };
234
+ registryStateByScope.set(normalizedScope, state);
235
+ }
236
+ return state;
237
+ };
238
+ var registerIndicatorEntries = (entries, source, scope) => {
239
+ const { pluginIndicatorEntries } = getIndicatorRegistryState(scope);
223
240
  for (const entry of entries) {
224
241
  const indicatorId = entry.indicator?.id;
225
242
  if (!indicatorId) {
@@ -237,23 +254,28 @@ var registerIndicatorEntries = (entries, source) => {
237
254
  pluginIndicatorEntries.set(indicatorId, entry);
238
255
  }
239
256
  };
240
- var getRegisteredIndicatorEntries = () => [
241
- ...pluginIndicatorEntries.values()
257
+ var getRegisteredIndicatorEntries = (scope) => [
258
+ ...getIndicatorRegistryState(scope).pluginIndicatorEntries.values()
242
259
  ];
243
- var getPluginIndicatorCatalog = () => getRegisteredIndicatorEntries().map((entry) => ({
260
+ var getPluginIndicatorCatalog = (scope) => getRegisteredIndicatorEntries(scope).map((entry) => ({
244
261
  id: entry.indicator.id,
245
262
  label: entry.indicator.label,
246
263
  enabled: entry.indicator.enabled,
247
264
  periods: entry.indicator.periods
248
265
  }));
249
- var getPluginIndicatorRenderers = () => getRegisteredIndicatorEntries().filter(
266
+ var getPluginIndicatorRenderers = (scope) => getRegisteredIndicatorEntries(scope).filter(
250
267
  (entry) => Boolean(entry.renderer)
251
268
  ).map((entry) => ({
252
269
  indicatorId: entry.indicator.id,
253
270
  renderer: entry.renderer
254
271
  }));
255
- var resetIndicatorRegistryCache = () => {
256
- pluginIndicatorEntries.clear();
272
+ var resetIndicatorRegistryCache = (scope) => {
273
+ const normalizedScope = String(scope ?? "").trim();
274
+ if (!normalizedScope) {
275
+ registryStateByScope.clear();
276
+ return;
277
+ }
278
+ registryStateByScope.delete(normalizeScope(scope));
257
279
  };
258
280
 
259
281
  // src/utils/spread.ts
@@ -462,7 +484,9 @@ var applyIndicatorsToHistory = (indicators, pushIndicator) => {
462
484
  pushIndicator("spread", indicators.spread ?? void 0);
463
485
  };
464
486
  var createIndicators = (data, btcData = [], options = {}) => {
465
- const indicatorPluginEntries = getRegisteredIndicatorEntries();
487
+ const indicatorPluginEntries = getRegisteredIndicatorEntries(
488
+ options.pluginRegistryScope
489
+ );
466
490
  const includeMlPayload = options.includeMlPayload !== false;
467
491
  const indicatorPeriods = {
468
492
  ...DEFAULT_INDICATOR_PERIODS,
@@ -1,31 +1,5 @@
1
- import { Pool } from 'pg';
2
1
  import { Candle, MlCandleIndicatorsSnapshot, IndicatorSnapshot, IndicatorsHistorySnapshot } from '@tradejs/types';
3
2
 
4
- declare global {
5
- var __pgPool__: Pool | undefined;
6
- }
7
- type DerivativesInterval = '15m' | '1h';
8
- type DerivativesRow = {
9
- symbol: string;
10
- interval: DerivativesInterval;
11
- ts: Date;
12
- openInterest?: number | null;
13
- fundingRate?: number | null;
14
- liqLong?: number | null;
15
- liqShort?: number | null;
16
- liqTotal?: number | null;
17
- source?: string | null;
18
- };
19
- type SpreadRow = {
20
- symbol: string;
21
- interval: DerivativesInterval;
22
- ts: Date;
23
- binancePrice?: number | null;
24
- coinbasePrice?: number | null;
25
- spread?: number | null;
26
- source?: string | null;
27
- };
28
-
29
3
  declare const buildMlCandleIndicators: (candles: Candle[], btcCandles: Candle[]) => MlCandleIndicatorsSnapshot;
30
4
  type IndicatorValue = number | null | undefined;
31
5
  type TrendlineIndicatorHistoryPush = (key: string, value: number | null | undefined) => void;
@@ -61,6 +35,7 @@ type CreateIndicatorsOptions = {
61
35
  includeMlPayload?: boolean;
62
36
  btcBinanceData?: Candle[];
63
37
  btcCoinbaseData?: Candle[];
38
+ pluginRegistryScope?: string;
64
39
  };
65
40
  interface IndicatorPeriods {
66
41
  maFast: number;
@@ -87,4 +62,4 @@ declare const createIndicators: (data: Candle[], btcData?: Candle[], options?: C
87
62
  };
88
63
  declare const buildMlTimeframeIndicators: (candles: Candle[], periods?: Partial<IndicatorPeriods>) => Record<string, number[]>;
89
64
 
90
- export { type DerivativesInterval as D, type IndicatorPeriods as I, type SpreadRow as S, type DerivativesRow as a, applyIndicatorsToHistory as b, buildMlCandleIndicators as c, buildMlTimeframeIndicators as d, createIndicators as e };
65
+ export { type IndicatorPeriods as I, applyIndicatorsToHistory as a, buildMlCandleIndicators as b, buildMlTimeframeIndicators as c, createIndicators as d };
@@ -1,31 +1,5 @@
1
- import { Pool } from 'pg';
2
1
  import { Candle, MlCandleIndicatorsSnapshot, IndicatorSnapshot, IndicatorsHistorySnapshot } from '@tradejs/types';
3
2
 
4
- declare global {
5
- var __pgPool__: Pool | undefined;
6
- }
7
- type DerivativesInterval = '15m' | '1h';
8
- type DerivativesRow = {
9
- symbol: string;
10
- interval: DerivativesInterval;
11
- ts: Date;
12
- openInterest?: number | null;
13
- fundingRate?: number | null;
14
- liqLong?: number | null;
15
- liqShort?: number | null;
16
- liqTotal?: number | null;
17
- source?: string | null;
18
- };
19
- type SpreadRow = {
20
- symbol: string;
21
- interval: DerivativesInterval;
22
- ts: Date;
23
- binancePrice?: number | null;
24
- coinbasePrice?: number | null;
25
- spread?: number | null;
26
- source?: string | null;
27
- };
28
-
29
3
  declare const buildMlCandleIndicators: (candles: Candle[], btcCandles: Candle[]) => MlCandleIndicatorsSnapshot;
30
4
  type IndicatorValue = number | null | undefined;
31
5
  type TrendlineIndicatorHistoryPush = (key: string, value: number | null | undefined) => void;
@@ -61,6 +35,7 @@ type CreateIndicatorsOptions = {
61
35
  includeMlPayload?: boolean;
62
36
  btcBinanceData?: Candle[];
63
37
  btcCoinbaseData?: Candle[];
38
+ pluginRegistryScope?: string;
64
39
  };
65
40
  interface IndicatorPeriods {
66
41
  maFast: number;
@@ -87,4 +62,4 @@ declare const createIndicators: (data: Candle[], btcData?: Candle[], options?: C
87
62
  };
88
63
  declare const buildMlTimeframeIndicators: (candles: Candle[], periods?: Partial<IndicatorPeriods>) => Record<string, number[]>;
89
64
 
90
- export { type DerivativesInterval as D, type IndicatorPeriods as I, type SpreadRow as S, type DerivativesRow as a, applyIndicatorsToHistory as b, buildMlCandleIndicators as c, buildMlTimeframeIndicators as d, createIndicators as e };
65
+ export { type IndicatorPeriods as I, applyIndicatorsToHistory as a, buildMlCandleIndicators as b, buildMlTimeframeIndicators as c, createIndicators as d };
@@ -1,8 +1,6 @@
1
- import { KlineChartItem, IndicatorPluginRenderer, Indicator, IndicatorPluginEntry, TrendLine, TrendLineOptions } from '@tradejs/types';
2
- import { D as DerivativesInterval, a as DerivativesRow, S as SpreadRow } from './indicators-x3xKl3_W.mjs';
3
- export { I as IndicatorPeriods, b as applyIndicatorsToHistory, c as buildMlCandleIndicators, d as buildMlTimeframeIndicators, e as createIndicators } from './indicators-x3xKl3_W.mjs';
1
+ import { KlineChartItem, DerivativesInterval, DerivativesRow, IndicatorPluginRenderer, Indicator, IndicatorPluginEntry, SpreadRow, TrendLine, TrendLineOptions } from '@tradejs/types';
2
+ export { I as IndicatorPeriods, a as applyIndicatorsToHistory, b as buildMlCandleIndicators, c as buildMlTimeframeIndicators, d as createIndicators } from './indicators-B-GGjP5F.mjs';
4
3
  import { KLineData } from 'klinecharts';
5
- import 'pg';
6
4
 
7
5
  /**
8
6
  * Выравнивает два отсортированных массива свечей по timestamp.
@@ -52,15 +50,15 @@ declare const mergeCoinalyzeMetrics: (params: {
52
50
  }) => CoinalyzePoint[];
53
51
  declare const coinalyzePointsToRows: (points: CoinalyzePoint[], interval: DerivativesInterval, source: string) => DerivativesRow[];
54
52
 
55
- declare const registerIndicatorEntries: (entries: readonly IndicatorPluginEntry[], source: string) => void;
56
- declare const getRegisteredIndicatorEntries: () => IndicatorPluginEntry[];
57
- declare const getPluginIndicatorCatalog: () => Indicator[];
53
+ declare const registerIndicatorEntries: (entries: readonly IndicatorPluginEntry[], source: string, scope?: string) => void;
54
+ declare const getRegisteredIndicatorEntries: (scope?: string) => IndicatorPluginEntry[];
55
+ declare const getPluginIndicatorCatalog: (scope?: string) => Indicator[];
58
56
  type IndicatorRendererDescriptor = {
59
57
  indicatorId: string;
60
58
  renderer: IndicatorPluginRenderer;
61
59
  };
62
- declare const getPluginIndicatorRenderers: () => IndicatorRendererDescriptor[];
63
- declare const resetIndicatorRegistryCache: () => void;
60
+ declare const getPluginIndicatorRenderers: (scope?: string) => IndicatorRendererDescriptor[];
61
+ declare const resetIndicatorRegistryCache: (scope?: string) => void;
64
62
 
65
63
  type SpreadValue = number | null | undefined;
66
64
  type SpreadPointInput = {
@@ -1,8 +1,6 @@
1
- import { KlineChartItem, IndicatorPluginRenderer, Indicator, IndicatorPluginEntry, TrendLine, TrendLineOptions } from '@tradejs/types';
2
- import { D as DerivativesInterval, a as DerivativesRow, S as SpreadRow } from './indicators-x3xKl3_W.js';
3
- export { I as IndicatorPeriods, b as applyIndicatorsToHistory, c as buildMlCandleIndicators, d as buildMlTimeframeIndicators, e as createIndicators } from './indicators-x3xKl3_W.js';
1
+ import { KlineChartItem, DerivativesInterval, DerivativesRow, IndicatorPluginRenderer, Indicator, IndicatorPluginEntry, SpreadRow, TrendLine, TrendLineOptions } from '@tradejs/types';
2
+ export { I as IndicatorPeriods, a as applyIndicatorsToHistory, b as buildMlCandleIndicators, c as buildMlTimeframeIndicators, d as createIndicators } from './indicators-B-GGjP5F.js';
4
3
  import { KLineData } from 'klinecharts';
5
- import 'pg';
6
4
 
7
5
  /**
8
6
  * Выравнивает два отсортированных массива свечей по timestamp.
@@ -52,15 +50,15 @@ declare const mergeCoinalyzeMetrics: (params: {
52
50
  }) => CoinalyzePoint[];
53
51
  declare const coinalyzePointsToRows: (points: CoinalyzePoint[], interval: DerivativesInterval, source: string) => DerivativesRow[];
54
52
 
55
- declare const registerIndicatorEntries: (entries: readonly IndicatorPluginEntry[], source: string) => void;
56
- declare const getRegisteredIndicatorEntries: () => IndicatorPluginEntry[];
57
- declare const getPluginIndicatorCatalog: () => Indicator[];
53
+ declare const registerIndicatorEntries: (entries: readonly IndicatorPluginEntry[], source: string, scope?: string) => void;
54
+ declare const getRegisteredIndicatorEntries: (scope?: string) => IndicatorPluginEntry[];
55
+ declare const getPluginIndicatorCatalog: (scope?: string) => Indicator[];
58
56
  type IndicatorRendererDescriptor = {
59
57
  indicatorId: string;
60
58
  renderer: IndicatorPluginRenderer;
61
59
  };
62
- declare const getPluginIndicatorRenderers: () => IndicatorRendererDescriptor[];
63
- declare const resetIndicatorRegistryCache: () => void;
60
+ declare const getPluginIndicatorRenderers: (scope?: string) => IndicatorRendererDescriptor[];
61
+ declare const resetIndicatorRegistryCache: (scope?: string) => void;
64
62
 
65
63
  type SpreadValue = number | null | undefined;
66
64
  type SpreadPointInput = {
@@ -299,8 +299,25 @@ var cloneArrayValues = (record) => Object.fromEntries(
299
299
  var warn = (message, ...args) => {
300
300
  console.warn(`[core:indicators] ${message}`, ...args);
301
301
  };
302
- var pluginIndicatorEntries = /* @__PURE__ */ new Map();
303
- var registerIndicatorEntries = (entries, source) => {
302
+ var DEFAULT_INDICATOR_REGISTRY_SCOPE = "__default__";
303
+ var registryStateByScope = /* @__PURE__ */ new Map();
304
+ var normalizeScope = (scope) => {
305
+ const normalized = String(scope ?? "").trim();
306
+ return normalized || DEFAULT_INDICATOR_REGISTRY_SCOPE;
307
+ };
308
+ var getIndicatorRegistryState = (scope) => {
309
+ const normalizedScope = normalizeScope(scope);
310
+ let state = registryStateByScope.get(normalizedScope);
311
+ if (!state) {
312
+ state = {
313
+ pluginIndicatorEntries: /* @__PURE__ */ new Map()
314
+ };
315
+ registryStateByScope.set(normalizedScope, state);
316
+ }
317
+ return state;
318
+ };
319
+ var registerIndicatorEntries = (entries, source, scope) => {
320
+ const { pluginIndicatorEntries } = getIndicatorRegistryState(scope);
304
321
  for (const entry of entries) {
305
322
  const indicatorId = entry.indicator?.id;
306
323
  if (!indicatorId) {
@@ -318,23 +335,28 @@ var registerIndicatorEntries = (entries, source) => {
318
335
  pluginIndicatorEntries.set(indicatorId, entry);
319
336
  }
320
337
  };
321
- var getRegisteredIndicatorEntries = () => [
322
- ...pluginIndicatorEntries.values()
338
+ var getRegisteredIndicatorEntries = (scope) => [
339
+ ...getIndicatorRegistryState(scope).pluginIndicatorEntries.values()
323
340
  ];
324
- var getPluginIndicatorCatalog = () => getRegisteredIndicatorEntries().map((entry) => ({
341
+ var getPluginIndicatorCatalog = (scope) => getRegisteredIndicatorEntries(scope).map((entry) => ({
325
342
  id: entry.indicator.id,
326
343
  label: entry.indicator.label,
327
344
  enabled: entry.indicator.enabled,
328
345
  periods: entry.indicator.periods
329
346
  }));
330
- var getPluginIndicatorRenderers = () => getRegisteredIndicatorEntries().filter(
347
+ var getPluginIndicatorRenderers = (scope) => getRegisteredIndicatorEntries(scope).filter(
331
348
  (entry) => Boolean(entry.renderer)
332
349
  ).map((entry) => ({
333
350
  indicatorId: entry.indicator.id,
334
351
  renderer: entry.renderer
335
352
  }));
336
- var resetIndicatorRegistryCache = () => {
337
- pluginIndicatorEntries.clear();
353
+ var resetIndicatorRegistryCache = (scope) => {
354
+ const normalizedScope = String(scope ?? "").trim();
355
+ if (!normalizedScope) {
356
+ registryStateByScope.clear();
357
+ return;
358
+ }
359
+ registryStateByScope.delete(normalizeScope(scope));
338
360
  };
339
361
 
340
362
  // src/utils/spread.ts
@@ -543,7 +565,9 @@ var applyIndicatorsToHistory = (indicators, pushIndicator) => {
543
565
  pushIndicator("spread", indicators.spread ?? void 0);
544
566
  };
545
567
  var createIndicators = (data, btcData = [], options = {}) => {
546
- const indicatorPluginEntries = getRegisteredIndicatorEntries();
568
+ const indicatorPluginEntries = getRegisteredIndicatorEntries(
569
+ options.pluginRegistryScope
570
+ );
547
571
  const includeMlPayload = options.includeMlPayload !== false;
548
572
  const indicatorPeriods = {
549
573
  ...DEFAULT_INDICATOR_PERIODS,
@@ -28,7 +28,7 @@ import {
28
28
  toArrayData,
29
29
  toCoinalyzeTimestampMs,
30
30
  toFiniteNumber
31
- } from "./chunk-LIGD3WWX.mjs";
31
+ } from "./chunk-4F73AYK6.mjs";
32
32
  import "./chunk-AYC2QVKI.mjs";
33
33
  import "./chunk-PXLXXXLA.mjs";
34
34
  import "./chunk-JG2QPVAV.mjs";
@@ -1,6 +1,5 @@
1
1
  import { KlineChartData, StrategyIndicatorsState, Direction, Connector, Interval, BacktestPriceMode, StrategyMarketSnapshot, BuildStrategySignalDraft, StrategyEntrySignalContext, StrategyEntryOrderPlan, StrategyEntryRuntimeOptions, StrategyDecision, BuildStrategySignalParams, Signal, StrategyAPI, StrategyRuntimeAiOptions, StrategyRuntimeMlOptions } from '@tradejs/types';
2
- import { I as IndicatorPeriods } from './indicators-x3xKl3_W.mjs';
3
- import 'pg';
2
+ import { I as IndicatorPeriods } from './indicators-B-GGjP5F.mjs';
4
3
 
5
4
  type IndicatorPeriodsConfig = Partial<Record<'MA_FAST' | 'MA_MEDIUM' | 'MA_SLOW' | 'OBV_SMA' | 'ATR' | 'ATR_PCT_SHORT' | 'ATR_PCT_LONG' | 'BB' | 'BB_STD' | 'MACD_FAST' | 'MACD_SLOW' | 'MACD_SIGNAL' | 'LEVEL_LOOKBACK' | 'LEVEL_DELAY', number>>;
6
5
  declare const buildDefaultIndicatorPeriods: (config: IndicatorPeriodsConfig) => Partial<IndicatorPeriods>;
@@ -11,8 +10,9 @@ interface StrategyIndicatorsStateParams {
11
10
  btcBinanceData?: KlineChartData;
12
11
  btcCoinbaseData?: KlineChartData;
13
12
  periods?: Partial<IndicatorPeriods>;
13
+ pluginRegistryScope?: string;
14
14
  }
15
- declare const createStrategyIndicatorsState: ({ env, data, btcData, btcBinanceData, btcCoinbaseData, periods, }: StrategyIndicatorsStateParams) => StrategyIndicatorsState;
15
+ declare const createStrategyIndicatorsState: ({ env, data, btcData, btcBinanceData, btcCoinbaseData, periods, pluginRegistryScope, }: StrategyIndicatorsStateParams) => StrategyIndicatorsState;
16
16
 
17
17
  interface StrategyMarketSnapshotParams {
18
18
  env: string;
@@ -1,6 +1,5 @@
1
1
  import { KlineChartData, StrategyIndicatorsState, Direction, Connector, Interval, BacktestPriceMode, StrategyMarketSnapshot, BuildStrategySignalDraft, StrategyEntrySignalContext, StrategyEntryOrderPlan, StrategyEntryRuntimeOptions, StrategyDecision, BuildStrategySignalParams, Signal, StrategyAPI, StrategyRuntimeAiOptions, StrategyRuntimeMlOptions } from '@tradejs/types';
2
- import { I as IndicatorPeriods } from './indicators-x3xKl3_W.js';
3
- import 'pg';
2
+ import { I as IndicatorPeriods } from './indicators-B-GGjP5F.js';
4
3
 
5
4
  type IndicatorPeriodsConfig = Partial<Record<'MA_FAST' | 'MA_MEDIUM' | 'MA_SLOW' | 'OBV_SMA' | 'ATR' | 'ATR_PCT_SHORT' | 'ATR_PCT_LONG' | 'BB' | 'BB_STD' | 'MACD_FAST' | 'MACD_SLOW' | 'MACD_SIGNAL' | 'LEVEL_LOOKBACK' | 'LEVEL_DELAY', number>>;
6
5
  declare const buildDefaultIndicatorPeriods: (config: IndicatorPeriodsConfig) => Partial<IndicatorPeriods>;
@@ -11,8 +10,9 @@ interface StrategyIndicatorsStateParams {
11
10
  btcBinanceData?: KlineChartData;
12
11
  btcCoinbaseData?: KlineChartData;
13
12
  periods?: Partial<IndicatorPeriods>;
13
+ pluginRegistryScope?: string;
14
14
  }
15
- declare const createStrategyIndicatorsState: ({ env, data, btcData, btcBinanceData, btcCoinbaseData, periods, }: StrategyIndicatorsStateParams) => StrategyIndicatorsState;
15
+ declare const createStrategyIndicatorsState: ({ env, data, btcData, btcBinanceData, btcCoinbaseData, periods, pluginRegistryScope, }: StrategyIndicatorsStateParams) => StrategyIndicatorsState;
16
16
 
17
17
  interface StrategyMarketSnapshotParams {
18
18
  env: string;
@@ -163,9 +163,25 @@ var cloneArrayValues = (record) => Object.fromEntries(
163
163
  );
164
164
 
165
165
  // src/utils/indicatorPlugins.ts
166
- var pluginIndicatorEntries = /* @__PURE__ */ new Map();
167
- var getRegisteredIndicatorEntries = () => [
168
- ...pluginIndicatorEntries.values()
166
+ var DEFAULT_INDICATOR_REGISTRY_SCOPE = "__default__";
167
+ var registryStateByScope = /* @__PURE__ */ new Map();
168
+ var normalizeScope = (scope) => {
169
+ const normalized = String(scope ?? "").trim();
170
+ return normalized || DEFAULT_INDICATOR_REGISTRY_SCOPE;
171
+ };
172
+ var getIndicatorRegistryState = (scope) => {
173
+ const normalizedScope = normalizeScope(scope);
174
+ let state = registryStateByScope.get(normalizedScope);
175
+ if (!state) {
176
+ state = {
177
+ pluginIndicatorEntries: /* @__PURE__ */ new Map()
178
+ };
179
+ registryStateByScope.set(normalizedScope, state);
180
+ }
181
+ return state;
182
+ };
183
+ var getRegisteredIndicatorEntries = (scope) => [
184
+ ...getIndicatorRegistryState(scope).pluginIndicatorEntries.values()
169
185
  ];
170
186
 
171
187
  // src/utils/spread.ts
@@ -313,7 +329,9 @@ var applyIndicatorsToHistory = (indicators, pushIndicator) => {
313
329
  pushIndicator("spread", indicators.spread ?? void 0);
314
330
  };
315
331
  var createIndicators = (data, btcData = [], options = {}) => {
316
- const indicatorPluginEntries = getRegisteredIndicatorEntries();
332
+ const indicatorPluginEntries = getRegisteredIndicatorEntries(
333
+ options.pluginRegistryScope
334
+ );
317
335
  const includeMlPayload = options.includeMlPayload !== false;
318
336
  const indicatorPeriods = {
319
337
  ...DEFAULT_INDICATOR_PERIODS,
@@ -718,12 +736,14 @@ var createStrategyIndicatorsState = ({
718
736
  btcData,
719
737
  btcBinanceData,
720
738
  btcCoinbaseData,
721
- periods
739
+ periods,
740
+ pluginRegistryScope
722
741
  }) => {
723
742
  let controller = env === "BACKTEST" ? createIndicators(data, btcData, {
724
743
  periods,
725
744
  btcBinanceData,
726
- btcCoinbaseData
745
+ btcCoinbaseData,
746
+ pluginRegistryScope
727
747
  }) : null;
728
748
  let currentBarPair;
729
749
  const withSnapshot = (value) => Object.assign(value, {
@@ -738,7 +758,8 @@ var createStrategyIndicatorsState = ({
738
758
  controller = createIndicators(data.slice(0, -1), btcData.slice(0, -1), {
739
759
  periods,
740
760
  btcBinanceData,
741
- btcCoinbaseData
761
+ btcCoinbaseData,
762
+ pluginRegistryScope
742
763
  });
743
764
  const lastCandle = data[data.length - 1];
744
765
  const lastBtcCandle = btcData[btcData.length - 1];
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-NQ7D3T4E.mjs";
4
4
  import {
5
5
  createIndicators
6
- } from "./chunk-LIGD3WWX.mjs";
6
+ } from "./chunk-4F73AYK6.mjs";
7
7
  import "./chunk-AYC2QVKI.mjs";
8
8
  import {
9
9
  getTimestamp
@@ -36,12 +36,14 @@ var createStrategyIndicatorsState = ({
36
36
  btcData,
37
37
  btcBinanceData,
38
38
  btcCoinbaseData,
39
- periods
39
+ periods,
40
+ pluginRegistryScope
40
41
  }) => {
41
42
  let controller = env === "BACKTEST" ? createIndicators(data, btcData, {
42
43
  periods,
43
44
  btcBinanceData,
44
- btcCoinbaseData
45
+ btcCoinbaseData,
46
+ pluginRegistryScope
45
47
  }) : null;
46
48
  let currentBarPair;
47
49
  const withSnapshot = (value) => Object.assign(value, {
@@ -56,7 +58,8 @@ var createStrategyIndicatorsState = ({
56
58
  controller = createIndicators(data.slice(0, -1), btcData.slice(0, -1), {
57
59
  periods,
58
60
  btcBinanceData,
59
- btcCoinbaseData
61
+ btcCoinbaseData,
62
+ pluginRegistryScope
60
63
  });
61
64
  const lastCandle = data[data.length - 1];
62
65
  const lastBtcCandle = btcData[btcData.length - 1];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tradejs/core",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Browser-safe TradeJS public API for config, strategy authoring, indicators, figures, and shared helpers.",
5
5
  "keywords": [
6
6
  "tradejs",
@@ -78,7 +78,7 @@
78
78
  }
79
79
  },
80
80
  "dependencies": {
81
- "@tradejs/types": "^1.0.2",
81
+ "@tradejs/types": "^1.0.4",
82
82
  "date-fns": "^3.3.1",
83
83
  "klinecharts": "10.0.0-alpha9",
84
84
  "lodash": "^4.17.21",