hedgequantx 2.3.7 → 2.3.9
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/dist/lib/api.jsc +0 -0
- package/dist/lib/api2.jsc +0 -0
- package/dist/lib/core.jsc +0 -0
- package/dist/lib/core2.jsc +0 -0
- package/dist/lib/data.jsc +0 -0
- package/dist/lib/data2.jsc +0 -0
- package/dist/lib/decoder.jsc +0 -0
- package/dist/lib/m/mod1.jsc +0 -0
- package/dist/lib/m/mod2.jsc +0 -0
- package/dist/lib/n/r1.jsc +0 -0
- package/dist/lib/n/r2.jsc +0 -0
- package/dist/lib/n/r3.jsc +0 -0
- package/dist/lib/n/r4.jsc +0 -0
- package/dist/lib/n/r5.jsc +0 -0
- package/dist/lib/n/r6.jsc +0 -0
- package/dist/lib/n/r7.jsc +0 -0
- package/dist/lib/o/util1.jsc +0 -0
- package/dist/lib/o/util2.jsc +0 -0
- package/package.json +1 -1
- package/src/pages/accounts.js +2 -2
- package/src/pages/algo/copy-trading.js +1 -1
- package/src/pages/algo/one-account.js +2 -1
- package/src/pages/orders.js +2 -2
- package/src/pages/positions.js +2 -2
- package/src/pages/stats.js +29 -10
package/dist/lib/api.jsc
CHANGED
|
Binary file
|
package/dist/lib/api2.jsc
CHANGED
|
Binary file
|
package/dist/lib/core.jsc
CHANGED
|
Binary file
|
package/dist/lib/core2.jsc
CHANGED
|
Binary file
|
package/dist/lib/data.jsc
CHANGED
|
Binary file
|
package/dist/lib/data2.jsc
CHANGED
|
Binary file
|
package/dist/lib/decoder.jsc
CHANGED
|
Binary file
|
package/dist/lib/m/mod1.jsc
CHANGED
|
Binary file
|
package/dist/lib/m/mod2.jsc
CHANGED
|
Binary file
|
package/dist/lib/n/r1.jsc
CHANGED
|
Binary file
|
package/dist/lib/n/r2.jsc
CHANGED
|
Binary file
|
package/dist/lib/n/r3.jsc
CHANGED
|
Binary file
|
package/dist/lib/n/r4.jsc
CHANGED
|
Binary file
|
package/dist/lib/n/r5.jsc
CHANGED
|
Binary file
|
package/dist/lib/n/r6.jsc
CHANGED
|
Binary file
|
package/dist/lib/n/r7.jsc
CHANGED
|
Binary file
|
package/dist/lib/o/util1.jsc
CHANGED
|
Binary file
|
package/dist/lib/o/util2.jsc
CHANGED
|
Binary file
|
package/package.json
CHANGED
package/src/pages/accounts.js
CHANGED
|
@@ -88,8 +88,8 @@ const showAccounts = async (service) => {
|
|
|
88
88
|
const acc1 = allAccounts[i];
|
|
89
89
|
const acc2 = allAccounts[i + 1];
|
|
90
90
|
|
|
91
|
-
const name1 = String(acc1.
|
|
92
|
-
const name2 = acc2 ? String(acc2.
|
|
91
|
+
const name1 = String(acc1.accountName || acc1.rithmicAccountId || acc1.accountId || `Account #${i + 1}`);
|
|
92
|
+
const name2 = acc2 ? String(acc2.accountName || acc2.rithmicAccountId || acc2.accountId || `Account #${i + 2}`) : '';
|
|
93
93
|
|
|
94
94
|
draw2ColHeader(name1.substring(0, col1 - 4), name2 ? name2.substring(0, col2 - 4) : '', boxWidth);
|
|
95
95
|
|
|
@@ -168,7 +168,7 @@ const selectAccount = async (message, accounts, excludeIdx) => {
|
|
|
168
168
|
const acc = x.a.account;
|
|
169
169
|
const balance = acc.balance !== null ? ` ($${acc.balance.toLocaleString()})` : '';
|
|
170
170
|
return {
|
|
171
|
-
label: `${x.a.propfirm} - ${acc.rithmicAccountId || acc.name || acc.accountId}${balance}`,
|
|
171
|
+
label: `${x.a.propfirm} - ${acc.accountName || acc.rithmicAccountId || acc.name || acc.accountId}${balance}`,
|
|
172
172
|
value: x.i,
|
|
173
173
|
};
|
|
174
174
|
});
|
|
@@ -48,8 +48,9 @@ const oneAccountMenu = async (service) => {
|
|
|
48
48
|
spinner.succeed(`Found ${activeAccounts.length} active account(s)`);
|
|
49
49
|
|
|
50
50
|
// Select account
|
|
51
|
+
// Display name priority: accountName (ProjectX) > rithmicAccountId (Rithmic) > name > accountId
|
|
51
52
|
const options = activeAccounts.map(acc => ({
|
|
52
|
-
label: `${acc.rithmicAccountId || acc.name || acc.accountId} (${acc.propfirm || 'Unknown'})${acc.balance !== null ? ` - $${acc.balance.toLocaleString()}` : ''}`,
|
|
53
|
+
label: `${acc.accountName || acc.rithmicAccountId || acc.name || acc.accountId} (${acc.propfirm || 'Unknown'})${acc.balance !== null ? ` - $${acc.balance.toLocaleString()}` : ''}`,
|
|
53
54
|
value: acc
|
|
54
55
|
}));
|
|
55
56
|
options.push({ label: '< Back', value: 'back' });
|
package/src/pages/orders.js
CHANGED
|
@@ -68,7 +68,7 @@ const showOrders = async (service) => {
|
|
|
68
68
|
let allOrders = [];
|
|
69
69
|
|
|
70
70
|
for (const account of allAccounts) {
|
|
71
|
-
const accName = String(account.
|
|
71
|
+
const accName = String(account.accountName || account.rithmicAccountId || account.accountId || 'Unknown').substring(0, 20);
|
|
72
72
|
spinner = ora({ text: `Fetching orders for ${accName}...`, color: 'yellow' }).start();
|
|
73
73
|
|
|
74
74
|
try {
|
|
@@ -77,7 +77,7 @@ const showOrders = async (service) => {
|
|
|
77
77
|
result.orders.forEach(order => {
|
|
78
78
|
allOrders.push({
|
|
79
79
|
...order,
|
|
80
|
-
accountName: account.accountId,
|
|
80
|
+
accountName: account.accountName || account.rithmicAccountId || account.accountId,
|
|
81
81
|
propfirm: account.propfirm
|
|
82
82
|
});
|
|
83
83
|
});
|
package/src/pages/positions.js
CHANGED
|
@@ -68,7 +68,7 @@ const showPositions = async (service) => {
|
|
|
68
68
|
let allPositions = [];
|
|
69
69
|
|
|
70
70
|
for (const account of allAccounts) {
|
|
71
|
-
const accName = String(account.
|
|
71
|
+
const accName = String(account.accountName || account.rithmicAccountId || account.accountId || 'Unknown').substring(0, 20);
|
|
72
72
|
spinner = ora({ text: `Fetching positions for ${accName}...`, color: 'yellow' }).start();
|
|
73
73
|
|
|
74
74
|
try {
|
|
@@ -77,7 +77,7 @@ const showPositions = async (service) => {
|
|
|
77
77
|
result.positions.forEach(pos => {
|
|
78
78
|
allPositions.push({
|
|
79
79
|
...pos,
|
|
80
|
-
accountName: account.accountId,
|
|
80
|
+
accountName: account.accountName || account.rithmicAccountId || account.accountId,
|
|
81
81
|
propfirm: account.propfirm
|
|
82
82
|
});
|
|
83
83
|
});
|
package/src/pages/stats.js
CHANGED
|
@@ -449,8 +449,21 @@ const showStats = async (service) => {
|
|
|
449
449
|
};
|
|
450
450
|
|
|
451
451
|
if (allTrades.length > 0) {
|
|
452
|
-
|
|
453
|
-
|
|
452
|
+
// Calculate column widths to fill the entire row
|
|
453
|
+
// Fixed columns: Time(10), Symbol(12), Price(12), P&L(12), Side(6) = 52 + separators(4*3=12) + padding(2) = 66
|
|
454
|
+
// Remaining space goes to Account column
|
|
455
|
+
const colTime = 10;
|
|
456
|
+
const colSymbol = 12;
|
|
457
|
+
const colPrice = 12;
|
|
458
|
+
const colPnl = 12;
|
|
459
|
+
const colSide = 6;
|
|
460
|
+
const separators = 15; // 5 separators " | " = 5*3
|
|
461
|
+
const fixedWidth = colTime + colSymbol + colPrice + colPnl + colSide + separators;
|
|
462
|
+
const colAccount = Math.max(10, innerWidth - fixedWidth);
|
|
463
|
+
|
|
464
|
+
// Header
|
|
465
|
+
const header = ` ${'Time'.padEnd(colTime)}| ${'Symbol'.padEnd(colSymbol)}| ${'Price'.padEnd(colPrice)}| ${'P&L'.padEnd(colPnl)}| ${'Side'.padEnd(colSide)}| ${'Account'.padEnd(colAccount - 2)}`;
|
|
466
|
+
console.log(chalk.cyan('\u2551') + chalk.white(header) + chalk.cyan('\u2551'));
|
|
454
467
|
console.log(chalk.cyan('\u2551') + chalk.gray('\u2500'.repeat(innerWidth)) + chalk.cyan('\u2551'));
|
|
455
468
|
|
|
456
469
|
const recentTrades = allTrades.slice(-10).reverse();
|
|
@@ -462,22 +475,28 @@ const showStats = async (service) => {
|
|
|
462
475
|
const price = (trade.price || 0).toFixed(2);
|
|
463
476
|
const pnl = trade.profitAndLoss || trade.pnl || 0;
|
|
464
477
|
const pnlText = pnl >= 0 ? `+$${pnl.toFixed(0)}` : `-$${Math.abs(pnl).toFixed(0)}`;
|
|
465
|
-
const pnlColored = pnl >= 0 ? chalk.green(pnlText.padEnd(10)) : chalk.red(pnlText.padEnd(10));
|
|
466
478
|
const side = trade.side === 0 ? 'BUY' : trade.side === 1 ? 'SELL' : 'N/A';
|
|
467
|
-
const
|
|
479
|
+
const accountName = (trade.accountName || 'N/A').substring(0, colAccount - 3);
|
|
468
480
|
|
|
469
|
-
|
|
470
|
-
const
|
|
481
|
+
// Build row with exact widths
|
|
482
|
+
const timeStr = time.padEnd(colTime);
|
|
483
|
+
const symbolStr = symbol.padEnd(colSymbol);
|
|
484
|
+
const priceStr = price.padEnd(colPrice);
|
|
485
|
+
const pnlStr = pnlText.padEnd(colPnl);
|
|
486
|
+
const sideStr = side.padEnd(colSide);
|
|
487
|
+
const accountStr = accountName.padEnd(colAccount - 2);
|
|
471
488
|
|
|
472
|
-
|
|
473
|
-
const
|
|
489
|
+
// Colored versions
|
|
490
|
+
const pnlColored = pnl >= 0 ? chalk.green(pnlStr) : chalk.red(pnlStr);
|
|
491
|
+
const sideColored = trade.side === 0 ? chalk.green(sideStr) : chalk.red(sideStr);
|
|
474
492
|
|
|
475
|
-
|
|
493
|
+
const row = ` ${timeStr}| ${symbolStr}| ${priceStr}| ${pnlColored}| ${sideColored}| ${accountStr}`;
|
|
494
|
+
console.log(chalk.cyan('\u2551') + row + chalk.cyan('\u2551'));
|
|
476
495
|
}
|
|
477
496
|
|
|
478
497
|
if (allTrades.length > 10) {
|
|
479
498
|
const moreMsg = ` ... and ${allTrades.length - 10} more trades`;
|
|
480
|
-
console.log(chalk.cyan('\u2551') +
|
|
499
|
+
console.log(chalk.cyan('\u2551') + moreMsg.padEnd(innerWidth) + chalk.cyan('\u2551'));
|
|
481
500
|
}
|
|
482
501
|
} else {
|
|
483
502
|
const msg = connectionTypes.rithmic > 0
|