Improve volume filter debug message with actual values and threshold

This commit is contained in:
justin committed 2026-02-05 09:55:09 -07:00
1 parent a35e6b6d8e
commit c0ba4f25b6
1 file changed
+6 -6
+6 -6
View File
@@ -338,11 +338,6 @@ class SignalState:
self.last_bearish_crossover_bar = -999
class PositionState:
"""
Tracks position state for profit taking and stop management.
NOTE: This bot runs single-threaded - no locks needed.
If extending to multi-threaded, add threading.Lock() protection.
"""
def __init__(self):
self.target_1_hit = False
self.trailing_stop = None
@@ -674,7 +669,12 @@ def advanced_signal_generator(symbol):
return None, 0, 0, None
if not check_volume(bars, VOLUME_MULTIPLIER):
debug_print("Volume filter failed")
if len(bars) >= 20 and "volume" in bars.columns:
avg_vol = bars["volume"].rolling(window=20).mean().iloc[-1]
cur_vol = bars["volume"].iloc[-1]
debug_print(f"Volume filter failed: current={cur_vol:,.0f}, avg={avg_vol:,.0f}, required={avg_vol*VOLUME_MULTIPLIER:,.0f} ({VOLUME_MULTIPLIER}x)")
else:
debug_print("Volume filter failed: insufficient data")
return None, 0, 0, None
bullish_pattern, bearish_pattern = check_candle_pattern(bars)