diff --git a/src/screener/t_sunnyband.py b/src/screener/t_sunnyband.py index 5b6aa69..93a4985 100644 --- a/src/screener/t_sunnyband.py +++ b/src/screener/t_sunnyband.py @@ -353,9 +353,12 @@ def run_sunny_scanner(min_price: float, max_price: float, min_volume: int, portf if calculator: print(f"Debug: Calculator exists, calculating position for price: ${last_day['close']:.2f}") # Debug line try: + entry_price = last_day['close'] + upper_band = results['upper_band'].iloc[-1] + print(f"Debug: Entry: ${entry_price:.2f}, Upper Band: ${upper_band:.2f}") # Debug line position = calculator.calculate_position_size( - entry_price=last_day['close'], - target_price=results['upper_band'].iloc[-1] + entry_price=entry_price, + target_price=upper_band ) # Format debug position output with rounded values debug_position = {k: round(float(v), 2) if isinstance(v, (float, np.float64)) else v