fix: Replace bitwise operator with logical operator in buy condition check
This commit is contained in:
parent
a012872592
commit
b1d86d988a
@ -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"""
|
"""Check if price is below EMA and moving up through lower ATR band"""
|
||||||
# Get latest values from DataFrame
|
# Get latest values from DataFrame
|
||||||
last_price = df.iloc[-1]
|
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
|
# Check if price is below EMA and has started moving up
|
||||||
ema = results['ema'].iloc[-1]
|
ema = results['ema'].iloc[-1]
|
||||||
lower_band = results['lower_band'].iloc[-1]
|
lower_band = results['lower_band'].iloc[-1]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user