npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

metaapi.cloud-metastats-sdk

v4.1.0

Published

Javascript SDK for MetaStats forex trading statistics API. Can calculate metrics for MetaTrader accounts added to MetaApi. Supports both MetaTrader 5 (MT5) and MetaTrader 4 (MT4). (https://metaapi.cloud)

Downloads

4,347

Readme

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.

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

npm install --save metaapi.cloud-sdk

Installing SDK in browser SPA applications

npm install --save metaapi.cloud-sdk

Installing SDK in browser HTML applications

<script src="unpkg.com/metaapi.cloud-sdk"></script>
<script>
    const token = '...';
    const metaStats = new MetaStats(token);
</script>

Retrieving API token

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

Configuring trading statistics

import {MetaStats} from 'metaapi.cloud-sdk';

const token = '...';
const metaStats = new MetaStats(token);

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

Retrieving trading statistics

let accountId = '...'; // MetaApi account id

// retrieve MetaApi MetaTrader account statistics
console.log(await metaStats.getMetrics(accountId));

// retrieve MetaApi MetaTrader account statistics including open positions
console.log(await metaStats.getMetrics(accountId, true));

// retrieve MetaApi MetaTrader account trades
console.log(await metaStats.getAccountTrades(accountId, '2020-01-01 00:00:00.000', '2021-01-01 00:00:00.000'));

// retrieve MetaApi MetaTrader account open trades
console.log(await metaStats.getAccountOpenTrades(accountId));

// reset MetaApi MetaTrader account metrics
console.log(await metaStats.resetMetrics(accountId));

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/