feat: Add debug prints to track bullish signal and position calculation process
This commit is contained in:
parent
7c8dd5e58d
commit
0648265c62
@ -337,6 +337,7 @@ def run_sunny_scanner(min_price: float, max_price: float, min_volume: int, portf
|
||||
last_day = df.iloc[-1]
|
||||
|
||||
if results['bullish_signal'].iloc[-1]:
|
||||
print("\nDebug: Processing bullish signal") # Debug line
|
||||
signal_data = {
|
||||
'ticker': ticker,
|
||||
'price': last_day['close'],
|
||||
@ -349,11 +350,13 @@ def run_sunny_scanner(min_price: float, max_price: float, min_volume: int, portf
|
||||
|
||||
# Add position sizing if calculator exists
|
||||
if calculator:
|
||||
print(f"Debug: Calculator exists, calculating position for price: ${last_day['close']:.2f}") # Debug line
|
||||
try:
|
||||
position = calculator.calculate_position_size(
|
||||
entry_price=last_day['close'],
|
||||
target_price=results['upper_band'].iloc[-1]
|
||||
)
|
||||
print(f"Debug: Position calculation result: {position}") # Debug line
|
||||
signal_data.update({
|
||||
'shares': position['shares'],
|
||||
'position_value': position['position_value'],
|
||||
|
||||
Loading…
Reference in New Issue
Block a user