hedgequantx 2.6.162 → 2.7.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.
Files changed (138) hide show
  1. package/README.md +15 -88
  2. package/bin/cli.js +0 -11
  3. package/dist/lib/api.jsc +0 -0
  4. package/dist/lib/api2.jsc +0 -0
  5. package/dist/lib/core.jsc +0 -0
  6. package/dist/lib/core2.jsc +0 -0
  7. package/dist/lib/data.js +1 -1
  8. package/dist/lib/data.jsc +0 -0
  9. package/dist/lib/data2.jsc +0 -0
  10. package/dist/lib/decoder.jsc +0 -0
  11. package/dist/lib/m/mod1.jsc +0 -0
  12. package/dist/lib/m/mod2.jsc +0 -0
  13. package/dist/lib/n/r1.jsc +0 -0
  14. package/dist/lib/n/r2.jsc +0 -0
  15. package/dist/lib/n/r3.jsc +0 -0
  16. package/dist/lib/n/r4.jsc +0 -0
  17. package/dist/lib/n/r5.jsc +0 -0
  18. package/dist/lib/n/r6.jsc +0 -0
  19. package/dist/lib/n/r7.jsc +0 -0
  20. package/dist/lib/o/util1.jsc +0 -0
  21. package/dist/lib/o/util2.jsc +0 -0
  22. package/package.json +6 -3
  23. package/src/app.js +40 -162
  24. package/src/config/constants.js +31 -33
  25. package/src/config/propfirms.js +13 -217
  26. package/src/config/settings.js +0 -43
  27. package/src/lib/api.js +198 -0
  28. package/src/lib/api2.js +353 -0
  29. package/src/lib/core.js +539 -0
  30. package/src/lib/core2.js +341 -0
  31. package/src/lib/data.js +555 -0
  32. package/src/lib/data2.js +492 -0
  33. package/src/lib/decoder.js +599 -0
  34. package/src/lib/m/s1.js +804 -0
  35. package/src/lib/m/s2.js +34 -0
  36. package/src/lib/n/r1.js +454 -0
  37. package/src/lib/n/r2.js +514 -0
  38. package/src/lib/n/r3.js +631 -0
  39. package/src/lib/n/r4.js +401 -0
  40. package/src/lib/n/r5.js +335 -0
  41. package/src/lib/n/r6.js +425 -0
  42. package/src/lib/n/r7.js +530 -0
  43. package/src/lib/o/l1.js +44 -0
  44. package/src/lib/o/l2.js +427 -0
  45. package/src/lib/python-bridge.js +206 -0
  46. package/src/menus/connect.js +14 -176
  47. package/src/menus/dashboard.js +65 -110
  48. package/src/pages/accounts.js +18 -18
  49. package/src/pages/algo/copy-trading.js +210 -240
  50. package/src/pages/algo/index.js +41 -104
  51. package/src/pages/algo/one-account.js +386 -33
  52. package/src/pages/algo/ui.js +312 -151
  53. package/src/pages/orders.js +3 -3
  54. package/src/pages/positions.js +3 -3
  55. package/src/pages/stats/chart.js +74 -0
  56. package/src/pages/stats/display.js +228 -0
  57. package/src/pages/stats/index.js +236 -0
  58. package/src/pages/stats/metrics.js +213 -0
  59. package/src/pages/user.js +6 -6
  60. package/src/services/hqx-server/constants.js +55 -0
  61. package/src/services/hqx-server/index.js +401 -0
  62. package/src/services/hqx-server/latency.js +81 -0
  63. package/src/services/index.js +12 -3
  64. package/src/services/rithmic/accounts.js +7 -32
  65. package/src/services/rithmic/connection.js +1 -204
  66. package/src/services/rithmic/contracts.js +235 -0
  67. package/src/services/rithmic/handlers.js +21 -196
  68. package/src/services/rithmic/index.js +60 -291
  69. package/src/services/rithmic/market.js +31 -0
  70. package/src/services/rithmic/orders.js +5 -361
  71. package/src/services/rithmic/protobuf.js +5 -195
  72. package/src/services/session.js +22 -173
  73. package/src/ui/box.js +10 -18
  74. package/src/ui/index.js +1 -3
  75. package/src/ui/menu.js +1 -1
  76. package/src/utils/prompts.js +2 -2
  77. package/dist/lib/m/s1.js +0 -1
  78. package/src/menus/ai-agent-connect.js +0 -181
  79. package/src/menus/ai-agent-models.js +0 -219
  80. package/src/menus/ai-agent-oauth.js +0 -292
  81. package/src/menus/ai-agent-ui.js +0 -141
  82. package/src/menus/ai-agent.js +0 -484
  83. package/src/pages/algo/algo-config.js +0 -195
  84. package/src/pages/algo/algo-multi.js +0 -801
  85. package/src/pages/algo/algo-utils.js +0 -58
  86. package/src/pages/algo/copy-engine.js +0 -449
  87. package/src/pages/algo/custom-strategy.js +0 -459
  88. package/src/pages/algo/logger.js +0 -245
  89. package/src/pages/algo/smart-logs-data.js +0 -218
  90. package/src/pages/algo/smart-logs.js +0 -387
  91. package/src/pages/algo/ui-constants.js +0 -144
  92. package/src/pages/algo/ui-summary.js +0 -184
  93. package/src/pages/stats-calculations.js +0 -191
  94. package/src/pages/stats-ui.js +0 -381
  95. package/src/pages/stats.js +0 -339
  96. package/src/services/ai/client-analysis.js +0 -194
  97. package/src/services/ai/client-models.js +0 -333
  98. package/src/services/ai/client.js +0 -343
  99. package/src/services/ai/index.js +0 -384
  100. package/src/services/ai/oauth-anthropic.js +0 -265
  101. package/src/services/ai/oauth-gemini.js +0 -223
  102. package/src/services/ai/oauth-iflow.js +0 -269
  103. package/src/services/ai/oauth-openai.js +0 -233
  104. package/src/services/ai/oauth-qwen.js +0 -279
  105. package/src/services/ai/providers/index.js +0 -526
  106. package/src/services/ai/proxy-install.js +0 -249
  107. package/src/services/ai/proxy-manager.js +0 -494
  108. package/src/services/ai/proxy-remote.js +0 -161
  109. package/src/services/ai/strategy-supervisor.js +0 -1312
  110. package/src/services/ai/supervisor-data.js +0 -195
  111. package/src/services/ai/supervisor-optimize.js +0 -215
  112. package/src/services/ai/supervisor-sync.js +0 -178
  113. package/src/services/ai/supervisor-utils.js +0 -158
  114. package/src/services/ai/supervisor.js +0 -484
  115. package/src/services/ai/validation.js +0 -250
  116. package/src/services/hqx-server-events.js +0 -110
  117. package/src/services/hqx-server-handlers.js +0 -217
  118. package/src/services/hqx-server-latency.js +0 -136
  119. package/src/services/hqx-server.js +0 -403
  120. package/src/services/position-constants.js +0 -28
  121. package/src/services/position-manager.js +0 -528
  122. package/src/services/position-momentum.js +0 -206
  123. package/src/services/projectx/accounts.js +0 -142
  124. package/src/services/projectx/index.js +0 -443
  125. package/src/services/projectx/market.js +0 -172
  126. package/src/services/projectx/stats.js +0 -110
  127. package/src/services/projectx/trading.js +0 -180
  128. package/src/services/rithmic/latency-tracker.js +0 -182
  129. package/src/services/rithmic/market-data.js +0 -549
  130. package/src/services/rithmic/specs.js +0 -146
  131. package/src/services/rithmic/trade-history.js +0 -254
  132. package/src/services/session-history.js +0 -475
  133. package/src/services/strategy/hft-tick.js +0 -507
  134. package/src/services/strategy/recovery-math.js +0 -402
  135. package/src/services/tradovate/constants.js +0 -109
  136. package/src/services/tradovate/index.js +0 -505
  137. package/src/services/tradovate/market.js +0 -47
  138. package/src/services/tradovate/websocket.js +0 -97
