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
Close
Hashes for metatrader_sockets_client-0.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0d6204470433e6ad4676706ab1bf16d8cd7e5ed4554a9bc85a7ddeab315d127 |
|
MD5 | b30036a5c71c97ddd9129d81a2dc3dae |
|
BLAKE2b-256 | 5e5cc7ce5f309abdf2e144517b7289c007180891b9ab94defb2e37145278f381 |
Close
Hashes for metatrader_sockets_client-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 250c4f139708887576868200111409da3ed2731684e1cf16b03d3bf23c5a4945 |
|
MD5 | 67e2b788f73be98879374051d57ac7e7 |
|
BLAKE2b-256 | 226fa0c80a93170d40ebf2607f8497c9c4900c6a7f8c815d44aa81f0a05dd593 |