hedgequantx 2.6.52 → 2.6.53
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/algo/one-account.js +14 -18
package/package.json
CHANGED
|
@@ -724,7 +724,7 @@ const launchAlgo = async (service, account, contract, config) => {
|
|
|
724
724
|
|
|
725
725
|
stats.latency = Date.now() - latencyStart;
|
|
726
726
|
|
|
727
|
-
// Smart logs every
|
|
727
|
+
// Smart logs - only on STATE CHANGES (not every second when in position)
|
|
728
728
|
const now = Date.now();
|
|
729
729
|
if (now - lastHeartbeat > 1000) {
|
|
730
730
|
const modelValues = strategy.getModelValues?.() || strategy.getModelValues?.(contractId) || null;
|
|
@@ -735,32 +735,28 @@ const launchAlgo = async (service, account, contract, config) => {
|
|
|
735
735
|
const zscore = modelValues.zscore || 0;
|
|
736
736
|
const mom = modelValues.momentum || 0;
|
|
737
737
|
|
|
738
|
-
// Get smart varied log based on market state
|
|
739
|
-
const smartLogs = require('./smart-logs');
|
|
740
|
-
const stateLog = smartLogs.getMarketStateLog(ofi, zscore, mom, delta);
|
|
741
|
-
|
|
742
738
|
// Use stats.position from Rithmic API (real-time WebSocket)
|
|
743
739
|
const positionQty = stats.position || 0;
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
const
|
|
748
|
-
const
|
|
749
|
-
const posLog = smartLogs.getPositionUpdateLog(side, Math.abs(positionQty), unrealizedPnl, stats.entryPrice, tickData.price, holdTime);
|
|
750
|
-
ui.addLog('trade', `${posLog.message} - ${posLog.details}`);
|
|
751
|
-
} else {
|
|
752
|
-
// Not in position - show market state with varied messages
|
|
740
|
+
|
|
741
|
+
if (positionQty === 0) {
|
|
742
|
+
// Not in position - show market analysis (varied messages)
|
|
743
|
+
const smartLogs = require('./smart-logs');
|
|
744
|
+
const stateLog = smartLogs.getMarketStateLog(ofi, zscore, mom, delta);
|
|
753
745
|
if (stateLog.details) {
|
|
754
746
|
ui.addLog('analysis', `${stateLog.message} - ${stateLog.details}`);
|
|
755
747
|
} else {
|
|
756
748
|
ui.addLog('info', stateLog.message);
|
|
757
749
|
}
|
|
758
750
|
}
|
|
751
|
+
// When IN POSITION: Don't spam logs every second
|
|
752
|
+
// Position updates come from order fills and exit events
|
|
759
753
|
} else {
|
|
760
|
-
// Waiting for data
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
754
|
+
// Waiting for data - log every 5 seconds only
|
|
755
|
+
if (now - lastHeartbeat > 5000) {
|
|
756
|
+
const smartLogs = require('./smart-logs');
|
|
757
|
+
const scanLog = smartLogs.getScanningLog(true);
|
|
758
|
+
ui.addLog('info', `${scanLog.message} ${tps} ticks/s`);
|
|
759
|
+
}
|
|
764
760
|
}
|
|
765
761
|
lastHeartbeat = now;
|
|
766
762
|
tps = 0;
|