Skip to main content

aiomql

GitHub GitHub issues PyPI GitHub Workflow Status Libraries.io dependency status for GitHub repo

Installation

pip install aiomql

Key Features

  • Asynchronous Python Library For MetaTrader 5
  • Build bots for trading in different financial markets using a bot factory
  • Use threadpool or proccesspool executors to run multiple strategies on multiple instruments concurrently
  • Record and keep track of trades and strategies in csv files.
  • Utility classes for using the MetaTrader 5 Library
  • Sample Pre-Built strategies

Simple Usage as an Async MetaTrader5 Libray

import asyncio

# import the class
from aiomql import MetaTrader
from aiomql import Account, Terminal
from aiomql import TimeFrame, OrderType


async def main():
    # Initialize Terminal
    terminal = Terminal()
    mt5 = MetaTrader()
    await mt5.initialize()

    # create Account
    account = Account(account_number=30371334, password="nwa0#anaEze", server="Deriv-Demo")

    # login with account
    await account.login()

    # connection status with the account.connected property
    res = "Login Successful" if account.connected else "Unable to login into account"
    print(res)

    # set account properties
    account.risk = 0.10  # percentage of account equity to risk i.e 10%
    account.risk_to_reward = 3

    # get symbols available for the account if login was successful
    if account.connected:
        symbols = await mt5.symbols_get()
        print(symbols)

    # print timeframe constant for five minutes
    print(TimeFrame.M5)
    await terminal.shutdown()


asyncio.run(main())

As a Bot Building FrameWork using a Prebuilt Strategy

import logging

from aiomql import Bot
from aiomql.lib import ForexMarket, FingerTrap

fmt = "%(asctime)s : %(message)s"

logging.basicConfig(filename='example.log', format=fmt, level=logging.DEBUG)

market = ForexMarket()
bot = Bot(market=market)

# Finger strategy on all instruments in the forex markets
bot.add_strategy_all(strategy=FingerTrap)
bot.execute()
# This assumes that a mt5.json config file with account_number, password and server keys is available

see docs

Metadata

Release files for aiomql 1

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

Source distribution (sdist)

Source distribution for aiomql 1
File Size Uploaded Provenance Actions
aiomql-1.tar.gz 37.7 kB Without provenance Details for aiomql-1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for aiomql 1
File Interpreter ABI Platform Actions
aiomql-1-py3-none-any.whl Python 3 none any Details for aiomql-1-py3-none-any.whl

Total release size: 82.1 kB

Release files / aiomql-1.tar.gz

Download URL aiomql-1.tar.gz
Size 37.7 kB
Tags Source
SHA-256 checksum
How to use checksums
cb9a52a620c6c497a810edf453b1f752199043373b4a409838ffb34876a529a5
BLAKE2b-256 checksum
How to use checksums
ee9f6d2ca71c79431a5fa7fde9f41adc39da459370c3b5b0d89f9ba5c18c935b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.4

Release files / aiomql-1-py3-none-any.whl

Download URL aiomql-1-py3-none-any.whl
Size 44.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3fabd67e1ffa3112c406531b7d8639ee9378e859d3b676dc5967bb6c56e44bb5
BLAKE2b-256 checksum
How to use checksums
e20b135e4bcba02cc89961dabf4f930895e68a18329979b5125e693ba0758317
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.4

Security for aiomql 1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1 This release

2 release files No provenance

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