fix: Add tuple unpacking for check_existing_positions return value
Fixed TypeError caused by missing tuple unpacking: - check_existing_positions() returns (has_position, position_info) - Was accessing as dict directly → TypeError - Now properly unpacks: has_position, position_info = check_existing_positions() Fixed in: - activate_enhanced_scoring.py - Notebook cells 15, 27, 84, 89 Error resolved: TypeError: tuple indices must be integers or slices, not str
This commit is contained in:
@@ -579,7 +579,7 @@
|
||||
"\n",
|
||||
"def get_position_summary(symbol=\"XAUUSD\", strategy_name=\"TradingBot_V1.6\"):\n",
|
||||
" \"\"\"Position-Zusammenfassung\"\"\"\n",
|
||||
" has_position, position_info = check_existing_positions(symbol, strategy_name)\n",
|
||||
" has_position, has_position, position_info = check_existing_positions(symbol, strategy_name)\n",
|
||||
" \n",
|
||||
" print(f\"\\n📊 POSITION SUMMARY für {symbol} (V1.6 Adaptive Complete)\")\n",
|
||||
" print(\"=\" * 60)\n",
|
||||
@@ -608,7 +608,7 @@
|
||||
" ✅ KORRIGIERT: Schließt bestehende Positionen (optional)\n",
|
||||
" Diese Funktion fehlte in der ursprünglichen V1.6!\n",
|
||||
" \"\"\"\n",
|
||||
" has_position, position_info = check_existing_positions(symbol, strategy_name)\n",
|
||||
" has_position, has_position, position_info = check_existing_positions(symbol, strategy_name)\n",
|
||||
" \n",
|
||||
" if not has_position:\n",
|
||||
" print(\"✅ Keine Positionen zum Schließen\")\n",
|
||||
@@ -1195,7 +1195,7 @@
|
||||
" \n",
|
||||
" # SCHRITT 1: POSITION CHECK\n",
|
||||
" print(f\"\\n🔍 POSITION CHECK für {symbol} (V1.6 Adaptive Complete)\")\n",
|
||||
" has_position, position_info = check_existing_positions(symbol, strategy_name)\n",
|
||||
" has_position, has_position, position_info = check_existing_positions(symbol, strategy_name)\n",
|
||||
" \n",
|
||||
" if has_position and position_info['count'] >= max_positions:\n",
|
||||
" if debug:\n",
|
||||
@@ -3281,7 +3281,7 @@
|
||||
" try:\n",
|
||||
" # SCHRITT 1: Position Check (wie vorher)\n",
|
||||
" max_positions = TRADING_CONFIG['risk']['max_positions']\n",
|
||||
" position_info = check_existing_positions(symbol)\n",
|
||||
" has_position, position_info = check_existing_positions(symbol)\n",
|
||||
"\n",
|
||||
" if position_info['count'] >= max_positions:\n",
|
||||
" if debug:\n",
|
||||
@@ -3545,7 +3545,7 @@
|
||||
" try:\n",
|
||||
" # SCHRITT 1: Position Check (wie vorher)\n",
|
||||
" max_positions = TRADING_CONFIG['risk']['max_positions']\n",
|
||||
" position_info = check_existing_positions(symbol)\n",
|
||||
" has_position, position_info = check_existing_positions(symbol)\n",
|
||||
"\n",
|
||||
" if position_info['count'] >= max_positions:\n",
|
||||
" if debug:\n",
|
||||
|
||||
@@ -54,7 +54,7 @@ def enhanced_trading_check_wrapper(symbol="XAUUSD", debug=False):
|
||||
try:
|
||||
# SCHRITT 1: Position Check (wie vorher)
|
||||
max_positions = TRADING_CONFIG['risk']['max_positions']
|
||||
position_info = check_existing_positions(symbol)
|
||||
has_position, position_info = check_existing_positions(symbol)
|
||||
|
||||
if position_info['count'] >= max_positions:
|
||||
if debug:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"timestamp": "2026-01-21T13:24:31.582409",
|
||||
"timestamp": "2026-01-21T13:31:39.173342",
|
||||
"session_thresholds": {
|
||||
"asian": 60,
|
||||
"ny": 60,
|
||||
|
||||
Reference in New Issue
Block a user