Files
gavindiazandClaude Code 3a005ddcc6
Docs / Validate documentation (push) Canceled after 0s
Docs / Deploy GitHub Pages (push) Canceled after 0s
CI Final Summary (AI) / AI Final Summary (push) Canceled after 0s
CI Final Summary (AI) / Push/PR event feed (push) Canceled after 0s
CI / CI Integrity and Change Classification (push) Canceled after 0s
CI / Code Quality & Tests (push) Canceled after 0s
Dependency Lock & Migration Safety / Dependency drift (lock vs pyproject) (push) Canceled after 0s
Dependency Lock & Migration Safety / Migration safety (fail-loud + version postconditions) (push) Canceled after 0s
JS Tests / Frontend JS Unit Tests (push) Canceled after 0s
Security / CodeQL Analysis (push) Canceled after 0s
Security / Trivy Vulnerability Scan (push) Canceled after 0s
Tests (OS Matrix) / Py Tests (macos-latest) (push) Canceled after 0s
Tests (OS Matrix) / Py Tests (windows-latest) (push) Canceled after 0s
CI / Extended Validation (Tier 2) (push) Canceled after 0s
CI / Heavy CI (database-provider) (push) Canceled after 0s
CI / Heavy CI (e2e) (push) Canceled after 0s
CI / Heavy CI (integration) (push) Canceled after 0s
CI / Heavy CI (model-validation) (push) Canceled after 0s
CI / Heavy CI (research-backtest) (push) Canceled after 0s
CI / Aggregate CI Results (push) Canceled after 0s
chore(repo): initial import of Nexus Trading Forex Bot into self-hosted hosting
Full project import for the self-hosted code hosting
(https://code.aifunny.ltd/gavindiaz/my-NexusTradingForexBot.git).

Includes the live-freshness + scaler-hash fixes for the permanent
STALE dashboard (tick_pipeline now_utc stamps; infer_probabilities
computes model_input_hash on the actual scaled 70D tensor), the
data-fetch default-path fix, the g29 web-auth test fixes, and a
Chinese user manual (使用手册.md) for the web dashboard.

Scratch diagnostic scripts (check*.py, contain a live web-auth token)
and the .kilo/ agent-worktree directory are gitignored, not committed.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-23 23:24:54 +08:00

2.9 KiB

title, description, lang
title description lang
First-Run Safety The Demo → Shadow → Live progression, account-identity fail-safe, and the safety invariants that bound the engine. en

First-Run Safety (Demo → Shadow → Live)

This engine executes on a real broker. The repository's own first-run guidance is a strict ladder — do not skip steps.

Step Action Why
1️⃣ Log into a DEMO account in MT5 (File → Open an Account → Practice/Demo), confirm the account number/label before touching the bot LIVE and demo accounts can look identical in MT5's login window
2️⃣ MT5: Tools → Options → Expert Advisors → tick "Allow Algo Trading" Without this, orders are rejected
3️⃣ Copy configs/live.yaml → configs/demo.yaml; set demo credentials; confirm risk.max_concurrent_positions: 1, risk.risk_per_trade_pct (e.g. 0.5), risk.max_account_drawdown_pct Never touch a live config while real money can be reached
4️⃣ Run SHADOW first (nexus start --mode shadow) for days; review the dashboard + Telegram reports Proves model, signals and gates before any execution
5️⃣ Run the test suite weekly (pytest tests/unit tests/integration) Catches regressions before they reach a live account
6️⃣ Only then consider LIVE with a small balance you can afford to lose, risk_per_trade_pct: 0.25 or lower Leveraged XAUUSD scalping carries extreme risk

Account-identity fail-safe

The live adapter refuses to connect to a terminal logged into a different account than configured (BUG-142): the account-identity check is enforced at connect time, not by convention.

Safety invariants (engine-enforced)

  • nexus start never defaults to LIVE — PAPER is the default; LIVE requires an explicit interactive confirmation after printing the full risk panel.
  • Shadow runs carry simulated=True and hold zero order authority: no order can be placed, modified or closed.
  • Research/strategy/news workers never hold order authority or a risk handle.
  • Risk engine (RiskEngine) is authoritative for sizing boundaries: margin clamps (≤ 20% free margin), tier caps, single-position exposure cap, HARD_MAX_LOTS = 10.0, MAX_TOTAL_EXPOSURE = 1.
  • Circuit breaker → SAFE_MODE after repeated rejections; order-churn throttle; kill switch via dashboard/CLI.
  • Pre-flight doctor gates every launch: missing MT5 terminal, invalid config or unsupported platform ⇒ the engine refuses to start.
  • Model promotion is strictly operator-gated; candidates never promote themselves; shadow never mutates execution.

Also read