Files
2026-06-18 09:35:03 +01:00

108 lines
4.1 KiB
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# APEX — Environment Configuration Example
#
# Copy this file to .env and fill in your values
# cp .env.example .env
# ============================================================================
# FRED API Configuration (Required for Layer 1)
# ============================================================================
# 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
# ============================================================================
# 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=
# ============================================================================
# Database Configuration
# ============================================================================
DB_PATH=apex.db
# ============================================================================
# Debugging & Logging
# ============================================================================
DEBUG=true
LOG_FILE=apex.log
# ============================================================================
# Scoring Weights (must sum to 1.0)
# ============================================================================
WEIGHT_RATE=0.50
WEIGHT_CPI=0.30
WEIGHT_PMI=0.20
# ============================================================================
# Trading Rules
# ============================================================================
# Gap < 20: NO TRADE | 20-40: Weak | 40-60: Standard | > 60: Strong
MIN_GAP=20.0
# ============================================================================
# Auto-Fetch Configuration
# ============================================================================
AUTO_FETCH_RATES_ON_STARTUP=true
# ============================================================================
# Technical Analysis Settings (Layer 2)
# ============================================================================
# Z-score threshold for overbought/oversold (±2.0σ)
Z_SCORE_THRESHOLD=2.0
# 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
# ============================================================================
# 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
# ============================================================================
# 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