fix: Correct Support/Resistance calculation in enhanced signal scoring
PROBLEM: - "bad operand type for unary -: 'list'" error - Line 265 tried to negate a list: support_levels = -support_levels - _find_peaks() returns a list, not numpy array - Caused S/R Score to default to 50/100 SOLUTION: - Changed: support_levels = -support_levels - To: support_levels = [-s for s in support_levels] - Negates each element in the list individually IMPACT: - S/R Score now calculated correctly - Enhanced Score will be more accurate - Better trade filtering 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -262,7 +262,7 @@ class EnhancedSignalScorer:
|
|||||||
# Simple peak/trough detection
|
# Simple peak/trough detection
|
||||||
resistance_levels = self._find_peaks(highs, distance=10)
|
resistance_levels = self._find_peaks(highs, distance=10)
|
||||||
support_levels = self._find_peaks(-lows, distance=10) # Invert for troughs
|
support_levels = self._find_peaks(-lows, distance=10) # Invert for troughs
|
||||||
support_levels = -support_levels
|
support_levels = [-s for s in support_levels] # Negate each element back
|
||||||
|
|
||||||
# Closest Support/Resistance
|
# Closest Support/Resistance
|
||||||
closest_support = max([s for s in support_levels if s < current_price], default=None)
|
closest_support = max([s for s in support_levels if s < current_price], default=None)
|
||||||
|
|||||||
Reference in New Issue
Block a user