Code Monkey home page Code Monkey logo

metastats-python-sdk's Introduction

MetaStats forex metrics API

MetaStats is a fast, cost-efficient, easy to use and standards-driven cloud forex trading statistics API supporting both MetaTrader 4 and MetaTrader 5 platforms designed to boost forex application development process.

Using MetaStats API you can develop applications similar to Myfxbook or MetriX extremely fast, saving time you otherwise spend for coding, optimizing and testing your own trading metrics calculation engine, since we already did it for you.

MetaStats API is a member of MetaApi project (https://metaapi.cloud), a powerful cloud forex trading API which supports both MetaTrader 4 and MetaTrader 5 platforms.

This SDK requires a 3.8+ version of Python to run.

MetaStats API features

Features supported:

  • support for MetaTrader 4 and MetaTrader 5 platforms
  • metrics calculation for MetaTrader accounts added to MetaApi
  • optionally include open positions in metrics calculation
  • get historical trades for MetaApi account. The historical trades data is updated when you invoke metrics calculation endpoint or when set query parameter updateHistory to true
  • get open trades for MetaApi account

The features described above are available for use via a professional, fast, easy to use, standards-driven REST API which can be easily consumed from any programming language.

The primary intended use of MetaStats API is creating trade monitoring applications.

Pricing

MetaStats is available to all MetaApi users without extra charges at this point.

You pay a fee executing MetaTrader terminal on MetaApi cloud. See https://metaapi.cloud/#pricing for more details.

MetaApi provides a free tier so that you can test our APIs without any charges.

Frequently asked questions (FAQ)

FAQ is located here: http://metaapi.cloud/docs/metastats/faq/

REST API documentation

MetaStats SDK is built on top of MetaStats REST API.

MetaStats REST API docs are available at https://metaapi.cloud/docs/metastats/

Code examples

We published some code examples in our github repository, namely:

Installation

pip install metaapi-cloud-sdk

Retrieving API token

Please visit https://app.metaapi.cloud/token web UI to obtain your API token.

Configuring trading statistics

from metaapi_cloud_sdk import MetaStats

token = '...'
api = MetaStats(token=token)

See in-code documentation for full definition of possible configuration options.

Retrieving trading statistics

account_id = '...'  #  MetaApi account id

# retrieve MetaApi MetaTrader account statistics
print(await metaStats.get_metrics(account_id=account_id))

# retrieve MetaApi MetaTrader account statistics including open positions
print(await metaStats.get_metrics(account_id=account_id, include_open_positions=True))

# retrieve MetaApi MetaTrader account trades
print(await metaStats.get_account_trades(account_id=account_id, start_time='2020-01-01 00:00:00.000',
                                         end_time='2021-01-01 00:00:00.000'))

# retrieve MetaApi MetaTrader account open trades
print(await metaStats.get_account_open_trades(account_id=account_id))

Quotas and rate limits

API calls you make are subject to rate limits. See https://metaapi.cloud/docs/metastats/rateLimiting/ for more details.

Related projects:

See our website for the full list of APIs and features supported https://metaapi.cloud/#features

Some of the APIs you might decide to use together with this module:

  1. MetaApi cloud forex trading API https://metaapi.cloud/docs/client/
  2. CopyFactory copy trading API https://metaapi.cloud/docs/copyfactory/
  3. MetaTrader account management API https://metaapi.cloud/docs/provisioning/
  4. MetaApi MT manager API https://metaapi.cloud/docs/manager/
  5. MetaApi risk management API https://metaapi.cloud/docs/risk-management/

metastats-python-sdk's People

Contributors

romankisilenko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.