Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/metaapi/metaapi-python-sdk
Python SDK for MetaApi, a professional cloud forex trading API for MetaTrader platform which supports both MetaTrader MetaTrader 5 and MetaTrader 4. Free usage tier available.
https://github.com/metaapi/metaapi-python-sdk
api cloud forex metaapi metaapi-cloud metatrader metatrader4 metatrader5 mt4 mt4-api mt5 mt5-api python rest trading websocket ws
Last synced: 1 day ago
JSON representation
Python SDK for MetaApi, a professional cloud forex trading API for MetaTrader platform which supports both MetaTrader MetaTrader 5 and MetaTrader 4. Free usage tier available.
- Host: GitHub
- URL: https://github.com/metaapi/metaapi-python-sdk
- Owner: metaapi
- License: other
- Created: 2023-11-08T06:38:21.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-29T11:49:25.000Z (10 days ago)
- Last Synced: 2025-01-29T18:51:08.788Z (10 days ago)
- Topics: api, cloud, forex, metaapi, metaapi-cloud, metatrader, metatrader4, metatrader5, mt4, mt4-api, mt5, mt5-api, python, rest, trading, websocket, ws
- Homepage: https://metaapi.cloud
- Size: 134 KB
- Stars: 33
- Watchers: 3
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- Changelog: changelog.md
- License: LICENSE
Awesome Lists containing this project
README
metaapi.cloud SDK for Python
############################MetaApi is a powerful, fast, cost-efficient, easy to use and standards-driven cloud forex trading API for MetaTrader 4 and MetaTrader 5 platform designed for traders, investors and forex application developers to boost forex application development process. MetaApi can be used with any broker and does not require you to be a brokerage.
CopyFactory is a simple yet powerful copy-trading API which is a part of MetaApi. See below for CopyFactory readme section.
MetaApi is a paid service, however we offer a free tier for testing and personal use.
The `MetaApi pricing `_ was developed with the intent to make your charges less or equal to what you would have to pay
for hosting your own infrastructure. This is possible because over time we managed to heavily optimize
our MetaTrader infrastructure. And with MetaApi you can save significantly on application development and
maintenance costs and time thanks to high-quality API, open-source SDKs and convenience of a cloud service.Official REST and websocket API documentation: https://metaapi.cloud/docs/client/
This SDK requires a 3.8+ version of Python to run.
Please note that this SDK provides an abstraction over REST and websocket API to simplify your application logic.
For more information about SDK APIs please check docstring documentation in source codes located inside lib folder of this package.
Working code examples
=====================
Please check `this short video `_ to see how you can download samples via our web application.You can find code examples at `examples folder of our github repo `_ or in the examples folder of the pip package.
We have composed a `short guide explaining how to use the example code `_
Installation
============
.. code-block:: bashpip install metaapi-cloud-sdk
Connecting to MetaApi
=====================
Please use one of these ways:1. https://app.metaapi.cloud/token web UI to obtain your API token.
2. An account access token which grants access to a single account. See section below on instructions on how to retrieve account access token.Supply token to the MetaApi class constructor.
.. code-block:: python
from metaapi_cloud_sdk import MetaApi
token = '...'
api = MetaApi(token=token)Retrieving account access token
===============================
Account access token grants access to a single account. You can retrieve account access token via API:.. code-block:: python
account_id = '...'
validity_in_hours = 24
account_access_token = await api.token_management_api.narrow_down_token(
{
'applications': ['trading-account-management-api', 'copyfactory-api', 'metaapi-rest-api', 'metaapi-rpc-api', 'metaapi-real-time-streaming-api', 'metastats-api', 'risk-management-api'],
'roles': ['reader'],
'resources': [{'entity': 'account', 'id': account_id}]},
validity_in_hours
)
print(account_access_token)Alternatively, you can retrieve account access token via web UI on https://app.metaapi.cloud/accounts page (see `this video `_).
Table of contents
=================1. `MT account management `_
2. `MetaApi RPC API `_
3. `MetaApi real-time streaming API (websocket API) `_
4. `Risk management API `_
5. `CopyFactory copy trading API `_
6. `MetaStats trading statistics API `_
7. `MetaApi MT manager API `_
8. `Tracking latencies `_
9. `Enable log4js logging `_
10. `Rate limits & quotas `_
11. `Token management API `_