MetaTrader can export trade history reports automatically via the FTP protocol: https://www.metatrader5.com/en/terminal/help/startworking/settings#ftp
However for a more sophisticated implementation, instead of trying to find a way of accessing MetaTrader data via REST API, invert the strategy.
Run a MQL5 Service on the MetaTrader 5 terminal, which monitors the trade history, and every time there is new data (or all of it on the first run), it "pushes" that data onto the website via a simple web-service. You can write the web-service in which ever way you want. You could have the data be pushed as JSON for example.
In this way, the MQL5 Service can be coded in pure MQL and only need to use the WebRequest function to push the data. There will be no need to create any intermediate steps or keep a separate a database on the MetaTrader side and keeps the CPU and RAM usage low.MetaTrader can export trade history reports automatically via the FTP protocol: https://www.metatrader5.com/en/terminal/help/startworking/settings#ftp
However for a more sophisticated implementation, instead of trying to find a way of accessing MetaTrader data via REST API, invert the strategy.
Run a MQL5 Service on the MetaTrader 5 terminal, which monitors the trade history, and every time there is new data (or all of it on the first run), it "pushes" that data onto the website via a simple web-service. You can write the web-service in which ever way you want. You could have the data be pushed as JSON for example.
In this way, the MQL5 Service can be coded in pure MQL and only need to use the WebRequest function to push the data. There will be no need to create any intermediate steps or keep a separate a database on the MetaTrader side and keeps the CPU and RAM usage low.Thats a good idea to go about it. - Doing POSTs on a receiving web service. I did not think about that... And it is quite secure.
MetaTrader can export trade history reports automatically via the FTP protocol: https://www.metatrader5.com/en/terminal/help/startworking/settings#ftp
However for a more sophisticated implementation, instead of trying to find a way of accessing MetaTrader data via REST API, invert the strategy.
Run a MQL5 Service on the MetaTrader 5 terminal, which monitors the trade history, and every time there is new data (or all of it on the first run), it "pushes" that data onto the website via a simple web-service. You can write the web-service in which ever way you want. You could have the data be pushed as JSON for example.
In this way, the MQL5 Service can be coded in pure MQL and only need to use the WebRequest function to push the data. There will be no need to create any intermediate steps or keep a separate a database on the MetaTrader side and keeps the CPU and RAM usage low.interesting, Can I get a guide on how to do this?
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello World!
I am new here, and i have searched for creating an API to get the trades that a user does using METATRADER 5 , user wants to show the history of his trades on his website, is there any possible way to do this? is there is any documentations for developers for creating RESTful API's using METATRADER? i want to get all the information's about a certain account, please help me on this, Thanks a lot!