hedgequantx 2.9.89 → 2.9.91
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/dist/lib/m/hqx-2b.js +2 -2
- package/package.json +1 -1
- package/src/pages/algo/algo-executor.js +15 -12
package/dist/lib/m/hqx-2b.js
CHANGED
|
@@ -687,8 +687,8 @@ var require_core = __commonJS({
|
|
|
687
687
|
const bars = this.barHistory.get(contractId) || [];
|
|
688
688
|
const zones = this.liquidityZones.get(contractId) || [];
|
|
689
689
|
const swings = this.swingPoints.get(contractId) || [];
|
|
690
|
-
if (bars.length <
|
|
691
|
-
return { ready: false, message: `Collecting data... ${bars.length}/
|
|
690
|
+
if (bars.length < 5) {
|
|
691
|
+
return { ready: false, message: `Collecting data... ${bars.length}/5 bars` };
|
|
692
692
|
}
|
|
693
693
|
const sortedZones = zones.map((z) => ({ zone: z, distance: Math.abs(currentPrice - z.getLevel()) })).sort((a, b) => a.distance - b.distance);
|
|
694
694
|
const nearestResistance = sortedZones.find((z) => z.zone.type === ZoneType2.RESISTANCE);
|
package/package.json
CHANGED
|
@@ -411,19 +411,22 @@ 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
|
+
// Note: HISTORY_PLANT may not be available on all accounts (e.g., paper trading)
|
|
416
|
+
if (strategyId === 'hqx-2b' && strategy.preloadBars) {
|
|
417
|
+
try {
|
|
418
|
+
ui.addLog('system', 'Loading historical bars...');
|
|
419
|
+
const historicalBars = await marketFeed.getHistoricalBars(symbolCode, contract.exchange || 'CME', 30);
|
|
420
|
+
if (historicalBars && historicalBars.length > 0) {
|
|
421
|
+
strategy.preloadBars(contractId, historicalBars);
|
|
422
|
+
ui.addLog('system', `Loaded ${historicalBars.length} bars - ready!`);
|
|
423
|
+
} else {
|
|
424
|
+
ui.addLog('system', 'No historical data - warming up with live bars...');
|
|
425
|
+
}
|
|
426
|
+
} catch (histErr) {
|
|
427
|
+
// HISTORY_PLANT not available (common on paper accounts)
|
|
428
|
+
ui.addLog('system', 'Historical data not available - warming up with live bars...');
|
|
423
429
|
}
|
|
424
|
-
} catch (histErr) {
|
|
425
|
-
ui.addLog('debug', `Historical data unavailable: ${histErr.message}`);
|
|
426
|
-
ui.addLog('system', 'Collecting live data...');
|
|
427
430
|
}
|
|
428
431
|
} catch (e) {
|
|
429
432
|
ui.addLog('error', `Failed to connect: ${e.message}`);
|