From 53ebc1767c0c61c2c1c179db881372018ca89056 Mon Sep 17 00:00:00 2001 From: "Bobby Abellana (aider)" Date: Thu, 6 Feb 2025 23:03:37 -0800 Subject: [PATCH] refactor: Add debug output for entry price and upper band in sunny scanner --- src/screener/t_sunnyband.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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