Skip to main content

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()

Metadata

Release files for metatrader-sockets-client 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for metatrader-sockets-client 0.0.4
File Size Uploaded
metatrader_sockets_client-0.0.4.tar.gz 12.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for metatrader-sockets-client 0.0.4
File Interpreter ABI Platform
metatrader_sockets_client-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 27.6 kB

Release files / metatrader_sockets_client-0.0.4.tar.gz

Download URL metatrader_sockets_client-0.0.4.tar.gz
Size 12.7 kB
Tags Source
SHA-256 checksum
How to use checksums
d5607236d475283b354e53b181b8ba493ce308553836997802bf312b64624907
BLAKE2b-256 checksum
How to use checksums
f0e2ba454be4e68bbfc292ecac20973abfdf7065aec68b5265f0a69cb288bfc4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.19

Release files / metatrader_sockets_client-0.0.4-py3-none-any.whl

Download URL metatrader_sockets_client-0.0.4-py3-none-any.whl
Size 14.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1823d104dd20280d2961540dc849ff8e108670f08f4043ce6c32c28419847aec
BLAKE2b-256 checksum
How to use checksums
3657d79a902918820164061a5b68b62c6d80d9015543cbd1c1928104381e710a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.19

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page