hedgequantx 2.9.228 → 2.9.229

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.
@@ -136,6 +136,26 @@ class HQXUltraScalpingStrategy extends EventEmitter {
136
136
  this.tickBuffer.set(contractId, []);
137
137
  this.lastBarTime.set(contractId, 0);
138
138
  this.kalmanStates.set(contractId, { estimate: 0, errorCovariance: 1.0 });
139
+
140
+ // Start status log interval - emits every second regardless of tick flow
141
+ this._currentContractId = contractId;
142
+ this._lastPrice = 0;
143
+ if (this._statusInterval) clearInterval(this._statusInterval);
144
+ this._statusInterval = setInterval(() => {
145
+ if (this._lastPrice > 0) {
146
+ this._emitStatusLog(this._currentContractId, this._lastPrice);
147
+ }
148
+ }, 1000);
149
+ }
150
+
151
+ /**
152
+ * Stop the strategy and clean up interval
153
+ */
154
+ stop() {
155
+ if (this._statusInterval) {
156
+ clearInterval(this._statusInterval);
157
+ this._statusInterval = null;
158
+ }
139
159
  }
140
160
 
141
161
  /**
@@ -152,15 +172,10 @@ class HQXUltraScalpingStrategy extends EventEmitter {
152
172
  let ticks = this.tickBuffer.get(contractId);
153
173
  ticks.push(tick);
154
174
 
155
- // Track total ticks for status log
175
+ // Track total ticks and last price for status log interval
156
176
  this._totalTicks = (this._totalTicks || 0) + 1;
157
-
158
- // Emit status log every second
159
- const now = Date.now();
160
- if (!this._lastStatusLog || now - this._lastStatusLog >= 1000) {
161
- this._lastStatusLog = now;
162
- this._emitStatusLog(contractId, tick.price);
163
- }
177
+ this._lastPrice = tick.price;
178
+ this._currentContractId = contractId;
164
179
 
165
180
  // Check if we should form a new bar
166
181
  const lastBar = this.lastBarTime.get(contractId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hedgequantx",
3
- "version": "2.9.228",
3
+ "version": "2.9.229",
4
4
  "description": "HedgeQuantX - Prop Futures Trading CLI",
5
5
  "main": "src/app.js",
6
6
  "bin": {