@tradejs/cli 3.1.29-beta.290 → 3.1.29-beta.292
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/cli.js +12283 -10394
- package/dist/lib/aiPocketSearch.js +37 -3
- package/dist/lib/aiTrainDataset.js +1 -0
- package/dist/lib/aiTrainEvaluationDump.js +7 -2
- package/dist/lib/aiTrainResearch.js +11 -7
- package/dist/lib/coreResearch.js +273 -119
- package/dist/lib/researchMetricSnapshot.js +74 -0
- package/dist/lib/researchVisuals.js +931 -0
- package/dist/lib/strategyRelease.js +8 -2
- package/dist/lib/strategyResearch.js +334 -199
- package/dist/lib/tickerProfiles.js +76 -0
- package/dist/scripts/aiPocketSearch.js +2959 -2610
- package/dist/scripts/aiTrain.js +29 -17
- package/dist/scripts/coreResearch.js +275 -119
- package/dist/scripts/replay.js +533 -115
- package/dist/scripts/replayRunner.js +533 -115
- package/dist/scripts/researchVisuals.js +976 -0
- package/dist/scripts/strategyRelease.js +59 -7
- package/dist/scripts/strategyResearch.js +339 -203
- package/dist/scripts/tickerProfiles.js +114 -0
- package/package.json +8 -7
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/lib/tickerProfiles.ts
|
|
21
|
+
var tickerProfiles_exports = {};
|
|
22
|
+
__export(tickerProfiles_exports, {
|
|
23
|
+
prepareTickerProfiles: () => prepareTickerProfiles
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(tickerProfiles_exports);
|
|
26
|
+
var import_tickerProfiles = require("@tradejs/core/tickerProfiles");
|
|
27
|
+
var import_candles = require("@tradejs/infra/timescale/candles");
|
|
28
|
+
var import_tickerProfiles2 = require("@tradejs/infra/tickerProfiles");
|
|
29
|
+
var prepareTickerProfiles = async ({
|
|
30
|
+
projectRoot,
|
|
31
|
+
provider,
|
|
32
|
+
universeId,
|
|
33
|
+
symbols,
|
|
34
|
+
start,
|
|
35
|
+
end
|
|
36
|
+
}) => {
|
|
37
|
+
if (!Number.isSafeInteger(end) || end <= start)
|
|
38
|
+
throw new Error("Invalid profile time window");
|
|
39
|
+
if (!symbols.length || new Set(symbols).size !== symbols.length || symbols.some((s) => !/^[A-Z0-9]+USDT$/.test(s)))
|
|
40
|
+
throw new Error("Supply a unique explicit USDT universe");
|
|
41
|
+
if (!symbols.includes("BTCUSDT") || !symbols.includes("ETHUSDT"))
|
|
42
|
+
throw new Error("The universe must include BTCUSDT and ETHUSDT references");
|
|
43
|
+
const receipts = [];
|
|
44
|
+
for (let asOf = (0, import_tickerProfiles.tickerProfileMonth)(start); asOf < end; asOf = (0, import_tickerProfiles.tickerProfileNextMonth)(asOf)) {
|
|
45
|
+
const candlesBySymbol = {};
|
|
46
|
+
for (const symbol of [...symbols].sort())
|
|
47
|
+
candlesBySymbol[symbol] = await (0, import_candles.getKlineCandlesRange)(
|
|
48
|
+
provider,
|
|
49
|
+
symbol,
|
|
50
|
+
60,
|
|
51
|
+
asOf - 721 * 36e5,
|
|
52
|
+
asOf - 36e5
|
|
53
|
+
);
|
|
54
|
+
const snapshot = (0, import_tickerProfiles.buildTickerProfileSnapshot)({
|
|
55
|
+
asOf,
|
|
56
|
+
provider,
|
|
57
|
+
universeId,
|
|
58
|
+
membership: "frozen-list",
|
|
59
|
+
candlesBySymbol
|
|
60
|
+
});
|
|
61
|
+
const snapshotId = await (0, import_tickerProfiles2.writeTickerProfiles)(projectRoot, snapshot);
|
|
62
|
+
receipts.push({
|
|
63
|
+
asOf,
|
|
64
|
+
snapshotId,
|
|
65
|
+
symbols: snapshot.profiles.length,
|
|
66
|
+
unknown: snapshot.profiles.filter(
|
|
67
|
+
(p) => p.moneyGroup === "unknown" || p.volatilityGroup === "unknown"
|
|
68
|
+
).length
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
return receipts;
|
|
72
|
+
};
|
|
73
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
74
|
+
0 && (module.exports = {
|
|
75
|
+
prepareTickerProfiles
|
|
76
|
+
});
|