This project is make possible to trading with NodeJS on MetaTrader4 Account
npm install metatrader4#1 https://github.com/dingmaotu/mql4-lib
#2 https://github.com/dingmaotu/mql-zmq
1. Download https://github.com/dingmaotu/mql4-lib/archive/master.zip
2. Unzip to:
3. Download https://github.com/dingmaotu/mql-zmq/archive/master.zip
4. Unzip to:
5. Move from: to
6. Delete:
7. Download https://raw.githubusercontent.com/peterszombati/metatrader4/master/src/MetaTrader4Bridge.mq4
8. Move to:
9. Compile MetaTrader4Bridge.mq4 expert
ts
import MetaTrader4 from "metatrader4";const mt4 = new MetaTrader4({
apiKey: "CHANGEME",
reqUrl: "tcp://127.0.0.1:5555",
pullUrl: "tcp://127.0.0.1:5556"
});
mt4.onConnect(() => {
console.log("Connected");
mt4.getAccountInfo().then((account) => {
console.log(account);
});
mt4.getLastCandles("EURUSD").then((candles) => {
console.log(candles);
});
});
mt4.connect();
``This project has deficiency: https://github.com/bonnevoyager/node-mt4-zmq-bridge so I developed it and published this new repository.