@tradejs/node 3.1.29-beta.288 → 3.1.29-beta.289

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.
@@ -9,7 +9,7 @@ import {
9
9
  resolveRuntimeComposition,
10
10
  verifyRuntimeDeclaration
11
11
  } from "./chunk-BO42QWAB.mjs";
12
- import "./chunk-F7CLF3PT.mjs";
12
+ import "./chunk-KYGJBMKE.mjs";
13
13
  import "./chunk-UL5Z46JL.mjs";
14
14
  import "./chunk-LZDXRXIU.mjs";
15
15
  import "./chunk-YR55Q355.mjs";
@@ -1,7 +1,7 @@
1
1
  export * from '@tradejs/core/strategies';
2
2
  export { AiChatMessage, DEFAULT_AI_MODEL, InvokeAiChatOptions, MAX_AI_SERIES_POINTS, askAI, buildAiHumanPrompt, buildAiPayload, buildAiPrompts, buildAiSystemPrompt, buildCompactAiIndicatorsSnapshot, getDeterministicAiGateContext, getOpenRouterModelKwargs, invokeAiChat, resetAiRuntimeCache, runAiPrompt, runAiPromptLocal, trimSeriesDeep } from './ai.mjs';
3
3
  export { e as ensureIndicatorPluginsLoaded, a as ensureStrategyPluginsLoaded, g as getAvailableStrategyNames, b as getRegisteredManifests, c as getRegisteredStrategies, d as getStrategyCreator, f as getStrategyDefaults, h as getStrategyManifest, i as getStrategyPluginSource, j as isKnownStrategy, r as registerStrategyEntries, k as resetStrategyRegistryCache, s as strategies } from './registry-3TsO1Ff1.mjs';
4
- import { StrategyConfig, CreateStrategyCore, StrategyManifest, StrategyCreator, RuntimeStrategyConfigSnapshot, Signal, Direction, StrategyRuntimeMlOptions, StrategyRuntimeAiOptions, Connector, Tp, MarketFeatureInterval, StrategyEntrySignalContext } from '@tradejs/types';
4
+ import { StrategyConfig, CreateStrategyCore, StrategyManifest, StrategyCreator, RuntimeStrategyConfigSnapshot, Connector, Direction, Tp, Signal, StrategyRuntimeMlOptions, StrategyRuntimeAiOptions, MarketFeatureInterval, StrategyEntrySignalContext } from '@tradejs/types';
5
5
  import { TradejsConfigOnBarHook, TradejsConfigBeforeSignalsHook } from '@tradejs/core/config';
6
6
 
