Client SDK of MetaTrader Sockets API
Project description
MetaTrader Sockets API Client
Client SDK of MetaTrader Sockets API
Run
import asyncio
from metatrader import (
TerminalClient,
)
async def main():
client = await TerminalClient.create(verbose=False)
async def fetch_account_info():
account_info = await client.get_account()
if account_info:
print(f"Account Info: {account_info}")
else:
print("Failed to fetch account info.")
async def fetch_exchange_info():
exchange_info = await client.get_exchange_info()
if exchange_info:
print(f"Exchange Info: {exchange_info}")
else:
print("Failed to fetch exchange info.")
await fetch_account_info()
# OR
tasks = [fetch_account_info, fetch_exchange_info]
await client._run(tasks)
if __name__ == "__main__":
loop = asyncio.get_event_loop()
try:
loop.run_until_complete(main())
finally:
loop.close()
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file metatrader_sockets_client-0.0.4.tar.gz.
File metadata
- Download URL: metatrader_sockets_client-0.0.4.tar.gz
- Upload date:
- Size: 12.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d5607236d475283b354e53b181b8ba493ce308553836997802bf312b64624907
|
|
| MD5 |
22936ea0f9fde6b8386c880460d3ccf7
|
|
| BLAKE2b-256 |
f0e2ba454be4e68bbfc292ecac20973abfdf7065aec68b5265f0a69cb288bfc4
|
File details
Details for the file metatrader_sockets_client-0.0.4-py3-none-any.whl.
File metadata
- Download URL: metatrader_sockets_client-0.0.4-py3-none-any.whl
- Upload date:
- Size: 14.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1823d104dd20280d2961540dc849ff8e108670f08f4043ce6c32c28419847aec
|
|
| MD5 |
7cdd9f0608f01353753ccff2afa90ffe
|
|
| BLAKE2b-256 |
3657d79a902918820164061a5b68b62c6d80d9015543cbd1c1928104381e710a
|