Push trades to an API possible?

 

HI,

I'm new to MetaTrader and MQL. I'm a web developer with JS and PHP skills.

I'm building an API which receives trades via a HTTP REST API.

At the moment just for logging the trades to a database. There are more use cases later.

My customer is trading with MetaTrader (manual and automatic [by robots] trades) and he want's me to send all his trades to the API instantly.

Can this be done with MQL? 

If yes, can you send me some links which will help me to write this MQL program? Links to functions I need, or links to similar scripts?

How can I subscribe to new trades or trade changes? 

Thx!

With best regards

 
d4n333: I'm new to MetaTrader and MQL. I'm a web developer with JS and PHP skills.

I'm building an API which receives trades via a HTTP REST API.

At the moment just for logging the trades to a database. There are more use cases later.

My customer is trading with MetaTrader (manual and automatic [by robots] trades) and he want's me to send all his trades to the API instantly.

Can this be done with MQL? 

If yes, can you send me some links which will help me to write this MQL program? Links to functions I need, or links to similar scripts?

How can I subscribe to new trades or trade changes?

You can use the WebRequest() function for the Web API, but that alone is not enough as there is much more to that in order to collect the Trade information (Order/Deal/Position) and send it off to the website via your REST API.

You will either have to learn more about MetaTrader and the MQL language (in depth) or hire someone to code that part of it for you.

 
Fernando Carreiro:

You can use the WebRequest() function for the Web API, but that alone is not enough as there is much more to that in order to collect the Trade information (Order/Deal/Position) and send it off to the website via your REST API.

You will either have to learn more about MetaTrader and the MQL language (in depth) or hire someone to code that part of it for you.


Hi Fernando,

thank you for your answer. So this means MQL has the possibilities to solve my problem, thats all I wanted to know ... I will start learning MQL now.

Reason: