hedgequantx 2.9.201 → 2.9.202

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hedgequantx",
3
- "version": "2.9.201",
3
+ "version": "2.9.202",
4
4
  "description": "HedgeQuantX - Prop Futures Trading CLI",
5
5
  "main": "src/app.js",
6
6
  "bin": {
@@ -15,6 +15,7 @@ const CONFIG = {
15
15
  PRICE_CHANGE_TICKS: 4, // Log when price moves 4+ ticks
16
16
  DELTA_CHANGE_THRESHOLD: 200, // Log when delta changes 200+
17
17
  ZONE_APPROACH_TICKS: 5, // Log when within 5 ticks of zone
18
+ LOG_INTERVAL_SECONDS: 5, // Log every N seconds with quant data
18
19
  };
19
20
 
20
21
  const SYMBOLS = {
@@ -146,9 +147,11 @@ class SmartLogsEngine {
146
147
 
147
148
  getLog(state = {}) {
148
149
  this.counter++;
149
- const { position = 0, delta = 0 } = state;
150
+ const { position = 0, delta = 0, zScore = 0, vpin = 0, ofi = 0 } = state;
150
151
  const sym = getSym(this.symbolCode);
151
152
  const price = state.price > 0 ? state.price.toFixed(2) : '-.--';
153
+ const T = this.strategyId === 'hqx-2b' ? HQX2B : QUANT;
154
+ const now = Date.now();
152
155
 
153
156
  // Active position - always log
154
157
  if (position !== 0) {
@@ -165,6 +168,40 @@ class SmartLogsEngine {
165
168
  const events = this._detectEvents(state, this.lastState);
166
169
  this.lastState = { ...state };
167
170
 
171
+ // For QUANT strategy: use rich messages with Z-score, VPIN, OFI
172
+ if (this.strategyId === 'ultra-scalping' && state.bars >= 5) {
173
+ const timeSinceLastLog = now - this.lastLogTime;
174
+
175
+ // Log every 5 seconds with quant metrics
176
+ if (timeSinceLastLog >= CONFIG.LOG_INTERVAL_SECONDS * 1000) {
177
+ this.lastLogTime = now;
178
+
179
+ // Use rich QUANT messages with actual metrics
180
+ const zStr = zScore.toFixed(2);
181
+ const vpinStr = (vpin * 100).toFixed(0);
182
+ const ofiStr = (ofi * 100).toFixed(0);
183
+
184
+ // Choose message based on z-score level
185
+ let message;
186
+ if (Math.abs(zScore) >= 1.5) {
187
+ // Near signal threshold - use zones message
188
+ message = T.zones({
189
+ sym, price, zScore: zStr, vpin: vpinStr, ofi: ofiStr,
190
+ ticks: state.tickCount || state.bars
191
+ });
192
+ } else if (Math.abs(zScore) >= 0.8) {
193
+ // Building - use building message
194
+ message = T.building({ sym, ticks: state.tickCount || state.bars });
195
+ } else {
196
+ // Neutral - use simpler analysis
197
+ message = T.priceMove({ sym, price, dir: zScore > 0 ? 'up' : 'down', ticks: Math.abs(zScore).toFixed(1) });
198
+ }
199
+
200
+ return { type: 'analysis', message, logToSession: this.counter % CONFIG.SESSION_LOG_INTERVAL === 0 };
201
+ }
202
+ return null;
203
+ }
204
+
168
205
  // No events = no log (SILENCE)
169
206
  if (events.length === 0) {
170
207
  return null;