initial: import DOLPHIN baseline 2026-04-21 from dolphinng5_predict working tree
Includes core prod + GREEN/BLUE subsystems: - prod/ (BLUE harness, configs, scripts, docs) - nautilus_dolphin/ (GREEN Nautilus-native impl + dvae/ preserved) - adaptive_exit/ (AEM engine + models/bucket_assignments.pkl) - Observability/ (EsoF advisor, TUI, dashboards) - external_factors/ (EsoF producer) - mc_forewarning_qlabs_fork/ (MC regime/envelope) Excludes runtime caches, logs, backups, and reproducible artifacts per .gitignore.
This commit is contained in:
51
nautilus_dolphin/patch_nautilus_bug.py
Executable file
51
nautilus_dolphin/patch_nautilus_bug.py
Executable file
@@ -0,0 +1,51 @@
|
||||
"""
|
||||
Patch Nautilus 1.219.0 Bug
|
||||
==========================
|
||||
|
||||
Fixes the Strategy.__init__ bug where Logger expects str but gets StrategyId.
|
||||
|
||||
Usage:
|
||||
python patch_nautilus_bug.py
|
||||
# Then run your backtest
|
||||
"""
|
||||
|
||||
import sys
|
||||
import nautilus_trader
|
||||
from pathlib import Path
|
||||
|
||||
# Find Nautilus installation
|
||||
nautilus_path = Path(nautilus_trader.__file__).parent
|
||||
strategy_pxd = nautilus_path / "trading" / "strategy.pyx"
|
||||
strategy_py = nautilus_path / "trading" / "strategy.py"
|
||||
|
||||
print("Nautilus Trader Bug Patch")
|
||||
print("=" * 50)
|
||||
print(f"Nautilus path: {nautilus_path}")
|
||||
|
||||
# Check if we can find the source
|
||||
if strategy_pxd.exists():
|
||||
print(f"Found: {strategy_pxd}")
|
||||
# This is a Cython file - would need recompilation
|
||||
print("Note: strategy.pyx is a Cython file - requires recompilation after patching")
|
||||
elif strategy_py.exists():
|
||||
print(f"Found: {strategy_py}")
|
||||
# This is a Python file - can patch directly
|
||||
with open(strategy_py, 'r') as f:
|
||||
content = f.read()
|
||||
|
||||
if 'Logger(name=component_id)' in content:
|
||||
print("Patching strategy.py...")
|
||||
content = content.replace(
|
||||
'Logger(name=component_id)',
|
||||
'Logger(name=str(component_id))'
|
||||
)
|
||||
with open(strategy_py, 'w') as f:
|
||||
f.write(content)
|
||||
print("✅ Patched successfully!")
|
||||
else:
|
||||
print("ℹ️ Already patched or different version")
|
||||
else:
|
||||
print("⚠️ Could not find strategy source files")
|
||||
|
||||
print("\nAlternative: Use the workaround in DolphinExecutionStrategy")
|
||||
print("The strategy already has a try/except workaround for this bug.")
|
||||
Reference in New Issue
Block a user