hedgequantx 2.9.84 → 2.9.86
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
CHANGED
|
@@ -594,6 +594,7 @@ var require_core = __commonJS({
|
|
|
594
594
|
return null;
|
|
595
595
|
}
|
|
596
596
|
const swings = this.swingPoints.get(contractId);
|
|
597
|
+
const prevSwingCount = swings.length;
|
|
597
598
|
const updatedSwings = detectSwings(
|
|
598
599
|
bars,
|
|
599
600
|
currentIndex,
|
|
@@ -602,7 +603,15 @@ var require_core = __commonJS({
|
|
|
602
603
|
this.config.zone.maxZoneAgeBars
|
|
603
604
|
);
|
|
604
605
|
this.swingPoints.set(contractId, updatedSwings);
|
|
606
|
+
if (updatedSwings.length > prevSwingCount) {
|
|
607
|
+
const newSwing = updatedSwings[updatedSwings.length - 1];
|
|
608
|
+
this.emit("log", {
|
|
609
|
+
type: "debug",
|
|
610
|
+
message: `[2B] NEW SWING ${newSwing.type.toUpperCase()} @ ${newSwing.price.toFixed(2)} | Total: ${updatedSwings.length}`
|
|
611
|
+
});
|
|
612
|
+
}
|
|
605
613
|
const zones = this.liquidityZones.get(contractId);
|
|
614
|
+
const prevZoneCount = zones.length;
|
|
606
615
|
const updatedZones = updateZones(
|
|
607
616
|
updatedSwings,
|
|
608
617
|
zones,
|
|
@@ -611,6 +620,13 @@ var require_core = __commonJS({
|
|
|
611
620
|
this.tickSize
|
|
612
621
|
);
|
|
613
622
|
this.liquidityZones.set(contractId, updatedZones);
|
|
623
|
+
if (updatedZones.length > prevZoneCount) {
|
|
624
|
+
const newZone = updatedZones[updatedZones.length - 1];
|
|
625
|
+
this.emit("log", {
|
|
626
|
+
type: "debug",
|
|
627
|
+
message: `[2B] NEW ZONE ${newZone.type.toUpperCase()} @ ${newZone.getLevel().toFixed(2)} | Total: ${updatedZones.length}`
|
|
628
|
+
});
|
|
629
|
+
}
|
|
614
630
|
const sweep = detectSweep(
|
|
615
631
|
updatedZones,
|
|
616
632
|
bars,
|
|
@@ -619,6 +635,12 @@ var require_core = __commonJS({
|
|
|
619
635
|
this.config.zone,
|
|
620
636
|
this.tickSize
|
|
621
637
|
);
|
|
638
|
+
if (sweep) {
|
|
639
|
+
this.emit("log", {
|
|
640
|
+
type: "debug",
|
|
641
|
+
message: `[2B] SWEEP ${sweep.sweepType} | Valid: ${sweep.isValid} | Pen: ${sweep.penetrationTicks.toFixed(1)}t | Q: ${(sweep.qualityScore * 100).toFixed(0)}%`
|
|
642
|
+
});
|
|
643
|
+
}
|
|
622
644
|
if (sweep && sweep.isValid) {
|
|
623
645
|
if (Date.now() - this.lastSignalTime < this.config.execution.cooldownMs) {
|
|
624
646
|
return null;
|
package/package.json
CHANGED
|
@@ -80,6 +80,12 @@ const executeAlgo = async ({ service, account, contract, config, strategy: strat
|
|
|
80
80
|
const strategy = new StrategyClass({ tickSize });
|
|
81
81
|
strategy.initialize(contractId, tickSize);
|
|
82
82
|
|
|
83
|
+
// Handle strategy debug logs
|
|
84
|
+
strategy.on('log', (log) => {
|
|
85
|
+
const type = log.type === 'debug' ? 'debug' : log.type === 'info' ? 'analysis' : 'system';
|
|
86
|
+
ui.addLog(type, log.message);
|
|
87
|
+
});
|
|
88
|
+
|
|
83
89
|
// Initialize Market Data Feed (Rithmic TICKER_PLANT)
|
|
84
90
|
const marketFeed = new MarketDataFeed();
|
|
85
91
|
|