@tradejs/node 2.0.13 → 2.0.14
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.js +1 -1
- package/dist/ai.mjs +1 -1
- package/dist/backtest.js +580 -14
- package/dist/backtest.mjs +18 -3
- package/dist/{chunk-PD25CABK.mjs → chunk-DPHKRDD5.mjs} +1 -1
- package/dist/{chunk-76TEMQKX.mjs → chunk-FEQR4XGR.mjs} +576 -9
- package/dist/cli.js +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/strategies.d.mts +50 -1
- package/dist/strategies.d.ts +50 -1
- package/dist/strategies.js +633 -37
- package/dist/strategies.mjs +45 -4
- package/package.json +4 -4
package/dist/strategies.mjs
CHANGED
|
@@ -5,10 +5,19 @@ import {
|
|
|
5
5
|
enrichSignalWithBinanceMarketContext,
|
|
6
6
|
enrichSignalWithCoinMarketCapContext,
|
|
7
7
|
enrichSignalWithDerivativesContext,
|
|
8
|
+
enrichSignalWithHyperliquidWhaleContext,
|
|
8
9
|
getBinanceBreadthUniverseSnapshot,
|
|
9
10
|
getBinanceBreadthUniverses,
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
getHyperliquidPerpSymbols,
|
|
12
|
+
getHyperliquidPerpUniverseSnapshot,
|
|
13
|
+
getHyperliquidWhaleAddresses,
|
|
14
|
+
getHyperliquidWhaleRegistrySnapshot,
|
|
15
|
+
getPrimaryBinanceBreadthUniverse,
|
|
16
|
+
isTrackedHyperliquidPerp,
|
|
17
|
+
isTrackedHyperliquidWhale,
|
|
18
|
+
loadHyperliquidWhaleFlowContext,
|
|
19
|
+
resolveHyperliquidPerpFromSignalSymbol
|
|
20
|
+
} from "./chunk-FEQR4XGR.mjs";
|
|
12
21
|
import {
|
|
13
22
|
require_lodash
|
|
14
23
|
} from "./chunk-GPR56UYQ.mjs";
|
|
@@ -29,7 +38,7 @@ import {
|
|
|
29
38
|
runAiPrompt,
|
|
30
39
|
runAiPromptLocal,
|
|
31
40
|
trimSeriesDeep
|
|
32
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-DPHKRDD5.mjs";
|
|
33
42
|
import {
|
|
34
43
|
createPineScriptLoader
|
|
35
44
|
} from "./chunk-IQKMII6L.mjs";
|
|
@@ -464,6 +473,7 @@ var enrichSignalWithMlAi = async ({
|
|
|
464
473
|
await enrichSignalWithBinanceMarketContext({ signal, env });
|
|
465
474
|
await enrichSignalWithCoinMarketCapContext({ signal, env });
|
|
466
475
|
await enrichSignalWithDerivativesContext({ signal, env });
|
|
476
|
+
await enrichSignalWithHyperliquidWhaleContext({ signal, env });
|
|
467
477
|
await enrichSignalWithMl({ signal, env, ml });
|
|
468
478
|
return enrichSignalWithAi({ signal, userName, symbol, direction, env, ai });
|
|
469
479
|
};
|
|
@@ -1947,7 +1957,30 @@ var createStrategyRuntime = ({
|
|
|
1947
1957
|
indicatorsState,
|
|
1948
1958
|
isConfigFromBacktest,
|
|
1949
1959
|
sharedReplayKey: strategySharedReplayKey,
|
|
1950
|
-
getSharedReplayState: getSharedStrategyReplayState
|
|
1960
|
+
getSharedReplayState: getSharedStrategyReplayState,
|
|
1961
|
+
loadDecisionBaseContext: async ({
|
|
1962
|
+
baseContext,
|
|
1963
|
+
candle,
|
|
1964
|
+
symbol: decisionSymbol,
|
|
1965
|
+
interval: decisionInterval
|
|
1966
|
+
}) => {
|
|
1967
|
+
if (!baseContext) return void 0;
|
|
1968
|
+
const hyperliquidWhales = await loadHyperliquidWhaleFlowContext({
|
|
1969
|
+
symbol: decisionSymbol,
|
|
1970
|
+
interval: decisionInterval,
|
|
1971
|
+
timestamp: candle.timestamp,
|
|
1972
|
+
env,
|
|
1973
|
+
useSeriesCache: env === "BACKTEST" || env === "PARITY"
|
|
1974
|
+
});
|
|
1975
|
+
if (!hyperliquidWhales) return baseContext;
|
|
1976
|
+
return {
|
|
1977
|
+
...baseContext,
|
|
1978
|
+
participation: {
|
|
1979
|
+
...baseContext.participation,
|
|
1980
|
+
hyperliquidWhales
|
|
1981
|
+
}
|
|
1982
|
+
};
|
|
1983
|
+
}
|
|
1951
1984
|
});
|
|
1952
1985
|
const core = await createCore({
|
|
1953
1986
|
userName,
|
|
@@ -2892,6 +2925,7 @@ export {
|
|
|
2892
2925
|
enrichSignalWithAi,
|
|
2893
2926
|
enrichSignalWithBinanceMarketContext,
|
|
2894
2927
|
enrichSignalWithCoinMarketCapContext,
|
|
2928
|
+
enrichSignalWithHyperliquidWhaleContext,
|
|
2895
2929
|
enrichSignalWithMl,
|
|
2896
2930
|
enrichSignalWithMlAi,
|
|
2897
2931
|
ensureAiStrategyPluginsLoaded,
|
|
@@ -2902,6 +2936,10 @@ export {
|
|
|
2902
2936
|
getBinanceBreadthUniverseSnapshot,
|
|
2903
2937
|
getBinanceBreadthUniverses,
|
|
2904
2938
|
getDeterministicAiGateContext,
|
|
2939
|
+
getHyperliquidPerpSymbols,
|
|
2940
|
+
getHyperliquidPerpUniverseSnapshot,
|
|
2941
|
+
getHyperliquidWhaleAddresses,
|
|
2942
|
+
getHyperliquidWhaleRegistrySnapshot,
|
|
2905
2943
|
getOpenRouterModelKwargs,
|
|
2906
2944
|
getOrderArrivalSnapshot,
|
|
2907
2945
|
getPrimaryBinanceBreadthUniverse,
|
|
@@ -2910,9 +2948,12 @@ export {
|
|
|
2910
2948
|
getStrategyCreator,
|
|
2911
2949
|
getStrategyManifest,
|
|
2912
2950
|
isKnownStrategy,
|
|
2951
|
+
isTrackedHyperliquidPerp,
|
|
2952
|
+
isTrackedHyperliquidWhale,
|
|
2913
2953
|
registerStrategyEntries,
|
|
2914
2954
|
resetAiRuntimeCache,
|
|
2915
2955
|
resetStrategyRegistryCache,
|
|
2956
|
+
resolveHyperliquidPerpFromSignalSymbol,
|
|
2916
2957
|
resolveStrategyConfig,
|
|
2917
2958
|
runAiPrompt,
|
|
2918
2959
|
runAiPromptLocal,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tradejs/node",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.14",
|
|
4
4
|
"description": "Node-only runtime for the TradeJS TypeScript framework: strategies, backtests, Pine strategy loading, and plugin registries.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"tradejs",
|
|
@@ -67,9 +67,9 @@
|
|
|
67
67
|
"dependencies": {
|
|
68
68
|
"@langchain/core": "^1.2.3",
|
|
69
69
|
"@langchain/openai": "^1.5.5",
|
|
70
|
-
"@tradejs/core": "^2.0.
|
|
71
|
-
"@tradejs/infra": "^2.0.
|
|
72
|
-
"@tradejs/types": "^2.0.
|
|
70
|
+
"@tradejs/core": "^2.0.14",
|
|
71
|
+
"@tradejs/infra": "^2.0.14",
|
|
72
|
+
"@tradejs/types": "^2.0.14",
|
|
73
73
|
"chalk": "4.1.2",
|
|
74
74
|
"ioredis": "5.11.1",
|
|
75
75
|
"pinets": "0.8.12",
|