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 <noreply@anthropic.com>
This commit is contained in:
buckybonez
2026-02-11 23:30:23 +07:00
parent 37ae3f508a
commit 46000cd122
+4 -1
View File
@@ -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: