@tradejs/node 2.0.13 → 2.0.15
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.d.mts
CHANGED
|
@@ -116,6 +116,47 @@ declare const getBinanceBreadthUniverseSnapshot: () => BinanceBreadthUniverseSna
|
|
|
116
116
|
declare const getBinanceBreadthUniverses: () => BinanceBreadthUniverseDefinition[];
|
|
117
117
|
declare const getPrimaryBinanceBreadthUniverse: () => BinanceBreadthUniverseDefinition;
|
|
118
118
|
|
|
119
|
+
type HyperliquidPerpUniverseSnapshot = {
|
|
120
|
+
schemaVersion: 1;
|
|
121
|
+
updatedAt: string;
|
|
122
|
+
source: 'hyperliquid_main_perp_day_notional_volume';
|
|
123
|
+
fingerprint: string;
|
|
124
|
+
size: 30;
|
|
125
|
+
symbols: string[];
|
|
126
|
+
};
|
|
127
|
+
type HyperliquidWhaleRegistrySnapshot = {
|
|
128
|
+
schemaVersion: 2;
|
|
129
|
+
updatedAt: string;
|
|
130
|
+
source: 'hyperliquid_structural_fills_snapshot';
|
|
131
|
+
selection: {
|
|
132
|
+
calibrationFrom: string;
|
|
133
|
+
calibrationTo: string;
|
|
134
|
+
effectiveFrom: string;
|
|
135
|
+
candidateLimit: number;
|
|
136
|
+
minimumAccountValueUsd: number;
|
|
137
|
+
minimumActiveDays: number;
|
|
138
|
+
maximumRawFillsPerDay: number;
|
|
139
|
+
maximumDirectionalExecutionsPerDay: number;
|
|
140
|
+
minimumMedianNotionalUsd: number;
|
|
141
|
+
minimumMedianInterExecutionMinutes: number;
|
|
142
|
+
minimumTop30NotionalShare: number;
|
|
143
|
+
minimumTurnoverToEquity: number;
|
|
144
|
+
maximumTurnoverToEquity: number;
|
|
145
|
+
score: string;
|
|
146
|
+
forbiddenSelectionMetrics: readonly string[];
|
|
147
|
+
};
|
|
148
|
+
fingerprint: string;
|
|
149
|
+
size: 100;
|
|
150
|
+
addresses: string[];
|
|
151
|
+
};
|
|
152
|
+
declare const getHyperliquidPerpUniverseSnapshot: () => HyperliquidPerpUniverseSnapshot;
|
|
153
|
+
declare const getHyperliquidWhaleRegistrySnapshot: () => HyperliquidWhaleRegistrySnapshot;
|
|
154
|
+
declare const getHyperliquidPerpSymbols: () => string[];
|
|
155
|
+
declare const getHyperliquidWhaleAddresses: () => string[];
|
|
156
|
+
declare const isTrackedHyperliquidPerp: (symbol: string) => boolean;
|
|
157
|
+
declare const isTrackedHyperliquidWhale: (address: string) => boolean;
|
|
158
|
+
declare const resolveHyperliquidPerpFromSignalSymbol: (symbol: string) => string | null;
|
|
159
|
+
|
|
119
160
|
declare const enrichSignalWithCoinMarketCapContext: (params: {
|
|
120
161
|
signal: Signal;
|
|
121
162
|
env: string;
|
|
@@ -123,6 +164,14 @@ declare const enrichSignalWithCoinMarketCapContext: (params: {
|
|
|
123
164
|
maxAgeMs?: number;
|
|
124
165
|
}) => Promise<boolean>;
|
|
125
166
|
|
|
167
|
+
declare const enrichSignalWithHyperliquidWhaleContext: (params: {
|
|
168
|
+
signal: Signal;
|
|
169
|
+
env: string;
|
|
170
|
+
enabled?: boolean;
|
|
171
|
+
interval?: MarketFeatureInterval;
|
|
172
|
+
maxAgeMs?: number;
|
|
173
|
+
}) => Promise<boolean>;
|
|
174
|
+
|
|
126
175
|
type CloseOppositePositionsBeforeOpenOptions = {
|
|
127
176
|
connector: Connector;
|
|
128
177
|
entryContext: StrategyEntrySignalContext;
|
|
@@ -148,4 +197,4 @@ interface CreateCloseAllOnGlobalProfitBeforeSignalsHookParams {
|
|
|
148
197
|
}
|
|
149
198
|
declare const createCloseAllOnGlobalProfitBeforeSignalsHook: ({ getStrategyDefaultConfig, profitRiskMultiplier, }?: CreateCloseAllOnGlobalProfitBeforeSignalsHookParams) => TradejsConfigBeforeSignalsHook;
|
|
150
199
|
|
|
151
|
-
export { BINANCE_BREADTH_UNIVERSE_KEYS, type BinanceBreadthUniverseDefinition, type BinanceBreadthUniverseKey, type BinanceBreadthUniverseSnapshot, buildBinanceBreadthUniverseSnapshot, closeOppositePositionsBeforeOpen, createCloseAllOnGlobalProfitBeforeSignalsHook, createCloseOppositeBeforePlaceOrderHook, createMoveStopToBreakEvenAfterCoreDecisionHook, createMoveStopToBreakEvenOnBarHook, createStrategyRuntime, enrichSignalWithAi, enrichSignalWithBinanceMarketContext, enrichSignalWithCoinMarketCapContext, enrichSignalWithMl, enrichSignalWithMlAi, executeEntryOrder, getBinanceBreadthUniverseSnapshot, getBinanceBreadthUniverses, getOrderArrivalSnapshot, getPrimaryBinanceBreadthUniverse, resolveStrategyConfig, validateEntryProtectionAtArrival };
|
|
200
|
+
export { BINANCE_BREADTH_UNIVERSE_KEYS, type BinanceBreadthUniverseDefinition, type BinanceBreadthUniverseKey, type BinanceBreadthUniverseSnapshot, type HyperliquidPerpUniverseSnapshot, type HyperliquidWhaleRegistrySnapshot, buildBinanceBreadthUniverseSnapshot, closeOppositePositionsBeforeOpen, createCloseAllOnGlobalProfitBeforeSignalsHook, createCloseOppositeBeforePlaceOrderHook, createMoveStopToBreakEvenAfterCoreDecisionHook, createMoveStopToBreakEvenOnBarHook, createStrategyRuntime, enrichSignalWithAi, enrichSignalWithBinanceMarketContext, enrichSignalWithCoinMarketCapContext, enrichSignalWithHyperliquidWhaleContext, enrichSignalWithMl, enrichSignalWithMlAi, executeEntryOrder, getBinanceBreadthUniverseSnapshot, getBinanceBreadthUniverses, getHyperliquidPerpSymbols, getHyperliquidPerpUniverseSnapshot, getHyperliquidWhaleAddresses, getHyperliquidWhaleRegistrySnapshot, getOrderArrivalSnapshot, getPrimaryBinanceBreadthUniverse, isTrackedHyperliquidPerp, isTrackedHyperliquidWhale, resolveHyperliquidPerpFromSignalSymbol, resolveStrategyConfig, validateEntryProtectionAtArrival };
|
package/dist/strategies.d.ts
CHANGED
|
@@ -116,6 +116,47 @@ declare const getBinanceBreadthUniverseSnapshot: () => BinanceBreadthUniverseSna
|
|
|
116
116
|
declare const getBinanceBreadthUniverses: () => BinanceBreadthUniverseDefinition[];
|
|
117
117
|
declare const getPrimaryBinanceBreadthUniverse: () => BinanceBreadthUniverseDefinition;
|
|
118
118
|
|
|
119
|
+
type HyperliquidPerpUniverseSnapshot = {
|
|
120
|
+
schemaVersion: 1;
|
|
121
|
+
updatedAt: string;
|
|
122
|
+
source: 'hyperliquid_main_perp_day_notional_volume';
|
|
123
|
+
fingerprint: string;
|
|
124
|
+
size: 30;
|
|
125
|
+
symbols: string[];
|
|
126
|
+
};
|
|
127
|
+
type HyperliquidWhaleRegistrySnapshot = {
|
|
128
|
+
schemaVersion: 2;
|
|
129
|
+
updatedAt: string;
|
|
130
|
+
source: 'hyperliquid_structural_fills_snapshot';
|
|
131
|
+
selection: {
|
|
132
|
+
calibrationFrom: string;
|
|
133
|
+
calibrationTo: string;
|
|
134
|
+
effectiveFrom: string;
|
|
135
|
+
candidateLimit: number;
|
|
136
|
+
minimumAccountValueUsd: number;
|
|
137
|
+
minimumActiveDays: number;
|
|
138
|
+
maximumRawFillsPerDay: number;
|
|
139
|
+
maximumDirectionalExecutionsPerDay: number;
|
|
140
|
+
minimumMedianNotionalUsd: number;
|
|
141
|
+
minimumMedianInterExecutionMinutes: number;
|
|
142
|
+
minimumTop30NotionalShare: number;
|
|
143
|
+
minimumTurnoverToEquity: number;
|
|
144
|
+
maximumTurnoverToEquity: number;
|
|
145
|
+
score: string;
|
|
146
|
+
forbiddenSelectionMetrics: readonly string[];
|
|
147
|
+
};
|
|
148
|
+
fingerprint: string;
|
|
149
|
+
size: 100;
|
|
150
|
+
addresses: string[];
|
|
151
|
+
};
|
|
152
|
+
declare const getHyperliquidPerpUniverseSnapshot: () => HyperliquidPerpUniverseSnapshot;
|
|
153
|
+
declare const getHyperliquidWhaleRegistrySnapshot: () => HyperliquidWhaleRegistrySnapshot;
|
|
154
|
+
declare const getHyperliquidPerpSymbols: () => string[];
|
|
155
|
+
declare const getHyperliquidWhaleAddresses: () => string[];
|
|
156
|
+
declare const isTrackedHyperliquidPerp: (symbol: string) => boolean;
|
|
157
|
+
declare const isTrackedHyperliquidWhale: (address: string) => boolean;
|
|
158
|
+
declare const resolveHyperliquidPerpFromSignalSymbol: (symbol: string) => string | null;
|
|
159
|
+
|
|
119
160
|
declare const enrichSignalWithCoinMarketCapContext: (params: {
|
|
120
161
|
signal: Signal;
|
|
121
162
|
env: string;
|
|
@@ -123,6 +164,14 @@ declare const enrichSignalWithCoinMarketCapContext: (params: {
|
|
|
123
164
|
maxAgeMs?: number;
|
|
124
165
|
}) => Promise<boolean>;
|
|
125
166
|
|
|
167
|
+
declare const enrichSignalWithHyperliquidWhaleContext: (params: {
|
|
168
|
+
signal: Signal;
|
|
169
|
+
env: string;
|
|
170
|
+
enabled?: boolean;
|
|
171
|
+
interval?: MarketFeatureInterval;
|
|
172
|
+
maxAgeMs?: number;
|
|
173
|
+
}) => Promise<boolean>;
|
|
174
|
+
|
|
126
175
|
type CloseOppositePositionsBeforeOpenOptions = {
|
|
127
176
|
connector: Connector;
|
|
128
177
|
entryContext: StrategyEntrySignalContext;
|
|
@@ -148,4 +197,4 @@ interface CreateCloseAllOnGlobalProfitBeforeSignalsHookParams {
|
|
|
148
197
|
}
|
|
149
198
|
declare const createCloseAllOnGlobalProfitBeforeSignalsHook: ({ getStrategyDefaultConfig, profitRiskMultiplier, }?: CreateCloseAllOnGlobalProfitBeforeSignalsHookParams) => TradejsConfigBeforeSignalsHook;
|
|
150
199
|
|
|
151
|
-
export { BINANCE_BREADTH_UNIVERSE_KEYS, type BinanceBreadthUniverseDefinition, type BinanceBreadthUniverseKey, type BinanceBreadthUniverseSnapshot, buildBinanceBreadthUniverseSnapshot, closeOppositePositionsBeforeOpen, createCloseAllOnGlobalProfitBeforeSignalsHook, createCloseOppositeBeforePlaceOrderHook, createMoveStopToBreakEvenAfterCoreDecisionHook, createMoveStopToBreakEvenOnBarHook, createStrategyRuntime, enrichSignalWithAi, enrichSignalWithBinanceMarketContext, enrichSignalWithCoinMarketCapContext, enrichSignalWithMl, enrichSignalWithMlAi, executeEntryOrder, getBinanceBreadthUniverseSnapshot, getBinanceBreadthUniverses, getOrderArrivalSnapshot, getPrimaryBinanceBreadthUniverse, resolveStrategyConfig, validateEntryProtectionAtArrival };
|
|
200
|
+
export { BINANCE_BREADTH_UNIVERSE_KEYS, type BinanceBreadthUniverseDefinition, type BinanceBreadthUniverseKey, type BinanceBreadthUniverseSnapshot, type HyperliquidPerpUniverseSnapshot, type HyperliquidWhaleRegistrySnapshot, buildBinanceBreadthUniverseSnapshot, closeOppositePositionsBeforeOpen, createCloseAllOnGlobalProfitBeforeSignalsHook, createCloseOppositeBeforePlaceOrderHook, createMoveStopToBreakEvenAfterCoreDecisionHook, createMoveStopToBreakEvenOnBarHook, createStrategyRuntime, enrichSignalWithAi, enrichSignalWithBinanceMarketContext, enrichSignalWithCoinMarketCapContext, enrichSignalWithHyperliquidWhaleContext, enrichSignalWithMl, enrichSignalWithMlAi, executeEntryOrder, getBinanceBreadthUniverseSnapshot, getBinanceBreadthUniverses, getHyperliquidPerpSymbols, getHyperliquidPerpUniverseSnapshot, getHyperliquidWhaleAddresses, getHyperliquidWhaleRegistrySnapshot, getOrderArrivalSnapshot, getPrimaryBinanceBreadthUniverse, isTrackedHyperliquidPerp, isTrackedHyperliquidWhale, resolveHyperliquidPerpFromSignalSymbol, resolveStrategyConfig, validateEntryProtectionAtArrival };
|