Commit ·
1553537
1
Parent(s): 0ae549a
fix(signals): enforce minimum 1:1 R:R on rescaled bands
Browse files354 unmodified lines355356357358359360354 unmodified linesif _target_unreasonable(new_target):new_target = Nonerescaled = TradingSignal(ticker=signal.ticker,action=signal.action,354 unmodified lines355356357358359360361362363364365366367368369370371372373374375376354 unmodified linesif _target_unreasonable(new_target):new_target = None# R:R guard: a BUY/SELL card with target closer to entry than# stop is an inverted risk-reward setup (you'd risk more than# you could make). Qwen occasionally emits this when it picks# a conservative target that's still within the absolute clamp# but not sensible relative to the stop it chose. Force the# target back to the profile default band in that case.if (new_stop is not Noneand new_target is not Noneand signal.action in (Action.BUY, Action.SELL)):stop_dist = abs(new_stop - live_entry)target_dist = abs(new_target - live_entry)if target_dist <= stop_dist:new_target = Nonerescaled = TradingSignal(ticker=signal.ticker,action=signal.action,
crew/crew.py+16