Avoid fee-negative ATR exits
This commit is contained in:
@@ -909,6 +909,15 @@ def _torch_forecast_exit_signal(
|
||||
if price >= position.take_profit:
|
||||
return Signal(position.symbol, "SELL", 0.96, "torch_forecast: take-profit hit", diagnostics)
|
||||
if atr_trailing_stop is not None and price <= atr_trailing_stop:
|
||||
if estimated_exit_net_percent < 0:
|
||||
diagnostics["atr_exit_blocked_by_cost"] = True
|
||||
return Signal(
|
||||
position.symbol,
|
||||
"HOLD",
|
||||
0.45,
|
||||
"torch_forecast: ATR trailing touched, but exit is not worth fees",
|
||||
diagnostics,
|
||||
)
|
||||
return Signal(position.symbol, "SELL", 0.94, "torch_forecast: ATR trailing stop hit", diagnostics)
|
||||
if not _is_torch_forecast(forecast):
|
||||
if rebound_fallback_position:
|
||||
|
||||
Reference in New Issue
Block a user