7
7
  interface CreateStrategyRuntimeParams<TConfig extends StrategyConfig> {
@@ -29,6 +29,35 @@ declare const resolveStrategyConfig: <TConfig extends StrategyConfig>({ strategy
29
29
  isConfigFromBacktest: boolean;
30
30
  }>;
31
31
 
32
+ interface EntryExecutionLimits {
33
+ minimumNetRiskRatio?: number;
34
+ maxLossValue?: number;
35
+ feeRate: number;
36
+ slippageBps: number;
37
+ }
38
+
39
+ declare const getOrderArrivalSnapshot: ({ connector, symbol, requireTimestamp, }: {
40
+ connector: Connector;
41
+ symbol: string;
42
+ requireTimestamp?: boolean;
43
+ }) => Promise<{
44
+ arrivalSnapshotTime: number;
45
+ arrivalSource: string;
46
+ bid: number | null;
47
+ ask: number | null;
48
+ arrivalMid: number | null;
49
+ spreadBps: number | null;
50
+ }>;
51
+ declare const validateEntryProtectionAtArrival: ({ direction, signalPrice, bid, ask, arrivalMid, takeProfits, stopLossPrice, }: {
52
+ direction: Direction;
53
+ signalPrice: number;
54
+ bid: number | null;
55
+ ask: number | null;
56
+ arrivalMid: number | null;
57
+ takeProfits: Tp[];
58
+ stopLossPrice: number | null;
59
+ }) => void;
60
+
32
61
  interface EnrichSignalWithMlAiParams {
33
62
  signal: Signal;
34
63
  userName?: string;
@@ -56,28 +85,9 @@ interface ExecuteEntryOrderParams {
56
85
  signal: Signal;
57
86
  beforePlaceOrder?: () => Promise<void>;
58
87
  recordRuntimeTrade?: boolean;
88
+ executionLimits?: EntryExecutionLimits;
59
89
  }
60
- declare const getOrderArrivalSnapshot: ({ connector, symbol, }: {
61
- connector: Connector;
62
- symbol: string;
63
- }) => Promise<{
64
- arrivalSnapshotTime: number;
65
- arrivalSource: string;
66
- bid: number | null;
67
- ask: number | null;
68
- arrivalMid: number | null;
69
- spreadBps: number | null;
70
- }>;
71
- declare const validateEntryProtectionAtArrival: ({ direction, signalPrice, bid, ask, arrivalMid, takeProfits, stopLossPrice, }: {
72
- direction: Direction;
73
- signalPrice: number;
74
- bid: number | null;
75
- ask: number | null;
76
- arrivalMid: number | null;
77
- takeProfits: Tp[];
78
- stopLossPrice: number | null;
79
- }) => void;
80
- declare const executeEntryOrder: ({ connector, userName, symbol, direction, qty, currentPrice, timestamp, takeProfits, stopLossPrice, positionIntent, signal, beforePlaceOrder, recordRuntimeTrade, leverage, }: ExecuteEntryOrderParams) => Promise<number>;
90
+ declare const executeEntryOrder: ({ connector, userName, symbol, direction, qty, currentPrice, timestamp, takeProfits, stopLossPrice, positionIntent, signal, beforePlaceOrder, recordRuntimeTrade, leverage, executionLimits, }: ExecuteEntryOrderParams) => Promise<number>;
81
91
 
82
92
  declare const preloadBinanceMarketContextForWindow: (params: {
83
93
  startMs: number;
@@ -1,7 +1,7 @@
1
1
  export * from '@tradejs/core/strategies';
2
2
  export { AiChatMessage, DEFAULT_AI_MODEL, InvokeAiChatOptions, MAX_AI_SERIES_POINTS, askAI, buildAiHumanPrompt, buildAiPayload, buildAiPrompts, buildAiSystemPrompt, buildCompactAiIndicatorsSnapshot, getDeterministicAiGateContext, getOpenRouterModelKwargs, invokeAiChat, resetAiRuntimeCache, runAiPrompt, runAiPromptLocal, trimSeriesDeep } from './ai.js';
3
3
  export { e as ensureIndicatorPluginsLoaded, a as ensureStrategyPluginsLoaded, g as getAvailableStrategyNames, b as getRegisteredManifests, c as getRegisteredStrategies, d as getStrategyCreator, f as getStrategyDefaults, h as getStrategyManifest, i as getStrategyPluginSource, j as isKnownStrategy, r as registerStrategyEntries, k as resetStrategyRegistryCache, s as strategies } from './registry-3TsO1Ff1.js';
4
- import { StrategyConfig, CreateStrategyCore, StrategyManifest, StrategyCreator, RuntimeStrategyConfigSnapshot, Signal, Direction, StrategyRuntimeMlOptions, StrategyRuntimeAiOptions, Connector, Tp, MarketFeatureInterval, StrategyEntrySignalContext } from '@tradejs/types';
4
+ import { StrategyConfig, CreateStrategyCore, StrategyManifest, StrategyCreator, RuntimeStrategyConfigSnapshot, Connector, Direction, Tp, Signal, StrategyRuntimeMlOptions, StrategyRuntimeAiOptions, MarketFeatureInterval, StrategyEntrySignalContext } from '@tradejs/types';
5
5
  import { TradejsConfigOnBarHook, TradejsConfigBeforeSignalsHook } from '@tradejs/core/config';
6
6
 
7
7
  interface CreateStrategyRuntimeParams<TConfig extends StrategyConfig> {
@@ -29,6 +29,35 @@ declare const resolveStrategyConfig: <TConfig extends StrategyConfig>({ strategy
29
29
  isConfigFromBacktest: boolean;
30
30
  }>;
31
31
 
32
+ interface EntryExecutionLimits {
33
+ minimumNetRiskRatio?: number;
34
+ maxLossValue?: number;
35
+ feeRate: number;
36
+ slippageBps: number;
37
+ }
38
+
39
+ declare const getOrderArrivalSnapshot: ({ connector, symbol, requireTimestamp, }: {
40
+ connector: Connector;
41
+ symbol: string;
42
+ requireTimestamp?: boolean;
43
+ }) => Promise<{
44
+ arrivalSnapshotTime: number;
45
+ arrivalSource: string;
46
+ bid: number | null;
47
+ ask: number | null;
48
+ arrivalMid: number | null;
49
+ spreadBps: number | null;
50
+ }>;
51
+ declare const validateEntryProtectionAtArrival: ({ direction, signalPrice, bid, ask, arrivalMid, takeProfits, stopLossPrice, }: {
52
+ direction: Direction;
53
+ signalPrice: number;
54
+ bid: number | null;
55
+ ask: number | null;
56
+ arrivalMid: number | null;
57
+ takeProfits: Tp[];
58
+ stopLossPrice: number | null;
59
+ }) => void;
60
+
32
61
  interface EnrichSignalWithMlAiParams {
33
62
  signal: Signal;
34
63
  userName?: string;
@@ -56,28 +85,9 @@ interface ExecuteEntryOrderParams {
56
85
  signal: Signal;
57
86
  beforePlaceOrder?: () => Promise<void>;
58
87
  recordRuntimeTrade?: boolean;
88
+ executionLimits?: EntryExecutionLimits;
59
89
  }
60
- declare const getOrderArrivalSnapshot: ({ connector, symbol, }: {
61
- connector: Connector;
62
- symbol: string;
63
- }) => Promise<{
64
- arrivalSnapshotTime: number;
65
- arrivalSource: string;
66
- bid: number | null;
67
- ask: number | null;
68
- arrivalMid: number | null;
69
- spreadBps: number | null;
70
- }>;
71
- declare const validateEntryProtectionAtArrival: ({ direction, signalPrice, bid, ask, arrivalMid, takeProfits, stopLossPrice, }: {
72
- direction: Direction;
73
- signalPrice: number;
74
- bid: number | null;
75
- ask: number | null;
76
- arrivalMid: number | null;
77
- takeProfits: Tp[];
78
- stopLossPrice: number | null;
79
- }) => void;
80
- declare const executeEntryOrder: ({ connector, userName, symbol, direction, qty, currentPrice, timestamp, takeProfits, stopLossPrice, positionIntent, signal, beforePlaceOrder, recordRuntimeTrade, leverage, }: ExecuteEntryOrderParams) => Promise<number>;
90
+ declare const executeEntryOrder: ({ connector, userName, symbol, direction, qty, currentPrice, timestamp, takeProfits, stopLossPrice, positionIntent, signal, beforePlaceOrder, recordRuntimeTrade, leverage, executionLimits, }: ExecuteEntryOrderParams) => Promise<number>;
81
91
 
82
92
  declare const preloadBinanceMarketContextForWindow: (params: {
83
93
  startMs: number;