hedgequantx 1.8.42 → 1.8.44
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 +1 -1
- package/src/pages/accounts.js +4 -4
- package/src/pages/stats.js +7 -0
package/package.json
CHANGED
package/src/pages/accounts.js
CHANGED
|
@@ -60,10 +60,10 @@ const showAccounts = async (service) => {
|
|
|
60
60
|
const acc1 = allAccounts[i];
|
|
61
61
|
const acc2 = allAccounts[i + 1];
|
|
62
62
|
|
|
63
|
-
const name1 = acc1.accountId || `Account #${acc1.accountId}
|
|
64
|
-
const name2 = acc2 ? (acc2.accountId || `Account #${acc2.accountId}`) : '';
|
|
63
|
+
const name1 = String(acc1.accountId || `Account #${acc1.accountId}`);
|
|
64
|
+
const name2 = acc2 ? String(acc2.accountId || `Account #${acc2.accountId}`) : '';
|
|
65
65
|
|
|
66
|
-
draw2ColHeader(name1.substring(0, col1 - 4), name2.substring(0, col2 - 4), boxWidth);
|
|
66
|
+
draw2ColHeader(name1.substring(0, col1 - 4), name2 ? name2.substring(0, col2 - 4) : '', boxWidth);
|
|
67
67
|
|
|
68
68
|
// PropFirm
|
|
69
69
|
const pf1 = chalk.magenta(acc1.propfirm || 'Unknown');
|
|
@@ -90,7 +90,7 @@ const showAccounts = async (service) => {
|
|
|
90
90
|
console.log(chalk.cyan('║') + fmtRow('Type:', chalk[type1.color](type1.text), col1) + chalk.cyan('│') + (acc2 ? fmtRow('Type:', chalk[type2.color](type2.text), col2) : ' '.repeat(col2)) + chalk.cyan('║'));
|
|
91
91
|
|
|
92
92
|
// ID
|
|
93
|
-
console.log(chalk.cyan('║') + fmtRow('ID:', chalk.gray(acc1.accountId), col1) + chalk.cyan('│') + (acc2 ? fmtRow('ID:', chalk.gray(acc2.accountId), col2) : ' '.repeat(col2)) + chalk.cyan('║'));
|
|
93
|
+
console.log(chalk.cyan('║') + fmtRow('ID:', chalk.gray(String(acc1.accountId)), col1) + chalk.cyan('│') + (acc2 ? fmtRow('ID:', chalk.gray(String(acc2.accountId)), col2) : ' '.repeat(col2)) + chalk.cyan('║'));
|
|
94
94
|
|
|
95
95
|
if (i + 2 < allAccounts.length) {
|
|
96
96
|
console.log(chalk.cyan('╠') + chalk.cyan('═'.repeat(col1)) + chalk.cyan('╪') + chalk.cyan('═'.repeat(col2)) + chalk.cyan('╣'));
|
package/src/pages/stats.js
CHANGED
|
@@ -68,6 +68,7 @@ const showStats = async (service) => {
|
|
|
68
68
|
// Collect REAL stats only - no estimation
|
|
69
69
|
let totalBalance = null;
|
|
70
70
|
let totalPnL = null;
|
|
71
|
+
let totalStartingBalance = 0;
|
|
71
72
|
let allTrades = [];
|
|
72
73
|
let totalOpenPositions = 0;
|
|
73
74
|
let totalOpenOrders = 0;
|
|
@@ -88,6 +89,12 @@ const showStats = async (service) => {
|
|
|
88
89
|
totalPnL = (totalPnL || 0) + account.profitAndLoss;
|
|
89
90
|
}
|
|
90
91
|
|
|
92
|
+
// Calculate starting balance (balance - pnl)
|
|
93
|
+
if (account.balance !== null && account.balance !== undefined) {
|
|
94
|
+
const pnl = account.profitAndLoss || 0;
|
|
95
|
+
totalStartingBalance += (account.balance - pnl);
|
|
96
|
+
}
|
|
97
|
+
|
|
91
98
|
// Positions & Orders
|
|
92
99
|
const posResult = await svc.getPositions(account.accountId);
|
|
93
100
|
if (posResult.success) totalOpenPositions += posResult.positions.length;
|