@tradejs/node 2.0.21 → 3.0.1
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/ai.d.mts +1 -2
- package/dist/ai.d.ts +1 -2
- package/dist/ai.js +163 -5157
- package/dist/ai.mjs +1 -3
- package/dist/backtest.js +1085 -1051
- package/dist/backtest.mjs +9 -3
- package/dist/{chunk-4AVFJMQL.mjs → chunk-OGAWBO3Z.mjs} +1722 -3147
- package/dist/chunk-VRXU4E4O.mjs +1469 -0
- package/dist/cli.js +228 -4847
- package/dist/cli.mjs +5 -2
- package/dist/registry.js +1007 -977
- package/dist/registry.mjs +2 -2
- package/dist/strategies.d.mts +1 -1
- package/dist/strategies.d.ts +1 -1
- package/dist/strategies.js +5139 -5111
- package/dist/strategies.mjs +22 -23
- package/package.json +5 -5
- package/dist/chunk-5YNMSWL3.mjs +0 -0
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-
|
|
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,
|