@tradejs/node 1.0.5 → 1.0.6

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/dist/pine.mjs CHANGED
@@ -1,19 +1,27 @@
1
1
  import {
2
- asFiniteNumber,
3
- asPineBoolean,
4
- createLoadPineScript,
5
- getLatestPinePlotValue,
2
+ createPineScriptLoader,
3
+ getLatestPineBooleanPlotValue,
4
+ getLatestPineBooleanPlotValues,
5
+ getLatestPineNumberPlotValue,
6
+ getLatestPineNumberPlotValues,
7
+ getLatestPineRawPlotValue,
6
8
  getPinePlotSeries,
7
- loadPineScript,
8
- runPineScript
9
- } from "./chunk-7ICOZAKA.mjs";
9
+ loadPineScriptFile,
10
+ runPineScript,
11
+ toFiniteNumber,
12
+ toPineBoolean
13
+ } from "./chunk-H6LIYHU4.mjs";
10
14
  import "./chunk-6DZX6EAA.mjs";
11
15
  export {
12
- asFiniteNumber,
13
- asPineBoolean,
14
- createLoadPineScript,
15
- getLatestPinePlotValue,
16
+ createPineScriptLoader,
17
+ getLatestPineBooleanPlotValue,
18
+ getLatestPineBooleanPlotValues,
19
+ getLatestPineNumberPlotValue,
20
+ getLatestPineNumberPlotValues,
21
+ getLatestPineRawPlotValue,
16
22
  getPinePlotSeries,
17
- loadPineScript,
18
- runPineScript
23
+ loadPineScriptFile,
24
+ runPineScript,
25
+ toFiniteNumber,
26
+ toPineBoolean
19
27
  };
package/dist/registry.js CHANGED
@@ -259,7 +259,7 @@ var loadTradejsConfig = async (cwd = getTradejsProjectCwd()) => {
259
259
  cachedByCwd.set(cwd, config);
260
260
  if (!announcedConfigFile.has(configFilePath)) {
261
261
  announcedConfigFile.add(configFilePath);
262
- import_logger.logger.log("info", "Loaded TradeJS config: %s", configFilePath);
262
+ import_logger.logger.log("debug", "Loaded TradeJS config: %s", configFilePath);
263
263
  }
264
264
  return config;
265
265
  } catch (error) {
package/dist/registry.mjs CHANGED
@@ -11,8 +11,8 @@ import {
11
11
  registerStrategyEntries,
12
12
  resetStrategyRegistryCache,
13
13
  strategies
14
- } from "./chunk-ZY6ULOWK.mjs";
15
- import "./chunk-P2ZUWONT.mjs";
14
+ } from "./chunk-EOZSJKUM.mjs";
15
+ import "./chunk-CGJ2UU6H.mjs";
16
16
  import "./chunk-6DZX6EAA.mjs";
