diff --git a/src/screener/t_sunnyband.py b/src/screener/t_sunnyband.py index 93a4985..f76a005 100644 --- a/src/screener/t_sunnyband.py +++ b/src/screener/t_sunnyband.py @@ -355,10 +355,13 @@ def run_sunny_scanner(min_price: float, max_price: float, min_volume: int, portf 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 + # Calculate a more aggressive target price (2x the distance to upper band) + band_distance = upper_band - entry_price + target_price = entry_price + (band_distance * 2) + print(f"Debug: Entry: ${entry_price:.2f}, Upper Band: ${upper_band:.2f}, Target: ${target_price:.2f}") # Debug line position = calculator.calculate_position_size( entry_price=entry_price, - target_price=upper_band + target_price=target_price ) # Format debug position output with rounded values debug_position = {k: round(float(v), 2) if isinstance(v, (float, np.float64)) else v