diff --git a/trading_system/atr_strategy.py b/trading_system/atr_strategy.py index 1aa3c75..0ccaf48 100644 --- a/trading_system/atr_strategy.py +++ b/trading_system/atr_strategy.py @@ -19,7 +19,7 @@ class ATRStrategy: def __init__(self): """初始化ATR策略""" self.use_atr = config.TRADING_CONFIG.get('USE_ATR_STOP_LOSS', True) - self.atr_sl_multiplier = config.TRADING_CONFIG.get('ATR_STOP_LOSS_MULTIPLIER', 1.8) + self.atr_sl_multiplier = config.TRADING_CONFIG.get('ATR_STOP_LOSS_MULTIPLIER', 2.5) # 默认2.5,放宽止损提升胜率 self.atr_tp_multiplier = config.TRADING_CONFIG.get('ATR_TAKE_PROFIT_MULTIPLIER', 1.5) self.risk_reward_ratio = config.TRADING_CONFIG.get('RISK_REWARD_RATIO', 1.5) self.atr_period = config.TRADING_CONFIG.get('ATR_PERIOD', 14) @@ -37,7 +37,7 @@ class ATRStrategy: try: cfg = getattr(config, "TRADING_CONFIG", {}) or {} self.use_atr = bool(cfg.get('USE_ATR_STOP_LOSS', True)) - self.atr_sl_multiplier = float(cfg.get('ATR_STOP_LOSS_MULTIPLIER', 1.8)) + self.atr_sl_multiplier = float(cfg.get('ATR_STOP_LOSS_MULTIPLIER', 2.5)) # 默认2.5,放宽止损提升胜率 self.atr_tp_multiplier = float(cfg.get('ATR_TAKE_PROFIT_MULTIPLIER', 1.5)) self.risk_reward_ratio = float(cfg.get('RISK_REWARD_RATIO', 1.5)) self.atr_period = int(cfg.get('ATR_PERIOD', 14)) diff --git a/trading_system/position_manager.py b/trading_system/position_manager.py index bde5cd6..15c1038 100644 --- a/trading_system/position_manager.py +++ b/trading_system/position_manager.py @@ -211,7 +211,7 @@ class PositionManager: # 估算止损价格(用于固定风险计算) estimated_stop_loss = None if atr and atr > 0: - atr_multiplier = config.TRADING_CONFIG.get('ATR_STOP_LOSS_MULTIPLIER', 1.8) + atr_multiplier = config.TRADING_CONFIG.get('ATR_STOP_LOSS_MULTIPLIER', 2.5) # 默认2.5,放宽止损提升胜率 if estimated_side == 'BUY': estimated_stop_loss = estimated_entry_price - (atr * atr_multiplier) else: # SELL @@ -506,7 +506,7 @@ class PositionManager: if atr is not None and atr > 0 and entry_price > 0: atr_percent = atr / entry_price - atr_multiplier = config.TRADING_CONFIG.get('ATR_STOP_LOSS_MULTIPLIER', 1.8) + atr_multiplier = config.TRADING_CONFIG.get('ATR_STOP_LOSS_MULTIPLIER', 2.5) # 默认2.5,放宽止损提升胜率 stop_distance_for_tp = entry_price * atr_percent * atr_multiplier take_profit_pct_margin = config.TRADING_CONFIG.get('TAKE_PROFIT_PERCENT', 0.30) diff --git a/trading_system/risk_manager.py b/trading_system/risk_manager.py index 14fbe5e..4d2f924 100644 --- a/trading_system/risk_manager.py +++ b/trading_system/risk_manager.py @@ -297,7 +297,7 @@ class RiskManager: if stop_loss_price is None: # 尝试使用ATR估算止损距离 if atr and atr > 0: - atr_multiplier = config.TRADING_CONFIG.get('ATR_STOP_LOSS_MULTIPLIER', 1.8) + atr_multiplier = config.TRADING_CONFIG.get('ATR_STOP_LOSS_MULTIPLIER', 2.5) # 默认2.5,放宽止损提升胜率 if side == 'BUY': estimated_stop_loss = entry_price - (atr * atr_multiplier) else: # SELL