From b1d86d988ad53d6bdb238853ee95b835c2515b87 Mon Sep 17 00:00:00 2001 From: "Bobby (aider)" Date: Sat, 8 Feb 2025 07:52:20 -0800 Subject: [PATCH] fix: Replace bitwise operator with logical operator in buy condition check --- src/screener/t_atr_ema.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/screener/t_atr_ema.py b/src/screener/t_atr_ema.py index 597a2d3..25c0606 100644 --- a/src/screener/t_atr_ema.py +++ b/src/screener/t_atr_ema.py @@ -27,7 +27,8 @@ def check_atr_ema_buy_condition(df: pd.DataFrame) -> bool: """Check if price is below EMA and moving up through lower ATR band""" # Get latest values from DataFrame last_price = df.iloc[-1] - + results = ThreeATREMAIndicator().calculate(df) # Ensure results are calculated here + # Check if price is below EMA and has started moving up ema = results['ema'].iloc[-1] lower_band = results['lower_band'].iloc[-1]