3146a632d4
- Register EUR/USD in config (pip 0.0001, EurUsdStrategyConfig) - Create pair_signals/ module: registry + dispatcher with per-pair config factories (xauusd.py, eurusd.py) for easy add/remove - EUR/USD gets forex-tuned regime weights, London+NY session hours, XAU strategy gates disabled - Add defense-in-depth display_name guards in signal_aggregator - Rename telegram_bot.py → testing_telegram_bot.py with separate bot token, both pairs with dedicated button rows - Add EUR/USD to news engine affected pairs map - 9 new tests (146 total, all passing) - Zero changes to engine.py, data_provider.py, main.py, backtest/ Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
59 lines
1.7 KiB
Python
59 lines
1.7 KiB
Python
"""EUR/USD signal producer config."""
|
|
|
|
from typing import Optional, List
|
|
from config import PlatformConfig, Timeframe, EURUSD
|
|
|
|
_CONFIRMATIONS = {
|
|
Timeframe.M5: [Timeframe.M15, Timeframe.H1],
|
|
Timeframe.M15: [Timeframe.M5, Timeframe.H1],
|
|
Timeframe.H1: [Timeframe.M15, Timeframe.H4],
|
|
Timeframe.H4: [Timeframe.H1, Timeframe.D1],
|
|
}
|
|
|
|
_TRENDING = {
|
|
"ema_trend": 2.0, "rsi": 1.0, "macd": 2.0,
|
|
"bollinger": 0.5, "keltner": 1.0, "roc": 1.5,
|
|
"candlestick": 0.5, "divergence": 2.0, "adx": 1.0,
|
|
}
|
|
|
|
EUR_REGIME_WEIGHTS = {
|
|
"trending_up": _TRENDING,
|
|
"trending_down": _TRENDING,
|
|
"trending": _TRENDING,
|
|
"ranging": {
|
|
"ema_trend": 0.3, "rsi": 2.0, "macd": 1.0,
|
|
"bollinger": 2.0, "keltner": 1.5, "roc": 0.5,
|
|
"candlestick": 0.8, "divergence": 2.5, "adx": 0.5,
|
|
},
|
|
"transitioning": {
|
|
"ema_trend": 1.5, "rsi": 1.5, "macd": 2.0,
|
|
"bollinger": 1.0, "keltner": 1.5, "roc": 2.0,
|
|
"candlestick": 0.8, "divergence": 2.0, "adx": 1.0,
|
|
},
|
|
}
|
|
|
|
|
|
def make_config(
|
|
primary_tf: Timeframe,
|
|
confirmation_tfs: Optional[List[Timeframe]] = None,
|
|
) -> PlatformConfig:
|
|
config = PlatformConfig()
|
|
config.symbol = EURUSD
|
|
config.display_name = "EUR/USD"
|
|
config.pip_value = 0.0001
|
|
config.primary_timeframe = primary_tf
|
|
config.confirmation_timeframes = (
|
|
confirmation_tfs or _CONFIRMATIONS.get(primary_tf, [Timeframe.M15, Timeframe.H4])
|
|
)
|
|
|
|
config.xau_strategy.enabled = False
|
|
|
|
config.backtest.session_start_hour = 7
|
|
config.backtest.session_end_hour = 20
|
|
config.backtest.blocked_hours_utc = [22, 23, 0, 1, 2, 3]
|
|
config.backtest.allowed_weekdays = [0, 1, 2, 3, 4]
|
|
|
|
config.technical.regime_weights_override = EUR_REGIME_WEIGHTS
|
|
|
|
return config
|