Compare commits

..
3 Commits
Author SHA1 Message Date
cbazzaandClaude Opus 4.5 939e01d994 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>
2026-01-23 08:11:12 +01:00
cbazzaandClaude Opus 4.5 c4c10f69fb feat: Implement Hybrid 60/40 scoring approach for Enhanced Signal Scoring
PROBLEM:
- Enhanced Score alone (67.8%) was blocking trades with high Base Confidence (97.5%)
- Low Volume Score (40/100) was dragging down the total
- Good trading setups were being rejected

SOLUTION: Hybrid 60/40 Approach
- Final Score = (Base Confidence × 60%) + (Enhanced Score × 40%)
- The proven trend analysis system keeps primary weight (60%)
- Enhanced scoring still filters bad setups (40%)

EXAMPLE:
- Base Confidence: 97.5%
- Enhanced Score: 67.8%
- OLD: final = 67.8% (blocked at 70% threshold)
- NEW: final = (97.5 × 0.6) + (67.8 × 0.4) = 85.6% (passes!)

BENEFITS:
- Respects the proven base trend system
- Enhanced scoring still adds value
- Fewer false rejections of good trades
- Better balance between filtering and opportunity

Updated files:
- 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>
2026-01-22 18:37:10 +01:00
cbazzaandClaude Opus 4.5 0098600963 fix: Correct Support/Resistance calculation in enhanced signal scoring
PROBLEM:
- "bad operand type for unary -: 'list'" error
- Line 265 tried to negate a list: support_levels = -support_levels
- _find_peaks() returns a list, not numpy array
- Caused S/R Score to default to 50/100

SOLUTION:
- Changed: support_levels = -support_levels
- To: support_levels = [-s for s in support_levels]
- Negates each element in the list individually

IMPACT:
- S/R Score now calculated correctly
- Enhanced Score will be more accurate
- Better trade filtering

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 14:04:27 +01:00
5 changed files with 55107 additions and 27355 deletions

No files matched your search

File diff suppressed because it is too large. Load diff
+12 -6
View File
@@ -92,10 +92,12 @@ def enhanced_trading_check_wrapper(symbol="XAUUSD", debug=False):
current_price=signal_info['trend_info']['M5']['price']
)
# Verwende enhanced score statt base confidence
final_confidence = enhanced.total_score
# HYBRID APPROACH: 60% Base Confidence + 40% Enhanced Score
# Das bewährte Trend-System behält Hauptgewicht
enhanced_score = enhanced.total_score
final_confidence = (base_confidence * 0.6) + (enhanced_score * 0.4)
print(f"\\n✅ Enhanced Signal Scoring:")
print(f"\\n✅ Enhanced Signal Scoring (HYBRID 60/40):")
print(f" Trend Score: {enhanced.trend_score:.1f}/100")
print(f" Volume Score: {enhanced.volume_score:.1f}/100")
print(f" Momentum Score: {enhanced.momentum_score:.1f}/100")
@@ -103,7 +105,8 @@ def enhanced_trading_check_wrapper(symbol="XAUUSD", debug=False):
print(f" Fibonacci Score: {enhanced.fibonacci_score:.1f}/100")
print(f" ─────────────────────────────────────")
print(f" 📊 Base Confidence: {base_confidence:.1f}%")
print(f" 🎯 Enhanced Score: {final_confidence:.1f}%")
print(f" 📈 Enhanced Score: {enhanced_score:.1f}%")
print(f" 🔀 HYBRID (60/40): {final_confidence:.1f}%")
print(f" 📈 Signal Quality: {enhanced.signal_quality}")
# Show reasoning
@@ -116,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-21T22:36:39.567434",
"timestamp": "2026-01-23T00:00:00.067537",
"session_thresholds": {
"asian": 60,
"ny": 60,
"london": 80,
"london": 90,
"overlap": 70
},
"settings": {
+1 -1
View File
@@ -262,7 +262,7 @@ class EnhancedSignalScorer:
# Simple peak/trough detection
resistance_levels = self._find_peaks(highs, distance=10)
support_levels = self._find_peaks(-lows, distance=10) # Invert for troughs
support_levels = -support_levels
support_levels = [-s for s in support_levels] # Negate each element back
# Closest Support/Resistance
closest_support = max([s for s in support_levels if s < current_price], default=None)
+108
View File
@@ -4507,5 +4507,113 @@
},
"position_control_active": true,
"order_result": "OrderSendResult(retcode=10009, deal=629556692, order=692066470, volume=0.1, price=4816.89, bid=0.0, ask=0.0, comment='Request executed', request_id=1587946472, retcode_external=0, request=TradeRequest(action=1, magic=234000, order=0, symbol='XAUUSD', volume=0.1, price=4816.86, stoplimit=0.0, sl=4801.415068173482, tp=4854.772329566296, deviation=20, type=0, type_filling=1, type_time=0, expiration=0, comment='TradingBot_V1.6', position=0, position_by=0))"
},
{
"timestamp": "2026-01-22T01:40:05.656568",
"version": "V1.6_Adaptive_Complete",
"symbol": "XAUUSD",
"entry_signal": 1,
"confidence": 93.65,
"adaptive_threshold": 70,
"signal_quality": "excellent",
"market_regime": "ranging",
"regime_strength": 26.992969317013234,
"risk_adjusted_strength": 143745.33684143785,
"adaptive_interval": 15,
"session": "asian",
"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=629952585, order=692708945, volume=0.1, price=4784.78, bid=0.0, ask=0.0, comment='Request executed', request_id=1587946474, retcode_external=0, request=TradeRequest(action=1, magic=234000, order=0, symbol='XAUUSD', volume=0.1, price=4784.78, stoplimit=0.0, sl=4773.455778645191, tp=4812.320553387024, deviation=20, type=0, type_filling=1, type_time=0, expiration=0, comment='TradingBot_V1.6', position=0, position_by=0))"
},
{
"timestamp": "2026-01-22T08:35:07.527490",
"version": "V1.6_Adaptive_Complete",
"symbol": "XAUUSD",
"entry_signal": 1,
"confidence": 99.13,
"adaptive_threshold": 70,
"signal_quality": "excellent",
"market_regime": "ranging",
"regime_strength": 33.15924775185171,
"risk_adjusted_strength": 162265.72697387377,
"adaptive_interval": 15,
"session": "asian",
"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=630967545, order=694409497, volume=0.1, price=4836.88, bid=0.0, ask=0.0, comment='Request executed', request_id=1587946476, retcode_external=0, request=TradeRequest(action=1, magic=234000, order=0, symbol='XAUUSD', volume=0.1, price=4836.82, stoplimit=0.0, sl=4830.680417653813, tp=4851.468955865467, deviation=20, type=0, type_filling=1, type_time=0, expiration=0, comment='TradingBot_V1.6', position=0, position_by=0))"
},
{
"timestamp": "2026-01-22T14:06:38.702900",
"version": "V1.6_Adaptive_Complete",
"symbol": "XAUUSD",
"entry_signal": 1,
"confidence": 97.62,
"adaptive_threshold": 70,
"signal_quality": "excellent",
"market_regime": "ranging",
"regime_strength": 34.94625812138287,
"risk_adjusted_strength": 195775.68283265218,
"adaptive_interval": 5,
"session": "overlap",
"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=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))"
}
]