GithubHelp home page GithubHelp logo

jamser / aurum79 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from oknoorap/aurum79

0.0 0.0 0.0 344 KB

Aurum79 is a JavaScript library that provides a client for connecting to the MetaTrader 5 (MT5) trading platform

License: MIT License

TypeScript 11.86% MQL5 88.14%

aurum79's Introduction

Aurum79

As a chemical element with the symbol Au and atomic number 79, aurum, commonly known as gold, has long been esteemed for its associations with wealth and luxury. The Aurum79 JavaScript library offers a client for connecting to the MetaTrader 5 trading platform, potentially aiding users in achieving financial success through trading.

It is possible to utilize tensorflow.js for predicting prices, as well as for fetching forex calendar or other relevant events, allowing for the combination of technical and fundamental analysis. Additionally, using javascript can be a more convenient option than scripting in MQL5, as there may be fewer restrictions and difficulties.


Installation

Prerequisites:

  • NodeJS (latest version or LTS)
  • MT5 client

Install from package manager:

NPM

npm install aurum79 --save

Yarn

yarn add aurum79

PNPM

pnpm add aurum79


Usage

To utilize the aurum79 module in your project, you will first need to download the compiled EA from the mql/Aurum79.ex5 directory or compile it yourself. Once this is done, activate it within the MetaTrader5 client prior to running your script.

An example of how to utilize the aurum79 module in your project is provided below:

import {
  MetaTraderClient,
  MetaTraderClientActionType,
  MetaTraderClientTradingStatus,
} from 'aurum79';

const client = new MetaTraderClient();

/**
 * Listening tick event from MetaTrader5
 */
client.on('tick', ({ tick, history, chart, status, action }) => {
  // Your technical decision here
  // e.g using machine learning library such as Tensorflow.js
  if (status !== MetaTraderClientTradingStatus.TRADING) {
    // If prediction BUY
    action(MetaTraderClientActionType.BUY);

    // If Prediction SELL
    action(MetaTraderClientActionType.SELL);
  }

  // Status, 0 = IDLE, 1 = TRADING
  console.log({ status })

  // Tick price
  console.log({ tick });

  // Print all time-series historical data -60 bar
  console.log({ history });

  // Candlestick chart buffer
  // You can save buffer as image
  fs.writeFileSync(
    path.join('image', `${new Date().toISOString()}.png`),
    chart
  );
});

/**
 * Listening action triggers
 */
client.on('action', ({ type, data }) => {
  // Save action into log or database
  console.log({ type });
});

/**
 * Listening result when trading is finished
 */
client.on('result', ({ result, data }) => {
  // Save action into log or database
  console.log({ result, data });
});

// Start MetaTrader5 client
// Custom port: client.start(8080);
// Default port is 3333
client.start();

License

MIT (c) copyrighted 2022 by Ribhararnus Pracutian.

aurum79's People

Contributors

oknoorap 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.