fix: Critical bug - entry_signal type mismatch preventing all trades
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:
2026-01-23 08:11:12 +01:00
co-authored by Claude Opus 4.5
parent c4c10f69fb
commit 939e01d994
4 changed files with 60705 additions and 137 deletions
File diff suppressed because it is too large Load Diff
+5 -2
View File
@@ -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
)
+2 -2
View File
@@ -1,9 +1,9 @@
{
"timestamp": "2026-01-22T14:06:40.100178",
"timestamp": "2026-01-23T00:00:00.067537",
"session_thresholds": {
"asian": 60,
"ny": 60,
"london": 80,
"london": 90,
"overlap": 70
},
"settings": {
+27
View File
@@ -4588,5 +4588,32 @@
},
"position_control_active": true,
"order_result": "OrderSendResult(retcode=10009, deal=631796029, order=695596696, volume=0.1, price=4823.55, bid=0.0, ask=0.0, comment='Request executed', request_id=1587946477, retcode_external=0, request=TradeRequest(action=1, magic=234000, order=0, symbol='XAUUSD', volume=0.1, price=4823.62, stoplimit=0.0, sl=4818.361220809183, tp=4836.031947977042, deviation=20, type=0, type_filling=1, type_time=0, expiration=0, comment='TradingBot_V1.6', position=0, position_by=0))"
},
{
"timestamp": "2026-01-22T18:39:29.895012",
"version": "V1.6_Adaptive_Complete",
"symbol": "XAUUSD",
"entry_signal": 1,
"confidence": 97.81,
"adaptive_threshold": 70,
"signal_quality": "excellent",
"market_regime": "ranging",
"regime_strength": 33.894449391752474,
"risk_adjusted_strength": 171361.16964171888,
"adaptive_interval": 5,
"session": "ny",
"relaxed_features": {
"pullback_entry_disabled": true,
"lower_confidence_threshold": true,
"lower_min_strength": true,
"fixed_tf_alignment": true
},
"adaptive_features": {
"adaptive_rhythm": true,
"session_aware": true,
"volatility_based": true
},
"position_control_active": true,
"order_result": "OrderSendResult(retcode=10009, deal=633007436, order=696946027, volume=0.1, price=4893.91, bid=0.0, ask=0.0, comment='Request executed', request_id=1587946480, retcode_external=0, request=TradeRequest(action=1, magic=234000, order=0, symbol='XAUUSD', volume=0.1, price=4893.93, stoplimit=0.0, sl=4883.200531304935, tp=4917.9186717376615, deviation=20, type=0, type_filling=1, type_time=0, expiration=0, comment='TradingBot_V1.6', position=0, position_by=0))"
}
]