@@ -1,507 +0,0 @@
1
- /**
2
- * =============================================================================
3
- * HFT TICK-BY-TICK STRATEGY
4
- * =============================================================================
5
- * Pure tick-based strategy for high-frequency trading
6
- * No bars, no candles - every tick counts
7
- *
8
- * MODELS:
9
- * 1. Order Flow Imbalance (OFI) - Real-time buy/sell pressure
10
- * 2. Cumulative Delta - Net volume direction
11
- * 3. Bid/Ask Pressure - Spread and size analysis
12
- * 4. Momentum - Price velocity and acceleration
13
- * 5. Mean Reversion - Z-score on tick prices
14
- *
15
- * SIGNALS:
16
- * - Generated on each tick when conditions align
17
- * - Sub-second decision making
18
- * - Designed for <50ms execution
19
- */
20
-
21
- const EventEmitter = require('events');
22
- const { logger } = require('../../utils/logger');
23
-
24
- const log = logger.scope('HFT');
25
-
26
- /**
27
- * Circular buffer for efficient tick storage
28
- */
29
- class CircularBuffer {
30
- constructor(size) {
31
- this.size = size;
32
- this.buffer = new Array(size);
33
- this.head = 0;
34
- this.count = 0;
35
- }
36
-
37
- push(item) {
38
- this.buffer[this.head] = item;
39
- this.head = (this.head + 1) % this.size;
40
- if (this.count < this.size) this.count++;
41
- }
42
-
43
- get(index) {
44
- if (index >= this.count) return null;
45
- const actualIndex = (this.head - this.count + index + this.size) % this.size;
46
- return this.buffer[actualIndex];
47
- }
48
-
49
- getLast(n = 1) {
50
- const result = [];
51
- const count = Math.min(n, this.count);
52
- for (let i = this.count - count; i < this.count; i++) {
53
- result.push(this.get(i));
54
- }
55
- return result;
56
- }
57
-
58
- getAll() {
59
- return this.getLast(this.count);
60
- }
61
-
62
- get length() {
63
- return this.count;
64
- }
65
-
66
- clear() {
67
- this.head = 0;
68
- this.count = 0;
69
- }
70
- }
71
-
72
- /**
73
- * HFT Tick Strategy
74
- */
75
- class HFTTickStrategy extends EventEmitter {
76
- constructor() {
77
- super();
78
-
79
- // Configuration - MUST be set via initialize() with API data
80
- this.tickSize = null;
81
- this.tickValue = null;
82
- this.contractId = null;
83
- this.initialized = false;
84
-
85
- // Tick buffers (circular for memory efficiency)
86
- this.tickBuffer = new CircularBuffer(1000); // Last 1000 ticks
87
- this.priceBuffer = new CircularBuffer(500); // Last 500 prices
88
-
89
- // Real-time metrics
90
- this.cumulativeDelta = 0;
91
- this.buyVolume = 0;
92
- this.sellVolume = 0;
93
- this.lastPrice = 0;
94
- this.lastBid = 0;
95
- this.lastAsk = 0;
96
-
97
- // ═══════════════════════════════════════════════════════════════════════
98
- // STRATEGY CONFIGURATION PARAMETERS
99
- // These are algorithm tuning parameters, NOT trading data
100
- // They define HOW the strategy calculates signals from real tick data
101
- // ═══════════════════════════════════════════════════════════════════════
102
-
103
- // OFI calculation windows (algorithm config)
104
- this.ofiWindow = 50; // Number of ticks for OFI calculation
105
- this.ofiValue = 0; // Calculated from real ticks
106
-
107
- // Momentum windows (algorithm config)
108
- this.momentumWindow = 20; // Number of ticks for momentum
109
- this.momentum = 0; // Calculated from real tick prices
110
- this.acceleration = 0; // Calculated from real tick prices
111
-
112
- // Mean reversion windows (algorithm config)
113
- this.zscoreWindow = 100; // Number of ticks for z-score
114
- this.zscore = 0; // Calculated from real tick prices
115
- this.mean = 0; // Calculated from real tick prices
116
- this.std = 0; // Calculated from real tick prices
117
-
118
- // Signal thresholds (algorithm tuning - from backtests)
119
- this.ofiThreshold = 0.3; // |OFI| threshold for signal generation
120
- this.zscoreThreshold = 1.5; // |Z| threshold for mean reversion
121
- this.momentumThreshold = 0.5; // Momentum threshold for confirmation
122
- this.minConfidence = 0.6; // Minimum composite score for signal
123
-
124
- // Risk parameters in ticks (algorithm config)
125
- this.baseStopTicks = 8; // Base stop distance in ticks
126
- this.baseTargetTicks = 12; // Base target distance in ticks
127
-
128
- // State tracking
129
- this.tickCount = 0; // Counter from real ticks received
130
- this.signalCount = 0; // Counter of signals generated
131
- this.lastSignalTime = 0; // Timestamp of last signal
132
- this.cooldownMs = 5000; // Cooldown between signals (ms)
133
- }
134
-
135
- /**
136
- * Initialize strategy for a contract
137
- * @param {string} contractId - Contract identifier from API
138
- * @param {number} tickSize - Tick size from API (REQUIRED - no default)
139
- * @param {number} tickValue - Tick value from API (REQUIRED - no default)
140
- */
141
- initialize(contractId, tickSize, tickValue) {
142
- if (!contractId || tickSize === undefined || tickValue === undefined) {
143
- throw new Error('HFT Strategy requires contractId, tickSize, and tickValue from API');
144
- }
145
-
146
- this.contractId = contractId;
147
- this.tickSize = tickSize;
148
- this.tickValue = tickValue;
149
- this.initialized = true;
150
-
151
- // Reset state
152
- this.tickBuffer.clear();
153
- this.priceBuffer.clear();
154
- this.cumulativeDelta = 0;
155
- this.buyVolume = 0;
156
- this.sellVolume = 0;
157
- this.tickCount = 0;
158
-
159
- log.info(`Initialized for ${contractId}: tick=${tickSize}, value=${tickValue}`);
160
- }
161
-
162
- /**
163
- * Process a single tick - CORE HFT FUNCTION
164
- * Called on every market tick
165
- */
166
- processTick(tick) {
167
- if (!this.initialized) return;
168
-
169
- const { price, bid, ask, volume, side, timestamp } = tick;
170
-
171
- // Store tick
172
- this.tickBuffer.push({
173
- price,
174
- bid: bid || this.lastBid,
175
- ask: ask || this.lastAsk,
176
- volume: volume || 1,
177
- side: side || this.inferSide(price, bid, ask),
178
- timestamp: timestamp || Date.now(),
179
- });
180
-
181
- this.priceBuffer.push(price);
182
- this.tickCount++;
183
-
184
- // Update last values
185
- this.lastPrice = price;
186
- if (bid) this.lastBid = bid;
187
- if (ask) this.lastAsk = ask;
188
-
189
- // Update real-time metrics
190
- this._updateDelta(tick);
191
- this._updateOFI();
192
- this._updateMomentum();
193
- this._updateZScore();
194
-
195
- // Check for signal (every tick!)
196
- this._checkSignal(tick);
197
- }
198
-
199
- /**
200
- * Infer trade side from price position
201
- */
202
- inferSide(price, bid, ask) {
203
- if (!bid || !ask) return 'unknown';
204
- const mid = (bid + ask) / 2;
205
- return price >= mid ? 'BUY' : 'SELL';
206
- }
207
-
208
- /**
209
- * Update cumulative delta
210
- */
211
- _updateDelta(tick) {
212
- const vol = tick.volume || 1;
213
- const side = tick.side?.toUpperCase() || this.inferSide(tick.price, tick.bid, tick.ask);
214
-
215
- if (side === 'BUY') {
216
- this.buyVolume += vol;
217
- this.cumulativeDelta += vol;
218
- } else if (side === 'SELL') {
219
- this.sellVolume += vol;
220
- this.cumulativeDelta -= vol;
221
- }
222
- }
223
-
224
- /**
225
- * Calculate Order Flow Imbalance on recent ticks
226
- */
227
- _updateOFI() {
228
- const ticks = this.tickBuffer.getLast(this.ofiWindow);
229
- if (ticks.length < 10) {
230
- this.ofiValue = 0;
231
- return;
232
- }
233
-
234
- let buyPressure = 0;
235
- let sellPressure = 0;
236
-
237
- for (const tick of ticks) {
238
- const vol = tick.volume || 1;
239
- const side = (tick.side || '').toUpperCase();
240
-
241
- if (side === 'BUY') {
242
- buyPressure += vol;
243
- } else if (side === 'SELL') {
244
- sellPressure += vol;
245
- }
246
- }
247
-
248
- const total = buyPressure + sellPressure;
249
- if (total > 0) {
250
- // OFI range: -1 (all sells) to +1 (all buys)
251
- this.ofiValue = (buyPressure - sellPressure) / total;
252
- }
253
- }
254
-
255
- /**
256
- * Calculate price momentum
257
- */
258
- _updateMomentum() {
259
- const prices = this.priceBuffer.getLast(this.momentumWindow);
260
- if (prices.length < 5) {
261
- this.momentum = 0;
262
- this.acceleration = 0;
263
- return;
264
- }
265
-
266
- // Momentum = price change over window
267
- const first = prices[0];
268
- const last = prices[prices.length - 1];
269
- this.momentum = (last - first) / this.tickSize;
270
-
271
- // Acceleration = change in momentum
272
- if (prices.length >= 10) {
273
- const mid = prices[Math.floor(prices.length / 2)];
274
- const firstHalf = (mid - first) / this.tickSize;
275
- const secondHalf = (last - mid) / this.tickSize;
276
- this.acceleration = secondHalf - firstHalf;
277
- }
278
- }
279
-
280
- /**
281
- * Calculate Z-Score for mean reversion
282
- */
283
- _updateZScore() {
284
- const prices = this.priceBuffer.getLast(this.zscoreWindow);
285
- if (prices.length < 20) {
286
- this.zscore = 0;
287
- return;
288
- }
289
-
290
- // Calculate mean
291
- this.mean = prices.reduce((a, b) => a + b, 0) / prices.length;
292
-
293
- // Calculate standard deviation
294
- const variance = prices.reduce((sum, p) => sum + Math.pow(p - this.mean, 2), 0) / prices.length;
295
- this.std = Math.sqrt(variance);
296
-
297
- // Z-Score
298
- if (this.std > 0.0001) {
299
- this.zscore = (this.lastPrice - this.mean) / this.std;
300
- } else {
301
- this.zscore = 0;
302
- }
303
- }
304
-
305
- /**
306
- * Check for trading signal
307
- */
308
- _checkSignal(tick) {
309
- // Need minimum data
310
- if (this.tickCount < 50) return;
311
-
312
- // Cooldown check
313
- const now = Date.now();
314
- if (now - this.lastSignalTime < this.cooldownMs) return;
315
-
316
- // Calculate composite score
317
- const { direction, confidence, scores } = this._calculateSignal();
318
-
319
- if (direction === 'none' || confidence < this.minConfidence) return;
320
-
321
- // Generate signal
322
- this.signalCount++;
323
- this.lastSignalTime = now;
324
-
325
- const signal = this._buildSignal(direction, confidence, scores, tick);
326
-
327
- log.info(`SIGNAL #${this.signalCount}: ${direction.toUpperCase()} @ ${tick.price} | ` +
328
- `OFI=${this.ofiValue.toFixed(2)} Z=${this.zscore.toFixed(2)} Mom=${this.momentum.toFixed(1)} | ` +
329
- `Conf=${(confidence * 100).toFixed(0)}%`);
330
-
331
- this.emit('signal', signal);
332
- }
333
-
334
- /**
335
- * Calculate trading signal from all models
336
- */
337
- _calculateSignal() {
338
- let direction = 'none';
339
- let confidence = 0;
340
-
341
- const scores = {
342
- ofi: 0,
343
- zscore: 0,
344
- momentum: 0,
345
- delta: 0,
346
- composite: 0,
347
- };
348
-
349
- // === MODEL 1: OFI ===
350
- const absOfi = Math.abs(this.ofiValue);
351
- if (absOfi > this.ofiThreshold) {
352
- scores.ofi = Math.min(1.0, absOfi / 0.6);
353
- }
354
-
355
- // === MODEL 2: Z-Score Mean Reversion ===
356
- const absZ = Math.abs(this.zscore);
357
- if (absZ > this.zscoreThreshold) {
358
- scores.zscore = Math.min(1.0, absZ / 3.0);
359
- }
360
-
361
- // === MODEL 3: Momentum ===
362
- const absMom = Math.abs(this.momentum);
363
- if (absMom > this.momentumThreshold) {
364
- scores.momentum = Math.min(1.0, absMom / 3.0);
365
- }
366
-
367
- // === MODEL 4: Delta ===
368
- const totalVol = this.buyVolume + this.sellVolume;
369
- if (totalVol > 0) {
370
- const deltaRatio = this.cumulativeDelta / totalVol;
371
- scores.delta = Math.min(1.0, Math.abs(deltaRatio) * 2);
372
- }
373
-
374
- // === COMPOSITE SCORE ===
375
- scores.composite =
376
- scores.ofi * 0.35 + // OFI: 35%
377
- scores.zscore * 0.25 + // Z-Score: 25%
378
- scores.momentum * 0.20 + // Momentum: 20%
379
- scores.delta * 0.20; // Delta: 20%
380
-
381
- confidence = scores.composite;
382
-
383
- // === DETERMINE DIRECTION ===
384
- // Mean reversion: go opposite to z-score
385
- // Momentum: confirm with OFI and delta
386
-
387
- if (scores.composite >= this.minConfidence) {
388
- // Primary: Mean reversion
389
- if (absZ > this.zscoreThreshold) {
390
- direction = this.zscore > 0 ? 'short' : 'long';
391
-
392
- // Confirm with OFI
393
- const ofiConfirms =
394
- (direction === 'long' && this.ofiValue > 0) ||
395
- (direction === 'short' && this.ofiValue < 0);
396
-
397
- if (ofiConfirms) {
398
- confidence += 0.1;
399
- } else if (Math.abs(this.ofiValue) > 0.2) {
400
- // OFI contradicts - reduce confidence
401
- confidence -= 0.15;
402
- }
403
- }
404
- // Fallback: Momentum breakout
405
- else if (absMom > this.momentumThreshold * 2 && absOfi > this.ofiThreshold) {
406
- direction = this.momentum > 0 ? 'long' : 'short';
407
- // Must be confirmed by OFI
408
- if ((direction === 'long' && this.ofiValue < 0) ||
409
- (direction === 'short' && this.ofiValue > 0)) {
410
- direction = 'none';
411
- }
412
- }
413
- }
414
-
415
- confidence = Math.min(1.0, Math.max(0, confidence));
416
-
417
- return { direction, confidence, scores };
418
- }
419
-
420
- /**
421
- * Build signal object
422
- */
423
- _buildSignal(direction, confidence, scores, tick) {
424
- const entry = tick.price;
425
- const isLong = direction === 'long';
426
-
427
- // Adaptive stops based on volatility (std dev)
428
- const volMult = Math.max(0.5, Math.min(2.0, this.std / this.tickSize / 4));
429
- const stopTicks = Math.round(this.baseStopTicks * volMult);
430
- const targetTicks = Math.round(this.baseTargetTicks * volMult);
431
-
432
- const stopLoss = isLong
433
- ? entry - stopTicks * this.tickSize
434
- : entry + stopTicks * this.tickSize;
435
-
436
- const takeProfit = isLong
437
- ? entry + targetTicks * this.tickSize
438
- : entry - targetTicks * this.tickSize;
439
-
440
- return {
441
- id: `hft-${Date.now()}-${this.signalCount}`,
442
- timestamp: Date.now(),
443
- contractId: this.contractId,
444
- direction,
445
- side: isLong ? 0 : 1,
446
- entry,
447
- stopLoss,
448
- takeProfit,
449
- confidence,
450
- scores,
451
- // Model values for logging
452
- ofi: this.ofiValue,
453
- zscore: this.zscore,
454
- momentum: this.momentum,
455
- delta: this.cumulativeDelta,
456
- // Tick count
457
- tickCount: this.tickCount,
458
- };
459
- }
460
-
461
- /**
462
- * Get current model values for monitoring
463
- */
464
- getModelValues() {
465
- return {
466
- ofi: this.ofiValue,
467
- delta: this.cumulativeDelta,
468
- zscore: this.zscore,
469
- momentum: this.momentum,
470
- mean: this.mean,
471
- std: this.std,
472
- buyVolume: this.buyVolume,
473
- sellVolume: this.sellVolume,
474
- tickCount: this.tickCount,
475
- signalCount: this.signalCount,
476
- };
477
- }
478
-
479
- /**
480
- * Get state for display
481
- */
482
- getState() {
483
- return this.getModelValues();
484
- }
485
-
486
- /**
487
- * Reset strategy state
488
- */
489
- reset() {
490
- this.tickBuffer.clear();
491
- this.priceBuffer.clear();
492
- this.cumulativeDelta = 0;
493
- this.buyVolume = 0;
494
- this.sellVolume = 0;
495
- this.tickCount = 0;
496
- this.signalCount = 0;
497
- this.ofiValue = 0;
498
- this.zscore = 0;
499
- this.momentum = 0;
500
- log.info('Strategy reset');
501
- }
502
- }
503
-
504
- // Singleton instance
505
- const hftStrategy = new HFTTickStrategy();
506
-
507
- module.exports = { HFTTickStrategy, hftStrategy };