From 263a35deda01c1491099085d9ef9345b7260ea3a Mon Sep 17 00:00:00 2001 From: GifariKemal Date: Wed, 11 Feb 2026 23:30:23 +0700 Subject: [PATCH] fix(v0.2.7): fix session_name undefined error session_name variable not in scope at line 1716. Get current session from session_filter.get_status_report() instead. Co-Authored-By: Claude Sonnet 4.5 --- main_live.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main_live.py b/main_live.py index d1bdbe7..4edc194 100644 --- a/main_live.py +++ b/main_live.py @@ -1713,7 +1713,10 @@ class TradingBot: # v0.2.7: NIGHT SAFETY - Spread filter for late night hours (22:00-05:59 WIB) # Golden Session (20:00-00:00 WIB) allows wider spread due to extreme volatility is_night_hours = wib_hour >= 22 or wib_hour <= 5 - is_golden = session_name and "GOLDEN" in session_name.upper() + # Check if Golden Session + session_info = self.session_filter.get_status_report() + current_session_name = session_info.get("current_session", "") + is_golden = "GOLDEN" in current_session_name.upper() night_spread_ok = True night_spread_msg = "" if is_night_hours: