layer one v3

This commit is contained in:
saber
2026-06-17 11:26:57 +01:00
parent 6bfcc67088
commit e28f2db97c
22 changed files with 4124 additions and 271 deletions
+55 -28
View File
@@ -1,10 +1,10 @@
# APEX Layer 1 — Environment Configuration Example
#
# APEX — Environment Configuration Example
#
# Copy this file to .env and fill in your values
# cp .env.example .env
# ============================================================================
# FRED API Configuration (Required)
# FRED API Configuration (Required for Layer 1)
# ============================================================================
# Get a free API key from: https://fred.stlouisfed.org
# 1. Register for an account
@@ -12,58 +12,85 @@
# 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
# ============================================================================
# Path to SQLite database file
DB_PATH=apex.db
# Database connection timeout (seconds)
DB_TIMEOUT=10
# Auto-create schema on first run
DB_AUTO_CREATE=true
# ============================================================================
# Debugging & Logging
# ============================================================================
# Enable debug output to console (true/false)
DEBUG=true
# ============================================================================
# Scoring Weights (must sum to 1.0)
# ============================================================================
# Interest rate differential weight (50% default)
WEIGHT_RATE=0.50
# CPI deviation weight (30% default)
WEIGHT_CPI=0.30
# PMI composite weight (20% default)
WEIGHT_PMI=0.20
# ============================================================================
# Trading Rules
# ============================================================================
# Minimum gap in points to generate trade signal (default 20)
# Gap < 20: NO TRADE
# Gap 20-40: Weak signal
# Gap 40-60: Standard signal
# Gap > 60: Strong signal
# Gap < 20: NO TRADE | 20-40: Weak | 40-60: Standard | > 60: Strong
MIN_GAP=20.0
# ============================================================================
# Auto-Fetch Configuration
# ============================================================================
# Automatically fetch rates from FRED on app startup (true/false)
AUTO_FETCH_RATES_ON_STARTUP=true
# ============================================================================
# Application UI Settings
# Technical Analysis Settings (Layer 2)
# ============================================================================
# Window title
APP_TITLE=APEX Layer 1 — Currency Strength Engine
# Z-score threshold for overbought/oversold (±2.0σ)
Z_SCORE_THRESHOLD=2.0
# Default window size (width x height)
WINDOW_WIDTH=1200
WINDOW_HEIGHT=800
# 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
# ============================================================================
# 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