Files
mt5-ai-xauusd-trader/.env.example
T
andonly1348GitHubgoogle-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>andonly1348
876f3a22dd chore: implement strict governance and release integrity guard (#1087)
- Enhanced scripts/atlas_audit.py with 6 mandatory governance gates.
- Added strict PREPROD_CHECKLIST.md validation (version sync, signatures, GO status).
- Implemented Docker security check (non-root USER enforcement).
- Hardened verify_version_sync.py to treat missing CHANGELOG headers as critical.
- Updated all operational runbooks with executable verification commands.
- Synchronized .env.example with missing macro risk configuration.
- Verified release-readiness via package_release.sh and governance vitals suite.

This improvement reduces deployment risk by automating institutional sign-off verification
and ensuring the repository meets all enterprise governance and security standards
before an artifact is generated.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: andonly1348 <279141437+andonly1348@users.noreply.github.com>
2026-05-11 23:53:10 +00:00

108 lines
3.7 KiB
Bash

# MT5 AI/ML Trading Bot - Environment Configuration Template
# This file defines the required environment variables for the application.
# Copy this file to .env and fill in your actual values.
# ── MT5 Connection ──────────────────────────────────────────────────────────
MT5_LOGIN=0
MT5_PASSWORD=your_password_here
MT5_SERVER=your_server_here
MT5_PATH=C:/Program Files/MetaTrader 5/terminal64.exe
# ── MetaAPI (cloud fallback) ─────────────────────────────────────────────────
METAAPI_TOKEN=
METAAPI_ACCOUNT_ID=
# ── Trading parameters ─────────────────────────────────────────────────────
SYMBOL=XAUUSD
TIMEFRAME=M5
MODE=demo
# ── Risk Parameters (per RISK_LIMITS.md) ──────────────────────────────────
MAX_POSITIONS=5
RISK_PER_TRADE=0.01
MAX_POSITION_SIZE_PCT=0.10
MIN_LOT_SIZE=0.01
MAX_LEVERAGE=10.0
# Exposure Limits
MAX_SINGLE_DIRECTION_PCT=0.30
MAX_TOTAL_NOTIONAL_PCT=1.00
MARGIN_ALERT_PCT=0.70
MARGIN_HALT_PCT=0.80
MARGIN_LIQUIDATION_PCT=0.90
MAX_DRAWDOWN=0.30
# Daily Limits (Cascading)
MAX_DAILY_LOSS=0.05
DAILY_LOSS_LVL1=0.02
DAILY_LOSS_LVL2=0.03
DAILY_LOSS_LVL3=0.04
DAILY_LOSS_HARD_STOP=0.06
DAILY_WIN_CAP=0.10
MAX_TRADES_PER_DAY=20
MAX_LOSING_STREAK=3
MAX_WINNING_STREAK=5
# Weekly/Monthly Limits
MAX_WEEKLY_LOSS=0.10
MAX_MONTHLY_LOSS=0.15
# Capital Allocation
ALLOCATOR_MAX_TOTAL_HEAT=0.70
ALLOCATOR_MAX_SYMBOL_RISK=0.40
ALLOCATOR_MAX_FAMILY_RISK=0.40
ALLOCATOR_PERFORMANCE_STEP=0.05
ALLOCATOR_DECAY_RATE=0.001
ALLOCATOR_SOFT_LIMIT_BUFFER=0.10
# Volatility Thresholds
VOLATILITY_HIGH_THRESHOLD=1.5
VOLATILITY_VERY_HIGH_THRESHOLD=2.0
VOLATILITY_EXTREME_THRESHOLD=3.0
# Execution
MAX_SLIPPAGE_PIPS=1.0
MIN_SPREAD_PIPS=0.5
SPREAD_ALERT_PIPS=1.0
SPREAD_REDUCE_PIPS=1.5
SPREAD_HALT_PIPS=2.0
# ── Model ──────────────────────────────────────────────────────────────────
ALGORITHM=ensemble
MODEL_PATH=models/trained/ensemble_latest.pt
TRAIN_STEPS=1000000
DEVICE=auto
# Prediction Limits
MIN_CONFIDENCE=0.55
CONFIDENCE_THRESHOLD=0.60
CONSENSUS_THRESHOLD=0.60
MODEL_DRIFT_THRESHOLD=0.3
MODEL_ACCURACY_FLOOR=0.5
MODEL_WIN_RATE_FLOOR=0.45
MODEL_CALIBRATION_THRESHOLD=0.25
DATA_FRESHNESS_THRESHOLD=300
OUTCOME_NOISE_THRESHOLD=0.0001
SIGNAL_FLICKER_WINDOW=6
MAX_SIGNAL_CHANGES=3
# ── Database ────────────────────────────────────────────────────────────
DATABASE_URL=postgresql://trader:password@localhost:5432/mt5_trades
REDIS_URL=redis://localhost:6379/0
# ── Monitoring ──────────────────────────────────────────────────────────
PROMETHEUS_PORT=8000
DASHBOARD_PORT=8050
LOG_LEVEL=INFO
TELEGRAM_TOKEN=
TELEGRAM_CHAT_ID=
# ── Safety Gate ─────────────────────────────────────────────────────────
CONFIRM_LIVE_TRADING=NO
EXECUTION_LATENCY_THRESHOLD=1.0
# --- Macro Risk Settings ---
ENABLE_MACRO_GUARD=True
MACRO_PRE_EVENT_MINUTES={"1": 5, "2": 15, "3": 60, "4": 120}
MACRO_POST_EVENT_MINUTES={"1": 5, "2": 30, "3": 120, "4": 240}