2026-06-17 11:26:57 +01:00
|
|
|
|
# APEX — Environment Configuration Example
|
|
|
|
|
|
#
|
2026-06-16 12:27:37 +01:00
|
|
|
|
# Copy this file to .env and fill in your values
|
|
|
|
|
|
# cp .env.example .env
|
|
|
|
|
|
|
|
|
|
|
|
# ============================================================================
|
2026-06-17 11:26:57 +01:00
|
|
|
|
# FRED API Configuration (Required for Layer 1)
|
2026-06-16 12:27:37 +01:00
|
|
|
|
# ============================================================================
|
|
|
|
|
|
# Get a free API key from: https://fred.stlouisfed.org
|
|
|
|
|
|
# 1. Register for an account
|
|
|
|
|
|
# 2. Go to Account → API Keys
|
|
|
|
|
|
# 3. Copy your key and paste below
|
|
|
|
|
|
FRED_API_KEY=paste_your_fred_api_key_here
|
|
|
|
|
|
|
2026-06-17 11:26:57 +01:00
|
|
|
|
# ============================================================================
|
|
|
|
|
|
# MetaTrader 5 Configuration (for Layer 2 Technical Analysis)
|
|
|
|
|
|
# ============================================================================
|
|
|
|
|
|
# Real-time forex data from local MT5 terminal (no API key needed).
|
|
|
|
|
|
# Symbol suffix varies by broker (e.g., .m for OANDA MT5).
|
|
|
|
|
|
# Leave empty if your symbols are plain (EURUSD, USDJPY, etc.)
|
|
|
|
|
|
MT5_SYMBOL_SUFFIX=
|
|
|
|
|
|
|
2026-06-16 12:27:37 +01:00
|
|
|
|
# ============================================================================
|
|
|
|
|
|
# Database Configuration
|
|
|
|
|
|
# ============================================================================
|
|
|
|
|
|
DB_PATH=apex.db
|
|
|
|
|
|
|
|
|
|
|
|
# ============================================================================
|
|
|
|
|
|
# Debugging & Logging
|
|
|
|
|
|
# ============================================================================
|
|
|
|
|
|
DEBUG=true
|
2026-06-18 09:35:03 +01:00
|
|
|
|
LOG_FILE=apex.log
|
2026-06-16 12:27:37 +01:00
|
|
|
|
|
|
|
|
|
|
# ============================================================================
|
|
|
|
|
|
# Scoring Weights (must sum to 1.0)
|
|
|
|
|
|
# ============================================================================
|
|
|
|
|
|
WEIGHT_RATE=0.50
|
|
|
|
|
|
WEIGHT_CPI=0.30
|
|
|
|
|
|
WEIGHT_PMI=0.20
|
|
|
|
|
|
|
|
|
|
|
|
# ============================================================================
|
|
|
|
|
|
# Trading Rules
|
|
|
|
|
|
# ============================================================================
|
2026-06-17 11:26:57 +01:00
|
|
|
|
# Gap < 20: NO TRADE | 20-40: Weak | 40-60: Standard | > 60: Strong
|
2026-06-16 12:27:37 +01:00
|
|
|
|
MIN_GAP=20.0
|
|
|
|
|
|
|
|
|
|
|
|
# ============================================================================
|
|
|
|
|
|
# Auto-Fetch Configuration
|
|
|
|
|
|
# ============================================================================
|
|
|
|
|
|
AUTO_FETCH_RATES_ON_STARTUP=true
|
|
|
|
|
|
|
|
|
|
|
|
# ============================================================================
|
2026-06-17 11:26:57 +01:00
|
|
|
|
# Technical Analysis Settings (Layer 2)
|
2026-06-16 12:27:37 +01:00
|
|
|
|
# ============================================================================
|
2026-06-17 11:26:57 +01:00
|
|
|
|
# Z-score threshold for overbought/oversold (±2.0σ)
|
|
|
|
|
|
Z_SCORE_THRESHOLD=2.0
|
2026-06-16 12:27:37 +01:00
|
|
|
|
|
2026-06-17 11:26:57 +01:00
|
|
|
|
# Statistical lookback window (Task 1.1): 288 M5 bars = 24 hours of data
|
|
|
|
|
|
Z_SCORE_LOOKBACK=288
|
|
|
|
|
|
|
|
|
|
|
|
# Bar timeframe for anchored statistics: M1 or M5
|
|
|
|
|
|
BAR_TIMEFRAME=M5
|
|
|
|
|
|
|
|
|
|
|
|
# Hours of historical data for μ/σ anchoring (default 48h)
|
|
|
|
|
|
BAR_LOOKBACK_HOURS=48
|
|
|
|
|
|
|
|
|
|
|
|
# Total bar count (288 M5 bars = 24h, 576 = 48h)
|
|
|
|
|
|
BAR_LOOKBACK_BARS=288
|
|
|
|
|
|
|
|
|
|
|
|
# Historical poll interval in seconds (300 = 5 min)
|
|
|
|
|
|
HISTORICAL_POLL_INTERVAL=300
|
|
|
|
|
|
|
|
|
|
|
|
# ============================================================================
|
|
|
|
|
|
# Confluence Settings
|
|
|
|
|
|
# ============================================================================
|
|
|
|
|
|
CONFLUENCE_ENABLED=true
|
|
|
|
|
|
MIN_CONFLUENCE_STRENGTH=60.0
|
|
|
|
|
|
|
|
|
|
|
|
# ============================================================================
|
|
|
|
|
|
# Risk Management
|
|
|
|
|
|
# ============================================================================
|
|
|
|
|
|
ACCOUNT_BALANCE=10000.0
|
|
|
|
|
|
RISK_PER_TRADE=0.01
|
|
|
|
|
|
MAX_PORTFOLIO_LEVERAGE=2.0
|
|
|
|
|
|
USE_GRID_HEDGING=true
|
|
|
|
|
|
GRID_LEVELS=3
|
|
|
|
|
|
|
2026-06-18 09:35:03 +01:00
|
|
|
|
# ============================================================================
|
|
|
|
|
|
# Live Execution (Phase 4 — OFF by default for safety)
|
|
|
|
|
|
# ============================================================================
|
|
|
|
|
|
# Set to true ONLY when connected to a funded MT5 demo/live account
|
|
|
|
|
|
LIVE_TRADING_ENABLED=false
|
|
|
|
|
|
# Max daily loss as fraction of account balance (5% default)
|
|
|
|
|
|
MAX_DAILY_LOSS_PCT=0.05
|
|
|
|
|
|
# Max total open exposure as fraction of account balance (20% default)
|
|
|
|
|
|
MAX_BASKET_EXPOSURE_PCT=0.20
|
|
|
|
|
|
|
2026-06-17 11:26:57 +01:00
|
|
|
|
# ============================================================================
|
|
|
|
|
|
# Mock Data Feeder Configuration (for testing without MT5)
|
|
|
|
|
|
# ============================================================================
|
|
|
|
|
|
MOCK_DRIFT=0.0001
|
|
|
|
|
|
MOCK_THETA=0.02
|
|
|
|
|
|
MOCK_NOISE_STD=0.0008
|
|
|
|
|
|
MOCK_SEASONAL_AMP=0.0003
|
|
|
|
|
|
MOCK_TICK_NOISE=0.0002
|
|
|
|
|
|
MOCK_BID_ASK_SPREAD=0.0001
|
|
|
|
|
|
MOCK_HISTORICAL_DAILY_NOISE=0.01
|