diff --git a/pyproject.toml b/pyproject.toml index eb56ca6..4dc2ff2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "aiomql" -version = "4.0.3" +version = "4.0.4" readme = "README.md" requires-python = ">=3.11" classifiers = [ diff --git a/src/aiomql/lib/account.py b/src/aiomql/lib/account.py index d0a6f7e..cdfe8f1 100644 --- a/src/aiomql/lib/account.py +++ b/src/aiomql/lib/account.py @@ -37,8 +37,9 @@ class Account(_Base, AccountInfo): """ await self.mt5.initialize() self.connected = await self.mt5.login() - if not self: + if not self.connected: raise LoginError("Login failed") + await self.refresh() return self async def __aexit__(self, exc_type, exc_val, exc_tb):