═══════════════════════════════════════════════════════════════════ VPS DEPLOYMENT — DUAL MODEL (EURUSD + USDJPY) VPS: 193.38.138.152 Path: C:\Users\Administrator\OneDrive\fx_macro_intraday\ ═══════════════════════════════════════════════════════════════════ RUN THESE IN ORDER — PowerShell as Administrator on the VPS ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ STEP 1 — SAVE NEW FILES FIRST (on home PC via OneDrive) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Save these downloaded files to the following OneDrive paths: fetch_jp2y_robust.py → src\ingestion\fetch_jp2y_robust.py live_signal_monitor_v2.py → src\execution\live_signal_monitor_v2.py dashboard_v3.html → dashboard.html (OVERWRITE existing) Wait for OneDrive to sync before continuing (check sync icon). ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ STEP 2 — NAVIGATE TO PROJECT ROOT ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ cd C:\Users\Administrator\OneDrive\fx_macro_intraday ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ STEP 3 — CONFIRM NEW FILES ARRIVED ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Test-Path src\ingestion\fetch_jp2y_robust.py Test-Path src\execution\live_signal_monitor_v2.py Test-Path dashboard.html All three should print True. If any print False, OneDrive hasn't synced yet — wait and retry. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ STEP 4 — STOP THE OLD MONITOR ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ # Disable the old Task Scheduler job so it doesn't restart schtasks /Change /TN "FX_Signal_Monitor" /DISABLE # Kill any running python process (the old monitor) # Note: this also stops MT5 Python API briefly — it reconnects automatically taskkill /F /IM python.exe # Confirm nothing is running Get-Process python -ErrorAction SilentlyContinue ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ STEP 5 — MIGRATE TRADE HISTORY ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ # Rename existing EURUSD trade log so v2 monitor picks it up correctly # (v2 looks for trade_history_eurusd.json not trade_history.json) $logDir = "data\logs" if (Test-Path "$logDir\trade_history.json") { Copy-Item "$logDir\trade_history.json" "$logDir\trade_history_eurusd.json" Write-Host "Migrated: trade_history.json -> trade_history_eurusd.json" -ForegroundColor Green } else { Write-Host "No existing trade_history.json found - starting fresh" -ForegroundColor Yellow } # Confirm Get-ChildItem data\logs\trade_history*.json ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ STEP 6 — INITIAL JP2Y FETCH (one-time setup) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ python src\ingestion\fetch_jp2y_robust.py Expected output: JP2Y saved: 5,690 rows | 2003-01-06 → [today] | range: [-0.372%, 1.393%] If it fails with SSL error, that's handled automatically — it will retry 3 times with backoff. If all 3 fail, check internet connectivity. Confirm the file exists: Test-Path data\raw\rates\jp2y.csv ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ STEP 7 — TEST NEW MONITOR (30 second smoke test) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ # Run briefly to confirm it starts, connects to MT5, and computes # both z-scores without errors. Ctrl+C after ~30 seconds. python src\execution\live_signal_monitor_v2.py Look for these lines in the output: ✅ "MT5 connected | terminal=..." ✅ "[EURUSD] Z-score: X.XXXX (threshold ±2.75)" ✅ "[USDJPY] Z-score: X.XXXX (threshold ±2.00)" ✅ Telegram message: "DUAL MODEL MONITOR STARTED" If you see errors, check STEP 8 for common fixes. Press Ctrl+C once you see both z-scores appear. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ STEP 8 — COMMON ERRORS AND FIXES ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ERROR: ModuleNotFoundError: No module named 'ingestion.fetch_jp2y_robust' FIX: The file is not in src\ingestion\ — check OneDrive sync Also confirm __init__.py exists in src\ingestion\: Test-Path src\ingestion\__init__.py ERROR: MT5 init failed FIX: Open MT5 manually first, log into the demo account, then re-run the monitor ERROR: [USDJPY] zscore error: jp2y.csv not found FIX: Run step 6 again: python src\ingestion\fetch_jp2y_robust.py ERROR: Rate update failed: cannot import name 'BUNDESBANK_DE2Y_CSV' FIX: auto_rates_loader.py may be an older version The monitor falls back gracefully — not a blocker ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ STEP 9 — UPDATE TASK SCHEDULER (run v2 on startup) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ # Update the scheduled task to point to v2 instead of v1 schtasks /Change /TN "FX_Signal_Monitor" /TR "C:\Python313\python.exe C:\Users\Administrator\OneDrive\fx_macro_intraday\src\execution\live_signal_monitor_v2.py" /ENABLE # Confirm the task is now pointing to v2 schtasks /Query /TN "FX_Signal_Monitor" /FO LIST # Should show: # Task To Run: ...live_signal_monitor_v2.py # Status: Ready # If the task name is different on your VPS, list all tasks first: # schtasks /Query /FO LIST | findstr /i "fx\|signal\|monitor\|python" ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ STEP 10 — START THE NEW MONITOR ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ # Start directly (runs in background, auto-restarts on reboot via Task Scheduler) Start-Process python -ArgumentList "src\execution\live_signal_monitor_v2.py" -WorkingDirectory (Get-Location).Path -WindowStyle Hidden # Confirm it started Start-Sleep -Seconds 5 Get-Process python # Check the log to confirm both pairs initialised Start-Sleep -Seconds 10 Get-Content data\logs\live_monitor_v2.log -Tail 20 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ STEP 11 — VERIFY DASHBOARD ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ # Open the dashboard in your browser Start-Process "http://193.38.138.152:8765/dashboard.html" You should see: ✅ "BENNETT'S EURUSD + USDJPY DUAL MACRO MODEL" in the header ✅ Two z-score panels side by side (EU green / UJ teal) ✅ Combined portfolio equity chart ✅ JP2Y yield chart populated ✅ Dual signal outlook (EU + UJ events) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ STEP 12 — FINAL HEALTH CHECK ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ # Tail the live log — both pairs should appear every hour at :01 Get-Content data\logs\live_monitor_v2.log -Wait -Tail 30 # At :01 each hour you should see: # [EURUSD] ── Signal check ── # [EURUSD] Z-score: X.XXXX (threshold ±2.75) # [USDJPY] ── Signal check ── # [USDJPY] Z-score: X.XXXX (threshold ±2.00) # Ctrl+C to stop watching the log ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ROLLBACK (if anything goes wrong) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ taskkill /F /IM python.exe schtasks /Change /TN "FX_Signal_Monitor" /TR "C:\Python313\python.exe C:\Users\Administrator\OneDrive\fx_macro_intraday\src\execution\live_signal_monitor.py" /ENABLE Start-Process python -ArgumentList "src\execution\live_signal_monitor.py" -WorkingDirectory (Get-Location).Path -WindowStyle Hidden The old monitor and dashboard_v2.html are untouched — rollback is instant. ═══════════════════════════════════════════════════════════════════