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

@presspage/metatrader-bridge

v1.2.2

Published

A Metatrader Bridge API Server

Downloads

5

Readme

metatrader-bridge

A NodeJS module for integrating Metatrader with an external application. See more at (https://forexgeneral.info)

Installation

To install,

npm i @presspage/metatrader-bridge

Getting Starting

To use in a standard NodeJS file, first import the module,

const {SharedMemory, MetatraderBridge} = require('@presspage/metatrader-bridge);

then initialize a new instance,

new MetatraderBridge();

uses the default parameters,

MAX_SESSIONS = 50
HOST = localhost
PORT = 3000

or, change the default paramters,

new MetatraderBridge(max_sessions,host,port);

Functions

"get -> /",
"get -> /about",
"get -> /md5/:password",
"purge|get -> /Shutdown",
"get -> /ResetAll",
"get -> /GetMaximumSessions",
"get -> /FindExistingSession/:acctnum,:symbol,:handle",
"put|get -> /Initialize/:acctnum,:handle,:symbol,:symbol1,:symbol2,:symbol3",
"put|get-> /InitializeCurrency1/:acctnum,:handle,:symbol.:magic",
"put|get -> /InitializeCurrency2/:acctnum,:handle,:symbol,:magic",
"put|get -> /InitializeCurrency3/:acctnum,:handle,:symbol,:magic",
"delete|get -> /DeInitialize/:index",
"get -> /GetSessionCount",
"get -> /GetSession/:index",
"get -> /GetAllSessions",
"get -> /GetAllAccounts",
"get -> /GetAllCurrencyPairs",
"get -> /GetMarketInfo",
"get -> /GetAllMarketInfo",
"get -> /GetMarginInfo",
"get -> /GetAllMarginInfo",
"get -> /GetAllResponses",
"get -> /GetAllHistory",
"get -> /GetAllCurrency1History",
"get -> /GetAllCurrency2History",
"get -> /GetAllCurrency3History",
"get -> /GetAllTradeCommands",
"get -> /GetAllPrices",
"get -> /GetDllVersion",
"get -> /GetVersion",
"put|get -> /SetBidAsk/:session,:bid,:ask,:close,:volume",
"get -> /GetBid/:session",
"put|get -> /SetBid/:session,:quote",
"put|get -> /SetBidCurrencyOne/:session,:currency,:quote",
"put|get -> /SetBidCurrencyTwo/:session,:currency,:quote",
"put|get -> /SetBidCurrencyThree/:session,:currency,:quote",
"get -> /GetAsk/:session",
"put|get -> /SetAsk/:session,:quote",
"get -> /GetVolume/:session",
"get -> /GetClose/:session",
"put|get -> /SaveAccountInfo/:session,:number,:balance,:equity,:leverage",
"get -> /GetAccountInfo/:session",
"get -> /GetAccountNumber/:session",
"get -> /GetAccountBalance/:session",
"get -> /GetAccountEquity/:session",
"get -> /GetAccountLeverage/:session",
"put|get -> /SaveCurrencySessionInfo/:session,:symbol,:handle,:period,:number",
"get -> /GetSessionCurrency/:session",
"get -> /GetSessionCurrency1/:session",
"get -> /GetSessionCurrency2/:session",
"get -> /GetSessionCurrency3/:session",
"get -> /GetSessionHandle/:session",
"get -> /GetSessionPeriod/:session",
"delete|get -> /DecrementQueuePosition/:session",
"put -> /SaveMarketInfo/:session,:number,:leverage,:symbol,:points,:digits,:spread,:stoplevel",
"get -> /GetDigits/:session",
"get -> /GetSpread/:session",
"get -> /GetStoplevel/:session",
"get -> /GetPoints/:session",
"put -> /SaveMarginInfo/:session,:symbol,:handle,:margininit,:marginmaintenance,:marginhedged,:marginrequired,:margincalcmode",
"get -> /GetMarginInit/:session",
"get -> /GetMarginMaintenance/:session",
"get -> /GetMarginHedged/:session",
"get -> /GetMarginRequired/:session",
"get -> /GetMarginCalcMode/:session",
"get -> /GetTradeOpCommands/:session",
"get -> /GetTradeOpCommand/:session",
"get -> /GetTradeOpCommand1/:session",
"get -> /GetTradeOpCommand2/:session",
"get -> /GetTradeOpCommand3/:session",
"get -> /GetAllCurrencies/:session",
"post|get -> /SaveAllCurrencies",
"post|get -> /SaveHistory",
"put|get -> /SaveHistory/:session,:index,:time,:open,:high,:low,:close,:volume",
"post|get -> /SaveHistoryCcy1",
"post|get -> /SaveHistoryCcy2",
"post|get -> /SaveHistoryCcy3",
"put -> /SaveTick/:session",
"get -> /GetTick/:session",
"get -> /RetrieveHistoryBufferSize/:session",
"get -> /RetrieveHistorical/:session",
"get -> /RetrieveHistorical/:session,:index",
"get -> /RetrieveHistoricalOpen/:session,:index",
"get -> /RetrieveHistoricalHigh/:session,:index",
"get -> /RetrieveHistoricalLow/:session,:index",
"get -> /RetrieveHistoricalClose/:session,:index",
"get -> /RetrieveHistoricalVolume/:session,:index",
"get -> /RetrieveHistoricalTime/:session,:index",
"get -> /RetrieveHistoricalOpen2/:pair,:session,:index",
"get -> /RetrieveHistoricalHigh2/:pair,:session,:index",
"get -> /RetrieveHistoricalLow2/:pair,:session,:index",
"get -> /RetrieveHistoricalClose2/:pair,:session,:index",
"get -> /RetrieveHistoricalVolume2/:pair,:session,:index",
"get -> /RetrieveHistoricalTime2/:pair,:session,:index",
"put -> /SendResponse/:session,:errorcode,:respcode,:message,:ticket",
"get -> /GetResponseErrorCode/:session",
"get -> /GetResponseCode/:session",
"get -> /GetResponseMessage/:session",
"get -> /GetTicketNumber/:session",
"get -> /SendTradeCommands/:session,:cmd,:symbol,:lots,:price,:stoploss,:profit",
"post|get -> /SendTradeCommands",
"get -> /SendTradeCommands2/:session,:cmd,:symbol1,:lots,:cmd2,:symbol2,:lots2,:cmd3,:symbol3,:lots3",
"post|get -> /SendTradeCommands2",
"get -> /SetOrderStatus/:session,:status",
"put -> /SetOrderStatus",
"get -> /GetOrderStatus/:session",
"get -> /GetTradePrice/:session",
"get -> /GetTradeLots/:session",
"get -> /GetTradeLots2/:session",
"get -> /GetTradeLots3/:session",
"get -> /GetTradeStoploss/:session",
"get -> /GetTradeTakeprofit/:session",
"delete|get -> /ResetTradeCommand/:session",
"get -> /GetTradeCurrency/:session",
"get -> /GetTradeCurrency2/:session",
"get -> /GetTradeCurrency3/:session",
"get -> /GetSwapRateLong/:session",
"get -> /GetSwapRateShort/:session",
"get -> /SetSwapRateLong/:session,:rate",
"get -> /SetSwapRateShort/:session,:rate",
"get -> /PipSize/:session",
"get -> /MovingAverages/:session",
"get -> /TechnicalIndicators/:session,:period"

Testing with Postman

Download the POSTMAN tool to test the API. You must initialize a session first.

1. Invoke the Initialize method first, for a single currency.
2. If testing arbitrage, invoke InitializeCurrency1, InitializeCurrency2 and InitializeCurrency3 in addition to InitializeCurrency

Contact us

The best contact method is via email at [email protected]

License

Creative Commons Attribution 4.0

EOL or End-of-Life Doctrine

When a piece of software is useful, there should never be an EOL doctrine. The intention for this package is to achieve immoratlity ;).

At some point of time in the future, this package may appear to be dead and abandon. The opposite will be true!

When this project reaches that stage, this package has matured to a level where maintenance is no longer needed.

When external dependencies are removed from a package, then an immortal package lifespan is achievable!

Patrick Ingle Developer