hedgequantx 2.6.143 → 2.6.145

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.6.143",
3
+ "version": "2.6.145",
4
4
  "description": "HedgeQuantX - Prop Futures Trading CLI",
5
5
  "main": "src/app.js",
6
6
  "bin": {
@@ -457,7 +457,7 @@ const launchAlgo = async (service, account, contract, config) => {
457
457
  stats.avgFillLatency = stats.entryLatencies.reduce((a, b) => a + b, 0) / stats.entryLatencies.length;
458
458
  const side = position.side === 0 ? 'LONG' : 'SHORT';
459
459
  // Use 'filled' type for colored FILL icon
460
- ui.addLog('filled', `${side} ${position.size}x ${symbolName} @ ${position.entryPrice} | ${fillLatencyMs}ms`);
460
+ ui.addLog('filled', `${side} ${position.size}x ${symbolName} @ ${parseFloat(position.entryPrice.toFixed(6))} | ${fillLatencyMs}ms`);
461
461
  });
462
462
 
463
463
  positionManager.on('exitFilled', ({ orderTag, exitPrice, pnlTicks, holdDurationMs }) => {
@@ -493,10 +493,10 @@ const launchAlgo = async (service, account, contract, config) => {
493
493
 
494
494
  if (pnlDollars >= 0) {
495
495
  stats.wins++;
496
- ui.addLog('win', `+$${pnlDollars.toFixed(2)} @ ${exitPrice} | ${holdSec}s`);
496
+ ui.addLog('win', `+$${pnlDollars.toFixed(2)} @ ${parseFloat(exitPrice.toFixed(6))} | ${holdSec}s`);
497
497
  } else {
498
498
  stats.losses++;
499
- ui.addLog('loss', `-$${Math.abs(pnlDollars).toFixed(2)} @ ${exitPrice} | ${holdSec}s`);
499
+ ui.addLog('loss', `-$${Math.abs(pnlDollars).toFixed(2)} @ ${parseFloat(exitPrice.toFixed(6))} | ${holdSec}s`);
500
500
  }
501
501
  } else {
502
502
  // Log with ticks only if tickValue unavailable
@@ -521,7 +521,7 @@ const launchAlgo = async (service, account, contract, config) => {
521
521
 
522
522
  positionManager.on('breakevenActivated', ({ orderTag, position, breakevenPrice, pnlTicks }) => {
523
523
  // Use 'be' type for yellow BE icon
524
- ui.addLog('be', `Breakeven @ ${breakevenPrice} | +${pnlTicks} ticks`)
524
+ ui.addLog('be', `Breakeven @ ${parseFloat(breakevenPrice.toFixed(6))} | +${pnlTicks} ticks`)
525
525
  });
526
526
 
527
527
  positionManager.on('exitOrderFired', ({ orderTag, exitReason, latencyMs }) => {
@@ -841,7 +841,7 @@ const launchAlgo = async (service, account, contract, config) => {
841
841
 
842
842
  // Debug: log first tick and confirm data flow after 5s
843
843
  if (tickCount === 1) {
844
- algoLogger.info(ui, 'FIRST TICK', `price=${tick.price} bid=${tick.bid} ask=${tick.ask} vol=${tick.volume || tick.size || 0}`);
844
+ algoLogger.info(ui, 'FIRST TICK', `price=${parseFloat(Number(tick.price).toFixed(6))} bid=${parseFloat(Number(tick.bid).toFixed(6))} ask=${parseFloat(Number(tick.ask).toFixed(6))} vol=${tick.volume || tick.size || 0}`);
845
845
  } else if (tickCount === 100) {
846
846
  algoLogger.info(ui, 'DATA FLOWING', `100 ticks received - market data OK`);
847
847
  }
@@ -1557,7 +1557,7 @@ const launchMultiSymbolRithmic = async (service, account, contracts, config) =>
1557
1557
  stats.entryLatencies.push(fillLatencyMs);
1558
1558
  stats.avgFillLatency = stats.entryLatencies.reduce((a, b) => a + b, 0) / stats.entryLatencies.length;
1559
1559
  const side = position.side === 0 ? 'LONG' : 'SHORT';
1560
- ui.addLog('filled', `[${symbolName}] ${side} ${position.size}x @ ${position.entryPrice} | ${fillLatencyMs}ms`);
1560
+ ui.addLog('filled', `[${symbolName}] ${side} ${position.size}x @ ${parseFloat(position.entryPrice.toFixed(6))} | ${fillLatencyMs}ms`);
1561
1561
  stats.symbolStats[symbolName].position = position.side === 0 ? position.size : -position.size;
1562
1562
  ui.render(stats);
1563
1563
  });
@@ -1597,11 +1597,11 @@ const launchMultiSymbolRithmic = async (service, account, contracts, config) =>
1597
1597
  if (pnlDollars >= 0) {
1598
1598
  stats.wins++;
1599
1599
  stats.symbolStats[symbolName].wins++;
1600
- ui.addLog('win', `[${symbolName}] +$${pnlDollars.toFixed(2)} @ ${exitPrice} | ${holdSec}s`);
1600
+ ui.addLog('win', `[${symbolName}] +$${pnlDollars.toFixed(2)} @ ${parseFloat(exitPrice.toFixed(6))} | ${holdSec}s`);
1601
1601
  } else {
1602
1602
  stats.losses++;
1603
1603
  stats.symbolStats[symbolName].losses++;
1604
- ui.addLog('loss', `[${symbolName}] -$${Math.abs(pnlDollars).toFixed(2)} @ ${exitPrice} | ${holdSec}s`);
1604
+ ui.addLog('loss', `[${symbolName}] -$${Math.abs(pnlDollars).toFixed(2)} @ ${parseFloat(exitPrice.toFixed(6))} | ${holdSec}s`);
1605
1605
  // Symbol can trade again - no disable, continue until Target/Risk reached
1606
1606
  }
1607
1607
  } else if (pnlTicks !== null) {
@@ -1632,7 +1632,7 @@ const launchMultiSymbolRithmic = async (service, account, contracts, config) =>
1632
1632
  });
1633
1633
 
1634
1634
  pm.on('breakevenActivated', ({ breakevenPrice, pnlTicks }) => {
1635
- ui.addLog('be', `[${symbolName}] BE @ ${breakevenPrice} | +${pnlTicks} ticks`);
1635
+ ui.addLog('be', `[${symbolName}] BE @ ${parseFloat(breakevenPrice.toFixed(6))} | +${pnlTicks} ticks`);
1636
1636
  });
1637
1637
 
1638
1638
  // ═══════════════════════════════════════════════════════════════════════
@@ -1735,7 +1735,7 @@ const launchMultiSymbolRithmic = async (service, account, contracts, config) =>
1735
1735
 
1736
1736
  // Log first tick per symbol
1737
1737
  if (stats.symbolStats[symbolName].tickCount === 1) {
1738
- algoLogger.info(ui, 'FIRST TICK', `[${symbolName}] price=${tick.price} bid=${tick.bid} ask=${tick.ask}`);
1738
+ algoLogger.info(ui, 'FIRST TICK', `[${symbolName}] price=${parseFloat(Number(tick.price).toFixed(6))} bid=${parseFloat(Number(tick.bid).toFixed(6))} ask=${parseFloat(Number(tick.ask).toFixed(6))}`);
1739
1739
  } else if (stats.symbolStats[symbolName].tickCount === 100) {
1740
1740
  algoLogger.info(ui, 'DATA FLOWING', `[${symbolName}] 100 ticks received`);
1741
1741
  }
@@ -1925,7 +1925,7 @@ const launchMultiSymbolRithmic = async (service, account, contracts, config) =>
1925
1925
  // Capture baseline on first update (P&L at session start)
1926
1926
  if (baselineClosedPnl === null) {
1927
1927
  baselineClosedPnl = accountClosedPnl;
1928
- algoLogger.info(ui, 'SESSION START', `Baseline P&L: $${baselineClosedPnl.toFixed(2)}`);
1928
+ // Baseline captured silently - no need to show to user
1929
1929
  }
1930
1930
 
1931
1931
  // stats.closedPnl shows ONLY this session's closed P&L (delta from baseline)