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.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d26a40783782d27cc0dfb78ba2d783570712a2c813095653b5f11ad5a5b785c8 |
|
MD5 | 87c04d5b91a743e11324af24b83394e5 |
|
BLAKE2b-256 | 71c5905c4963096e085e1bf20162ffc24ca41d68935a01a51f0191122bdee655 |
Close
Hashes for metatrader_sockets_client-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17e41471e554d1599fe03efa3de1a23b0a9c92208162446125402ea1d86d5715 |
|
MD5 | 9bc3ea6145b0e06a496837f98765bd20 |
|
BLAKE2b-256 | 711f90c7204241a639d4504bcb01e3c5f383fc4117ca7cd3d487e0797ec851ab |