hedgequantx 1.8.39 → 1.8.41

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": "1.8.39",
3
+ "version": "1.8.41",
4
4
  "description": "Prop Futures Algo Trading CLI - Connect to Topstep, Alpha Futures, and other prop firms",
5
5
  "main": "src/app.js",
6
6
  "bin": {
@@ -72,7 +72,7 @@ const copyTradingMenu = async () => {
72
72
  // Step 1: Select Lead Account
73
73
  console.log(chalk.cyan(' Step 1: Select LEAD Account'));
74
74
  const leadOptions = allAccounts.map((a, i) => ({
75
- label: `${a.propfirm} - ${a.account.accountId}${a.account.balance !== null ? ` ($${a.account.balance.toLocaleString()})` : ''}`,
75
+ label: `${a.propfirm} - ${a.account.rithmicAccountId || a.account.name || a.account.accountId}${a.account.balance !== null ? ` ($${a.account.balance.toLocaleString()})` : ''}`,
76
76
  value: i
77
77
  }));
78
78
  leadOptions.push({ label: '< Cancel', value: -1 });
@@ -88,7 +88,7 @@ const copyTradingMenu = async () => {
88
88
  .map((a, i) => ({ a, i }))
89
89
  .filter(x => x.i !== leadIdx)
90
90
  .map(x => ({
91
- label: `${x.a.propfirm} - ${x.a.account.accountId}${x.a.account.balance !== null ? ` ($${x.a.account.balance.toLocaleString()})` : ''}`,
91
+ label: `${x.a.propfirm} - ${x.a.account.rithmicAccountId || x.a.account.name || x.a.account.accountId}${x.a.account.balance !== null ? ` ($${x.a.account.balance.toLocaleString()})` : ''}`,
92
92
  value: x.i
93
93
  }));
94
94
  followerOptions.push({ label: '< Cancel', value: -1 });
@@ -49,7 +49,7 @@ const oneAccountMenu = async (service) => {
49
49
 
50
50
  // Select account
51
51
  const options = activeAccounts.map(acc => ({
52
- label: `${acc.accountId} (${acc.propfirm || 'Unknown'})${acc.balance !== null ? ` - $${acc.balance.toLocaleString()}` : ''}`,
52
+ label: `${acc.rithmicAccountId || acc.name || acc.accountId} (${acc.propfirm || 'Unknown'})${acc.balance !== null ? ` - $${acc.balance.toLocaleString()}` : ''}`,
53
53
  value: acc
54
54
  }));
55
55
  options.push({ label: '< Back', value: 'back' });
@@ -157,8 +157,8 @@ class AlgoUI {
157
157
  this._line(chalk.cyan(GT));
158
158
 
159
159
  // Row 1: Account | Symbol
160
- const accountName = (stats.accountName || 'N/A').substring(0, 40);
161
- const symbol = (stats.symbol || 'N/A').substring(0, 35);
160
+ const accountName = String(stats.accountName || 'N/A').substring(0, 40);
161
+ const symbol = String(stats.symbol || 'N/A').substring(0, 35);
162
162
  const r1c1 = buildCell('Account', accountName, chalk.cyan, colL);
163
163
  const r1c2 = buildCell('Symbol', symbol, chalk.yellow, colR);
164
164
  row(r1c1.padded, r1c2.padded);
@@ -69,7 +69,7 @@ const showOrders = async (service) => {
69
69
  const qty = order.size || order.quantity || 0;
70
70
  const price = order.limitPrice || order.price || 0;
71
71
  const statusInfo = ORDER_STATUS[order.status] || { text: 'Unknown', color: 'gray', icon: '[?]' };
72
- const account = (order.accountName || 'Unknown').substring(0, 12);
72
+ const account = String(order.accountName || 'Unknown').substring(0, 12);
73
73
 
74
74
  const row = ' ' +
75
75
  chalk.white(symbol.padEnd(12)) +
@@ -68,7 +68,7 @@ const showPositions = async (service) => {
68
68
  const size = Math.abs(pos.size || pos.quantity || 0);
69
69
  const entry = pos.averagePrice || pos.entryPrice || 0;
70
70
  const pnl = pos.profitAndLoss || pos.unrealizedPnl || 0;
71
- const account = (pos.accountName || 'Unknown').substring(0, 15);
71
+ const account = String(pos.accountName || 'Unknown').substring(0, 15);
72
72
 
73
73
  const pnlColor = pnl >= 0 ? chalk.green : chalk.red;
74
74
  const pnlStr = (pnl >= 0 ? '+' : '') + '$' + pnl.toFixed(2);