fix: Critical bug - entry_signal type mismatch preventing all trades
Deploy to Windows VPS / deploy (push) Has been cancelled
Deploy to Windows VPS / deploy (push) Has been cancelled
CRITICAL BUG:
- extended_top_down_v2_adaptive returns entry_signal as NUMBER (1, -1, 0)
- enhanced_trading_check_wrapper checked for STRINGS ("LONG", "SHORT")
- Result: 1 in ["LONG", "SHORT"] = False → NO TRADES EVER EXECUTED!
FIX:
- Changed: if entry_signal in ["LONG", "SHORT"]
- To: if entry_signal in [1, -1] # 1=LONG, -1=SHORT
- Added signal_direction conversion before execute_trade call
This explains why no trades were being executed despite good signals!
Updated:
- TradingBot_V1.6_Adaptive_Complete_CORRECTED.ipynb (Cells 85, 90)
- activate_enhanced_scoring.py
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -119,14 +119,17 @@ def enhanced_trading_check_wrapper(symbol="XAUUSD", debug=False):
|
||||
final_confidence = base_confidence
|
||||
|
||||
# SCHRITT 4: Threshold Check
|
||||
if entry_signal in ["LONG", "SHORT"]:
|
||||
if entry_signal in [1, -1]: # 1=LONG, -1=SHORT
|
||||
if final_confidence >= adaptive_threshold:
|
||||
print(f"\\n🎯 Signal qualified! {final_confidence:.1f}% >= {adaptive_threshold:.1f}%")
|
||||
|
||||
# Convert signal to string for execute_trade
|
||||
signal_direction = "LONG" if entry_signal == 1 else "SHORT"
|
||||
|
||||
# Execute trade with ENHANCED confidence
|
||||
result = execute_trade_v2_adaptive(
|
||||
symbol=symbol,
|
||||
entry_signal=entry_signal,
|
||||
entry_signal=signal_direction,
|
||||
confidence=final_confidence, # ← Use enhanced score!
|
||||
signal_info=signal_info
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user