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:
1 parent
ccbc5f8d06
commit
1007b904fa
3 files changed
+7
-7
No files matched your search
@@ -579,7 +579,7 @@
|
|||||||
"\n",
|
"\n",
|
||||||
"def get_position_summary(symbol=\"XAUUSD\", strategy_name=\"TradingBot_V1.6\"):\n",
|
"def get_position_summary(symbol=\"XAUUSD\", strategy_name=\"TradingBot_V1.6\"):\n",
|
||||||
" \"\"\"Position-Zusammenfassung\"\"\"\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",
|
" \n",
|
||||||
" print(f\"\\n📊 POSITION SUMMARY für {symbol} (V1.6 Adaptive Complete)\")\n",
|
" print(f\"\\n📊 POSITION SUMMARY für {symbol} (V1.6 Adaptive Complete)\")\n",
|
||||||
" print(\"=\" * 60)\n",
|
" print(\"=\" * 60)\n",
|
||||||
@@ -608,7 +608,7 @@
|
|||||||
" ✅ KORRIGIERT: Schließt bestehende Positionen (optional)\n",
|
" ✅ KORRIGIERT: Schließt bestehende Positionen (optional)\n",
|
||||||
" Diese Funktion fehlte in der ursprünglichen V1.6!\n",
|
" Diese Funktion fehlte in der ursprünglichen V1.6!\n",
|
||||||
" \"\"\"\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",
|
" \n",
|
||||||
" if not has_position:\n",
|
" if not has_position:\n",
|
||||||
" print(\"✅ Keine Positionen zum Schließen\")\n",
|
" print(\"✅ Keine Positionen zum Schließen\")\n",
|
||||||
@@ -1195,7 +1195,7 @@
|
|||||||
" \n",
|
" \n",
|
||||||
" # SCHRITT 1: POSITION CHECK\n",
|
" # SCHRITT 1: POSITION CHECK\n",
|
||||||
" print(f\"\\n🔍 POSITION CHECK für {symbol} (V1.6 Adaptive Complete)\")\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",
|
" \n",
|
||||||
" if has_position and position_info['count'] >= max_positions:\n",
|
" if has_position and position_info['count'] >= max_positions:\n",
|
||||||
" if debug:\n",
|
" if debug:\n",
|
||||||
@@ -3281,7 +3281,7 @@
|
|||||||
" try:\n",
|
" try:\n",
|
||||||
" # SCHRITT 1: Position Check (wie vorher)\n",
|
" # SCHRITT 1: Position Check (wie vorher)\n",
|
||||||
" max_positions = TRADING_CONFIG['risk']['max_positions']\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",
|
"\n",
|
||||||
" if position_info['count'] >= max_positions:\n",
|
" if position_info['count'] >= max_positions:\n",
|
||||||
" if debug:\n",
|
" if debug:\n",
|
||||||
@@ -3545,7 +3545,7 @@
|
|||||||
" try:\n",
|
" try:\n",
|
||||||
" # SCHRITT 1: Position Check (wie vorher)\n",
|
" # SCHRITT 1: Position Check (wie vorher)\n",
|
||||||
" max_positions = TRADING_CONFIG['risk']['max_positions']\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",
|
"\n",
|
||||||
" if position_info['count'] >= max_positions:\n",
|
" if position_info['count'] >= max_positions:\n",
|
||||||
" if debug:\n",
|
" if debug:\n",
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ def enhanced_trading_check_wrapper(symbol="XAUUSD", debug=False):
|
|||||||
try:
|
try:
|
||||||
# SCHRITT 1: Position Check (wie vorher)
|
# SCHRITT 1: Position Check (wie vorher)
|
||||||
max_positions = TRADING_CONFIG['risk']['max_positions']
|
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 position_info['count'] >= max_positions:
|
||||||
if debug:
|
if debug:
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"timestamp": "2026-01-21T13:24:31.582409",
|
"timestamp": "2026-01-21T13:31:39.173342",
|
||||||
"session_thresholds": {
|
"session_thresholds": {
|
||||||
"asian": 60,
|
"asian": 60,
|
||||||
"ny": 60,
|
"ny": 60,
|
||||||
|
|||||||
Reference in new issue
Block a user