hedgequantx 2.6.26 → 2.6.28
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
|
@@ -585,9 +585,20 @@ const launchAlgo = async (service, account, contract, config) => {
|
|
|
585
585
|
|
|
586
586
|
stats.latency = Date.now() - latencyStart;
|
|
587
587
|
|
|
588
|
-
// Heartbeat every 30 seconds
|
|
588
|
+
// Heartbeat every 30 seconds - show strategy model values
|
|
589
589
|
if (Date.now() - lastHeartbeat > 30000) {
|
|
590
|
-
|
|
590
|
+
// Try to get model values from strategy
|
|
591
|
+
const modelValues = strategy.getModelValues?.(contractId) || strategy.getState?.() || null;
|
|
592
|
+
if (modelValues && (modelValues.ofi !== undefined || modelValues.delta !== undefined)) {
|
|
593
|
+
const ofi = (modelValues.ofi || 0).toFixed(1);
|
|
594
|
+
const delta = (modelValues.delta || 0).toFixed(1);
|
|
595
|
+
const zscore = (modelValues.zscore || modelValues.zScore || 0).toFixed(2);
|
|
596
|
+
const momentum = modelValues.momentum ? (modelValues.momentum > 0 ? 'BULL' : 'BEAR') : 'FLAT';
|
|
597
|
+
algoLogger.info(ui, 'M1 STATUS', `OFI=${ofi} Delta=${delta} Z=${zscore} ${momentum} | ${tps} ticks/30s`);
|
|
598
|
+
} else {
|
|
599
|
+
// Show tick count and price to confirm data is flowing
|
|
600
|
+
algoLogger.info(ui, 'SCANNING', `${tps} ticks/30s | ${tickCount} total | price=${tickData.price}`);
|
|
601
|
+
}
|
|
591
602
|
lastHeartbeat = Date.now();
|
|
592
603
|
tps = 0;
|
|
593
604
|
}
|