diff --git a/v2realbot/interfaces/live_interface.py b/v2realbot/interfaces/live_interface.py index bbc6ed2..1da2572 100644 --- a/v2realbot/interfaces/live_interface.py +++ b/v2realbot/interfaces/live_interface.py @@ -162,7 +162,7 @@ class LiveInterface(GeneralInterface): return a.avg_entry_price, a.qty except (APIError, Exception) as e: #no position - if e.code == 40410000: return 0,0 + if hasattr(e, 'code') and e.code == 40410000: return 0,0 else: reason = "Exception when calling LIVE interface pos, REPEATING:" + str(e) + format_exc() print("API ERROR: Nepodarilo se ziskat pozici.", reason)