refactor: Add debug output for entry price and upper band in sunny scanner

This commit is contained in:
Bobby Abellana (aider) 2025-02-06 23:03:37 -08:00
parent 4a3464b2d9
commit 53ebc1767c
No known key found for this signature in database
GPG Key ID: 647714CC45F3647B

View File

@ -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