hedgequantx 2.9.89 → 2.9.90
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/algo-executor.js +14 -12
package/package.json
CHANGED
|
@@ -411,19 +411,21 @@ const executeAlgo = async ({ service, account, contract, config, strategy: strat
|
|
|
411
411
|
await marketFeed.connect(rithmicCredentials);
|
|
412
412
|
await marketFeed.subscribe(symbolCode, contract.exchange || 'CME');
|
|
413
413
|
|
|
414
|
-
// Preload historical bars for
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
414
|
+
// Preload historical bars for HQX-2B strategy only (bar-based strategy)
|
|
415
|
+
if (strategyId === 'hqx-2b' && strategy.preloadBars) {
|
|
416
|
+
ui.addLog('system', 'Loading historical bars...');
|
|
417
|
+
try {
|
|
418
|
+
const historicalBars = await marketFeed.getHistoricalBars(symbolCode, contract.exchange || 'CME', 30);
|
|
419
|
+
if (historicalBars && historicalBars.length > 0) {
|
|
420
|
+
strategy.preloadBars(contractId, historicalBars);
|
|
421
|
+
ui.addLog('system', `Loaded ${historicalBars.length} bars - strategy ready!`);
|
|
422
|
+
} else {
|
|
423
|
+
ui.addLog('system', 'No historical bars - collecting live data...');
|
|
424
|
+
}
|
|
425
|
+
} catch (histErr) {
|
|
426
|
+
ui.addLog('debug', `Historical data unavailable: ${histErr.message}`);
|
|
427
|
+
ui.addLog('system', 'Collecting live data...');
|
|
423
428
|
}
|
|
424
|
-
} catch (histErr) {
|
|
425
|
-
ui.addLog('debug', `Historical data unavailable: ${histErr.message}`);
|
|
426
|
-
ui.addLog('system', 'Collecting live data...');
|
|
427
429
|
}
|
|
428
430
|
} catch (e) {
|
|
429
431
|
ui.addLog('error', `Failed to connect: ${e.message}`);
|