@tradejs/node 2.0.20 → 3.0.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/dist/backtest.mjs CHANGED
@@ -3,11 +3,13 @@ import {
3
3
  getConnectorCreatorByName
4
4
  } from "./chunk-V3YMKE4I.mjs";
5
5
  import {
6
- buildAiPayload,
7
6
  buildMlPayload,
8
- enrichSignalWithMarketContextStages,
7
+ enrichSignalWithMarketContextStages
8
+ } from "./chunk-OGAWBO3Z.mjs";
9
+ import {
10
+ buildAiPayload,
9
11
  getStrategyCreator
10
- } from "./chunk-4AVFJMQL.mjs";
12
+ } from "./chunk-VRXU4E4O.mjs";
11
13
  import {
12
14
  getTradejsProjectCwd
13
15
  } from "./chunk-WS5DYEVZ.mjs";
@@ -340,6 +342,7 @@ var createTestConnector = (connector, context) => {
340
342
  };
341
343
  const createOpenTradeResult = ({
342
344
  signalId,
345
+ positionCycleId,
343
346
  direction,
344
347
  qty,
345
348
  timestamp,
@@ -350,6 +353,7 @@ var createTestConnector = (connector, context) => {
350
353
  entrySlippageCost
351
354
  }) => ({
352
355
  signalId,
356
+ positionCycleId,
353
357
  direction,
354
358
  qty,
355
359
  closedQty: 0,
@@ -1056,6 +1060,7 @@ var createTestConnector = (connector, context) => {
1056
1060
  currentEntryLegResults.push(
1057
1061
  createOpenTradeResult({
1058
1062
  signalId: increaseSignalId,
1063
+ positionCycleId: currentSignalId ?? increaseSignalId,
1059
1064
  direction: order.direction,
1060
1065
  qty: orderQty,
1061
1066
  timestamp: order.timestamp,
@@ -1161,6 +1166,7 @@ var createTestConnector = (connector, context) => {
1161
1166
  currentPositionProfit = profit;
1162
1167
  const openTradeResult = createOpenTradeResult({
1163
1168
  signalId: currentSignalId ?? "",
1169
+ positionCycleId: currentSignalId ?? "",
1164
1170
  direction: order.direction,
1165
1171
  qty: orderQty,
1166
1172
  timestamp: order.timestamp,