hedgequantx 2.7.94 → 2.7.96

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.7.94",
3
+ "version": "2.7.96",
4
4
  "description": "HedgeQuantX - Prop Futures Trading CLI",
5
5
  "main": "src/app.js",
6
6
  "bin": {
@@ -130,13 +130,10 @@ const showAccounts = async (service) => {
130
130
  const pnlColor2 = pnl2 === null || pnl2 === undefined ? chalk.gray : (pnl2 >= 0 ? chalk.green : chalk.red);
131
131
  console.log(chalk.cyan('║') + fmtRow('P&L:', pnlColor1(pnlStr1), col1) + chalk.cyan(sep) + (acc2 ? fmtRow('P&L:', pnlColor2(pnlStr2), col2) : ' '.repeat(col2)) + chalk.cyan('║'));
132
132
 
133
- // Status - numeric 0 = Active for Rithmic
134
- const getStatusDisplay = (status) => {
135
- if (status === null || status === undefined) return { text: '--', color: 'gray' };
136
- if (status === 0) return { text: 'Active', color: 'green' };
137
- if (typeof status === 'number') {
138
- return ACCOUNT_STATUS[status] || { text: `Status ${status}`, color: 'yellow' };
139
- }
133
+ // Status - from Rithmic RMS API (field 154003), N/A if not available
134
+ const getStatusDisplay = (acc) => {
135
+ const status = acc.status;
136
+ if (status === null || status === undefined) return { text: 'N/A', color: 'gray' };
140
137
  if (typeof status === 'string') {
141
138
  const lowerStatus = status.toLowerCase();
142
139
  if (lowerStatus.includes('active') || lowerStatus.includes('open')) return { text: status, color: 'green' };
@@ -144,32 +141,28 @@ const showAccounts = async (service) => {
144
141
  if (lowerStatus.includes('halt')) return { text: status, color: 'red' };
145
142
  return { text: status, color: 'yellow' };
146
143
  }
147
- return { text: '--', color: 'gray' };
144
+ return { text: String(status), color: 'yellow' };
148
145
  };
149
- const status1 = getStatusDisplay(acc1.status);
150
- const status2 = acc2 ? getStatusDisplay(acc2.status) : null;
146
+ const status1 = getStatusDisplay(acc1);
147
+ const status2 = acc2 ? getStatusDisplay(acc2) : null;
151
148
  console.log(chalk.cyan('║') + fmtRow('Status:', chalk[status1.color](status1.text), col1) + chalk.cyan(sep) + (acc2 ? fmtRow('Status:', chalk[status2.color](status2.text), col2) : ' '.repeat(col2)) + chalk.cyan('║'));
152
149
 
153
- // Type - from accountType or algorithm field
154
- const getTypeDisplay = (acc) => {
155
- const value = acc.algorithm || acc.accountType || acc.type;
156
- if (value === null || value === undefined) return { text: 'Live', color: 'green' }; // Default for Rithmic
157
- if (typeof value === 'string') {
158
- const lowerValue = value.toLowerCase();
159
- if (lowerValue.includes('eval')) return { text: value, color: 'yellow' };
160
- if (lowerValue.includes('live') || lowerValue.includes('funded')) return { text: value, color: 'green' };
161
- if (lowerValue.includes('sim') || lowerValue.includes('demo')) return { text: value, color: 'gray' };
162
- if (lowerValue.includes('express')) return { text: value, color: 'magenta' };
163
- return { text: value, color: 'cyan' };
164
- }
165
- if (typeof value === 'number') {
166
- return ACCOUNT_TYPE[value] || { text: `Type ${value}`, color: 'white' };
150
+ // Algorithm - from Rithmic RMS API (field 150142), N/A if not available
151
+ const getAlgorithmDisplay = (acc) => {
152
+ const algo = acc.algorithm;
153
+ if (algo === null || algo === undefined) return { text: 'N/A', color: 'gray' };
154
+ if (typeof algo === 'string') {
155
+ const lowerAlgo = algo.toLowerCase();
156
+ if (lowerAlgo.includes('eval')) return { text: algo, color: 'yellow' };
157
+ if (lowerAlgo.includes('live') || lowerAlgo.includes('funded')) return { text: algo, color: 'green' };
158
+ if (lowerAlgo.includes('sim') || lowerAlgo.includes('demo')) return { text: algo, color: 'gray' };
159
+ return { text: algo, color: 'cyan' };
167
160
  }
168
- return { text: 'Live', color: 'green' };
161
+ return { text: String(algo), color: 'cyan' };
169
162
  };
170
- const type1 = getTypeDisplay(acc1);
171
- const type2 = acc2 ? getTypeDisplay(acc2) : null;
172
- console.log(chalk.cyan('║') + fmtRow('Type:', chalk[type1.color](type1.text), col1) + chalk.cyan(sep) + (acc2 ? fmtRow('Type:', chalk[type2.color](type2.text), col2) : ' '.repeat(col2)) + chalk.cyan('║'));
163
+ const algo1 = getAlgorithmDisplay(acc1);
164
+ const algo2 = acc2 ? getAlgorithmDisplay(acc2) : null;
165
+ console.log(chalk.cyan('║') + fmtRow('Algorithm:', chalk[algo1.color](algo1.text), col1) + chalk.cyan(sep) + (acc2 ? fmtRow('Algorithm:', chalk[algo2.color](algo2.text), col2) : ' '.repeat(col2)) + chalk.cyan('║'));
173
166
 
174
167
  if (i + 2 < allAccounts.length) {
175
168
  console.log(chalk.cyan('╠') + chalk.cyan('═'.repeat(col1)) + chalk.cyan('╪') + chalk.cyan('═'.repeat(col2)) + chalk.cyan('╣'));
@@ -245,18 +245,16 @@ const getTradingAccounts = async (service) => {
245
245
  profitAndLoss: profitAndLoss,
246
246
  openPnL: openPnL,
247
247
  todayPnL: closedPnL,
248
- // Status/Type: Rithmic API doesn't provide user-friendly values
249
- // "admin only" and "Max Loss" are RMS internal values, not account status
250
- // Set to null to show "--" in UI (per RULES.md - no fake data)
251
- status: null,
252
- type: null,
253
- // Keep RMS data for reference
254
- rmsStatus: rmsInfo.status || null,
255
- rmsAlgorithm: rmsInfo.algorithm || null,
248
+ // Status from Rithmic RMS API (field 154003 - ACCOUNT_STATUS)
249
+ status: rmsInfo.status || null,
250
+ // Algorithm/Type from Rithmic RMS API (field 150142 - ALGORITHM)
251
+ algorithm: rmsInfo.algorithm || null,
252
+ // Additional RMS data from API
256
253
  lossLimit: rmsInfo.lossLimit || null,
257
254
  minAccountBalance: rmsInfo.minAccountBalance || null,
258
255
  buyLimit: rmsInfo.buyLimit || null,
259
256
  sellLimit: rmsInfo.sellLimit || null,
257
+ currency: rmsInfo.currency || acc.accountCurrency || null,
260
258
  platform: 'Rithmic',
261
259
  propfirm: service.propfirm.name,
262
260
  };