17
17
  export {
18
18
  ensureIndicatorPluginsLoaded,
@@ -1,5 +1,6 @@
1
- import { Connector, StrategyEntrySignalContext, Signal, SignalAnalysis, AiPayload, StrategyConfig, CreateStrategyCore, StrategyManifest, StrategyCreator, Direction, StrategyRuntimeMlOptions, StrategyRuntimeAiOptions, Tp } from '@tradejs/types';
1
+ import { Connector, StrategyEntrySignalContext, StrategyConfig, CreateStrategyCore, StrategyManifest, StrategyCreator, Signal, Direction, StrategyRuntimeMlOptions, StrategyRuntimeAiOptions, Tp } from '@tradejs/types';
2
2
  export * from '@tradejs/core/strategies';
3
+ export { DEFAULT_AI_MODEL, MAX_AI_SERIES_POINTS, askAI, buildAiHumanPrompt, buildAiPayload, buildAiPrompts, buildAiSystemPrompt, ensureAiStrategyPluginsLoaded, getDeterministicAiGateContext, getOpenRouterModelKwargs, resetAiRuntimeCache, runAiPrompt, runAiPromptLocal, trimSeriesDeep } from './ai.mjs';
3
4
  export { ensureIndicatorPluginsLoaded, ensureStrategyPluginsLoaded, getAvailableStrategyNames, getRegisteredManifests, getRegisteredStrategies, getStrategyCreator, getStrategyManifest, isKnownStrategy, registerStrategyEntries, resetStrategyRegistryCache, strategies } from './registry.mjs';
4
5
 
5
6
  type CloseOppositePositionsBeforeOpenOptions = {
@@ -8,14 +9,6 @@ type CloseOppositePositionsBeforeOpenOptions = {
8
9
  };
9
10
  declare const closeOppositePositionsBeforeOpen: ({ connector, entryContext, }: CloseOppositePositionsBeforeOpenOptions) => Promise<void>;
10
11
 
11
- declare const MAX_AI_SERIES_POINTS = 5;
12
- declare const trimSeriesDeep: (value: any) => any;
13
-
14
- declare const buildAiSystemPrompt: (signal?: Signal) => string;
15
- declare const buildAiPayload: (signal: Signal) => AiPayload;
16
- declare const buildAiHumanPrompt: (signal: Signal, payload?: AiPayload) => string;
17
- declare const askAI: (signal: Signal) => Promise<Partial<SignalAnalysis>>;
18
-
19
12
  interface CreateStrategyRuntimeParams<TConfig extends StrategyConfig> {
20
13
  strategyName: string;
21
14
  defaults: TConfig;
@@ -39,6 +32,7 @@ declare const resolveStrategyConfig: <TConfig extends StrategyConfig>({ strategy
39
32
 
40
33
  interface EnrichSignalWithMlAiParams {
41
34
  signal: Signal;
35
+ userName?: string;
42
36
  symbol: string;
43
37
  direction: Direction;
44
38
  env: string;
@@ -46,8 +40,8 @@ interface EnrichSignalWithMlAiParams {
46
40
  ai?: StrategyRuntimeAiOptions;
47
41
  }
48
42
  declare const enrichSignalWithMl: ({ signal, env, ml, }: Pick<EnrichSignalWithMlAiParams, "signal" | "env" | "ml">) => Promise<void>;
49
- declare const enrichSignalWithAi: ({ signal, symbol, direction, env, ai, }: Pick<EnrichSignalWithMlAiParams, "signal" | "symbol" | "direction" | "env" | "ai">) => Promise<number | undefined>;
50
- declare const enrichSignalWithMlAi: ({ signal, symbol, direction, env, ml, ai, }: EnrichSignalWithMlAiParams) => Promise<number | undefined>;
43
+ declare const enrichSignalWithAi: ({ signal, symbol, userName, direction, env, ai, }: Pick<EnrichSignalWithMlAiParams, "signal" | "userName" | "symbol" | "direction" | "env" | "ai">) => Promise<number | undefined>;
44
+ declare const enrichSignalWithMlAi: ({ signal, userName, symbol, direction, env, ml, ai, }: EnrichSignalWithMlAiParams) => Promise<number | undefined>;
51
45
  interface ExecuteEntryOrderParams {
52
46
  connector: Connector;
53
47
  symbol: string;
@@ -68,4 +62,4 @@ interface CreateCloseOppositeBeforePlaceOrderHookParams {
68
62
  }
69
63
  declare const createCloseOppositeBeforePlaceOrderHook: ({ isEnabled, }: CreateCloseOppositeBeforePlaceOrderHookParams) => BeforePlaceOrderHook;
70
64
 
71
- export { MAX_AI_SERIES_POINTS, askAI, buildAiHumanPrompt, buildAiPayload, buildAiSystemPrompt, closeOppositePositionsBeforeOpen, createCloseOppositeBeforePlaceOrderHook, createStrategyRuntime, enrichSignalWithAi, enrichSignalWithMl, enrichSignalWithMlAi, executeEntryOrder, resolveStrategyConfig, trimSeriesDeep };
65
+ export { closeOppositePositionsBeforeOpen, createCloseOppositeBeforePlaceOrderHook, createStrategyRuntime, enrichSignalWithAi, enrichSignalWithMl, enrichSignalWithMlAi, executeEntryOrder, resolveStrategyConfig };
@@ -1,5 +1,6 @@
1
- import { Connector, StrategyEntrySignalContext, Signal, SignalAnalysis, AiPayload, StrategyConfig, CreateStrategyCore, StrategyManifest, StrategyCreator, Direction, StrategyRuntimeMlOptions, StrategyRuntimeAiOptions, Tp } from '@tradejs/types';
1
+ import { Connector, StrategyEntrySignalContext, StrategyConfig, CreateStrategyCore, StrategyManifest, StrategyCreator, Signal, Direction, StrategyRuntimeMlOptions, StrategyRuntimeAiOptions, Tp } from '@tradejs/types';
2
2
  export * from '@tradejs/core/strategies';
3
+ export { DEFAULT_AI_MODEL, MAX_AI_SERIES_POINTS, askAI, buildAiHumanPrompt, buildAiPayload, buildAiPrompts, buildAiSystemPrompt, ensureAiStrategyPluginsLoaded, getDeterministicAiGateContext, getOpenRouterModelKwargs, resetAiRuntimeCache, runAiPrompt, runAiPromptLocal, trimSeriesDeep } from './ai.js';
3
4
  export { ensureIndicatorPluginsLoaded, ensureStrategyPluginsLoaded, getAvailableStrategyNames, getRegisteredManifests, getRegisteredStrategies, getStrategyCreator, getStrategyManifest, isKnownStrategy, registerStrategyEntries, resetStrategyRegistryCache, strategies } from './registry.js';
4
5
 
5
6
  type CloseOppositePositionsBeforeOpenOptions = {
@@ -8,14 +9,6 @@ type CloseOppositePositionsBeforeOpenOptions = {
8
9
  };
9
10
  declare const closeOppositePositionsBeforeOpen: ({ connector, entryContext, }: CloseOppositePositionsBeforeOpenOptions) => Promise<void>;
10
11
 
11
- declare const MAX_AI_SERIES_POINTS = 5;
12
- declare const trimSeriesDeep: (value: any) => any;
13
-
14
- declare const buildAiSystemPrompt: (signal?: Signal) => string;
15
- declare const buildAiPayload: (signal: Signal) => AiPayload;
16
- declare const buildAiHumanPrompt: (signal: Signal, payload?: AiPayload) => string;
17
- declare const askAI: (signal: Signal) => Promise<Partial<SignalAnalysis>>;
18
-
19
12
  interface CreateStrategyRuntimeParams<TConfig extends StrategyConfig> {
20
13
  strategyName: string;
21
14
  defaults: TConfig;
@@ -39,6 +32,7 @@ declare const resolveStrategyConfig: <TConfig extends StrategyConfig>({ strategy
39
32
 
40
33
  interface EnrichSignalWithMlAiParams {
41
34
  signal: Signal;
35
+ userName?: string;
42
36
  symbol: string;
43
37
  direction: Direction;
44
38
  env: string;
@@ -46,8 +40,8 @@ interface EnrichSignalWithMlAiParams {
46
40
  ai?: StrategyRuntimeAiOptions;
47
41
  }
48
42
  declare const enrichSignalWithMl: ({ signal, env, ml, }: Pick<EnrichSignalWithMlAiParams, "signal" | "env" | "ml">) => Promise<void>;
49
- declare const enrichSignalWithAi: ({ signal, symbol, direction, env, ai, }: Pick<EnrichSignalWithMlAiParams, "signal" | "symbol" | "direction" | "env" | "ai">) => Promise<number | undefined>;
50
- declare const enrichSignalWithMlAi: ({ signal, symbol, direction, env, ml, ai, }: EnrichSignalWithMlAiParams) => Promise<number | undefined>;
43
+ declare const enrichSignalWithAi: ({ signal, symbol, userName, direction, env, ai, }: Pick<EnrichSignalWithMlAiParams, "signal" | "userName" | "symbol" | "direction" | "env" | "ai">) => Promise<number | undefined>;
44
+ declare const enrichSignalWithMlAi: ({ signal, userName, symbol, direction, env, ml, ai, }: EnrichSignalWithMlAiParams) => Promise<number | undefined>;
51
45
  interface ExecuteEntryOrderParams {
52
46
  connector: Connector;
53
47
  symbol: string;
@@ -68,4 +62,4 @@ interface CreateCloseOppositeBeforePlaceOrderHookParams {
68
62
  }
69
63
  declare const createCloseOppositeBeforePlaceOrderHook: ({ isEnabled, }: CreateCloseOppositeBeforePlaceOrderHookParams) => BeforePlaceOrderHook;
70
64
 
71
- export { MAX_AI_SERIES_POINTS, askAI, buildAiHumanPrompt, buildAiPayload, buildAiSystemPrompt, closeOppositePositionsBeforeOpen, createCloseOppositeBeforePlaceOrderHook, createStrategyRuntime, enrichSignalWithAi, enrichSignalWithMl, enrichSignalWithMlAi, executeEntryOrder, resolveStrategyConfig, trimSeriesDeep };
65
+ export { closeOppositePositionsBeforeOpen, createCloseOppositeBeforePlaceOrderHook, createStrategyRuntime, enrichSignalWithAi, enrichSignalWithMl, enrichSignalWithMlAi, executeEntryOrder, resolveStrategyConfig };