hedgequantx 2.6.136 → 2.6.137
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
|
@@ -1431,6 +1431,9 @@ const launchMultiSymbolRithmic = async (service, account, contracts, config) =>
|
|
|
1431
1431
|
// Calculate total qty across all symbols
|
|
1432
1432
|
const totalQty = contracts.reduce((sum, c) => sum + (c.qty || 1), 0);
|
|
1433
1433
|
|
|
1434
|
+
// Baseline P&L captured at session start (to show only THIS session's P&L)
|
|
1435
|
+
let baselineClosedPnl = null; // Will be set on first pnlUpdate
|
|
1436
|
+
|
|
1434
1437
|
// Shared stats (same structure as launchAlgo)
|
|
1435
1438
|
const stats = {
|
|
1436
1439
|
accountName,
|
|
@@ -1441,8 +1444,8 @@ const launchMultiSymbolRithmic = async (service, account, contracts, config) =>
|
|
|
1441
1444
|
propfirm: account.propfirm || 'Unknown',
|
|
1442
1445
|
platform: 'RITHMIC',
|
|
1443
1446
|
pnl: null,
|
|
1444
|
-
openPnl:
|
|
1445
|
-
closedPnl:
|
|
1447
|
+
openPnl: 0, // Start at 0 for session
|
|
1448
|
+
closedPnl: 0, // Start at 0 for session (will show delta from baseline)
|
|
1446
1449
|
balance: null,
|
|
1447
1450
|
buyingPower: null,
|
|
1448
1451
|
margin: null,
|
|
@@ -1874,7 +1877,16 @@ const launchMultiSymbolRithmic = async (service, account, contracts, config) =>
|
|
|
1874
1877
|
if (pnlData.accountId !== rithmicAccountId) return;
|
|
1875
1878
|
|
|
1876
1879
|
if (pnlData.closedPositionPnl !== undefined) {
|
|
1877
|
-
|
|
1880
|
+
const accountClosedPnl = parseFloat(pnlData.closedPositionPnl);
|
|
1881
|
+
|
|
1882
|
+
// Capture baseline on first update (P&L at session start)
|
|
1883
|
+
if (baselineClosedPnl === null) {
|
|
1884
|
+
baselineClosedPnl = accountClosedPnl;
|
|
1885
|
+
algoLogger.info(ui, 'SESSION START', `Baseline P&L: $${baselineClosedPnl.toFixed(2)}`);
|
|
1886
|
+
}
|
|
1887
|
+
|
|
1888
|
+
// stats.closedPnl shows ONLY this session's closed P&L (delta from baseline)
|
|
1889
|
+
stats.closedPnl = accountClosedPnl - baselineClosedPnl;
|
|
1878
1890
|
}
|
|
1879
1891
|
if (pnlData.accountBalance !== undefined) {
|
|
1880
1892
|
stats.balance = parseFloat(pnlData.accountBalance);
|