hedgequantx 2.9.52 → 2.9.53

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.52",
3
+ "version": "2.9.53",
4
4
  "description": "HedgeQuantX - Prop Futures Trading CLI",
5
5
  "main": "src/app.js",
6
6
  "bin": {
package/src/lib/data.js CHANGED
@@ -210,13 +210,20 @@ class MarketDataFeed extends EventEmitter {
210
210
  try {
211
211
  const trade = proto.decode('LastTrade', data);
212
212
 
213
+ // Debug: log first trade to see structure
214
+ if (!this._loggedFirstTrade) {
215
+ this._loggedFirstTrade = true;
216
+ this.emit('debug', `Trade fields: ${Object.keys(trade).join(', ')}`);
217
+ this.emit('debug', `Trade price: ${trade.tradePrice || trade.trade_price || trade.price}`);
218
+ }
219
+
213
220
  const tick = {
214
221
  type: 'trade',
215
222
  symbol: trade.symbol,
216
223
  exchange: trade.exchange,
217
- price: trade.tradePrice,
218
- size: trade.tradeSize,
219
- volume: trade.volume,
224
+ price: trade.tradePrice || trade.trade_price || trade.price,
225
+ size: trade.tradeSize || trade.trade_size || trade.size || 1,
226
+ volume: trade.volume || 1,
220
227
  side: trade.aggressor === 1 ? 'buy' : trade.aggressor === 2 ? 'sell' : 'unknown',
221
228
  timestamp: Date.now(),
222
229
  ssboe: trade.ssboe,
@@ -15,7 +15,7 @@ const BOX = {
15
15
  // Spinner characters
16
16
  const SPINNER = ['\u280B', '\u2819', '\u2839', '\u2838', '\u283C', '\u2834', '\u2826', '\u2827', '\u2807', '\u280F'];
17
17
 
18
- // Log type colors - HF grade
18
+ // Log type colors - HF grade with variety
19
19
  const LOG_COLORS = {
20
20
  // Executions
21
21
  fill_buy: chalk.green.bold,
@@ -23,14 +23,19 @@ const LOG_COLORS = {
23
23
  fill_win: chalk.green.bold,
24
24
  fill_loss: chalk.red.bold,
25
25
  // Status
26
- connected: chalk.green,
26
+ connected: chalk.green.bold,
27
27
  ready: chalk.cyan,
28
28
  // Errors
29
29
  error: chalk.red.bold,
30
30
  reject: chalk.red,
31
- // Info
32
- info: chalk.gray,
33
- system: chalk.blue
31
+ // Info - varied colors
32
+ info: chalk.white,
33
+ signal: chalk.yellow.bold,
34
+ trade: chalk.magenta.bold,
35
+ analysis: chalk.blue,
36
+ risk: chalk.yellow,
37
+ system: chalk.blue,
38
+ debug: chalk.gray
34
39
  };
35
40
 
36
41
  // Log type icons - compact HF style
@@ -44,7 +49,12 @@ const LOG_ICONS = {
44
49
  error: 'ERR ',
45
50
  reject: 'REJ ',
46
51
  info: 'INFO ',
47
- system: 'SYS '
52
+ signal: 'SIG ',
53
+ trade: 'TRADE',
54
+ analysis: 'ANLZ ',
55
+ risk: 'RISK ',
56
+ system: 'SYS ',
57
+ debug: 'DBG '
48
58
  };
49
59
 
50
60
  /**
@@ -129,7 +139,7 @@ class AlgoUI {
129
139
  this._line(chalk.cyan(BOX.ML + BOX.H.repeat(W) + BOX.MR));
130
140
  this._line(chalk.cyan(BOX.V) + chalk.yellow(center(`PROP FUTURES ALGO TRADING V${version}`, W)) + chalk.cyan(BOX.V));
131
141
  this._line(chalk.cyan(BOX.ML + BOX.H.repeat(W) + BOX.MR));
132
- this._line(chalk.cyan(BOX.V) + chalk.yellow(center((this.config.subtitle || 'HQX ALGO TRADING').toUpperCase(), W)) + chalk.cyan(BOX.V));
142
+ this._line(chalk.cyan(BOX.V) + chalk.cyan.bold(center((this.config.subtitle || 'HQX ALGO TRADING').toUpperCase(), W)) + chalk.cyan(BOX.V));
133
143
  }
134
144
 
135
145
  _drawStats(stats) {
@@ -199,7 +209,7 @@ class AlgoUI {
199
209
 
200
210
  // Row 5: Connection | Propfirm
201
211
  const connection = stats.platform || 'Rithmic';
202
- const r5c1 = buildCell('Connection', connection, chalk.white, colL);
212
+ const r5c1 = buildCell('Connection', connection, chalk.cyan, colL);
203
213
  const r5c2 = buildCell('Propfirm', stats.propfirm || 'N/A', chalk.cyan, colR);
204
214
  row(r5c1.padded, r5c2.padded);
205
215
 
@@ -267,9 +277,11 @@ class AlgoUI {
267
277
  _drawLogs() {
268
278
  const { W, logs, maxLogs } = this;
269
279
 
270
- // Activity header - HF style
271
- this.spinnerFrame = (this.spinnerFrame + 1) % SPINNER.length;
272
- const spinner = SPINNER[this.spinnerFrame];
280
+ // Activity header - HF style with animated spinner
281
+ const elapsed = Math.floor((Date.now() - (this.startTime || Date.now())) / 100);
282
+ if (!this.startTime) this.startTime = Date.now();
283
+ const spinnerIdx = elapsed % SPINNER.length;
284
+ const spinner = SPINNER[spinnerIdx];
273
285
  const now = new Date();
274
286
  const timeStr = now.toLocaleTimeString('en-US', { hour12: false });
275
287
  const dateStr = now.toLocaleDateString('en-US', { month: 'short', day: 'numeric' });