Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Creating MT5 Rest API
#1

MT5 is the latest version of the MT4 trading platform by MetaQuotes corporation,. MQL4 programming language which was developed for MT4 had limitations. Those limitations were overcome with the development of MT5 trading platform and the accompanying MQL5 programming language. MQL5 is a object oriented programming language just like C++/Java/Python. Although MQL5 is now an object oriented programming language, it still lacks the power and fury of C++/Java/Python.

When we try to build predictive models using machine learning, we realize how limited MQL5 is. MQL5 has almost no machine learning, deep learning and reinforcement learning libraries. How to overcome this situation? We can overcome this situation by somehow finding a way to connect C++/Java/Python with MT5. Can we do that? I have started this thread in which I will show how we can convert MT5 into a REST API that C++/Java/Python can connect and exchange data with.

MT5 has a client server architecture. Each broker has the MT5 server while the trading platforms that we use on your desktops and smartphones is the client. Broker MT5 server broadcasts the price data or what we call the price data. Each client trading platform can receive that market data. We can place trading orders on the client trading platform that then get communicated to the broker MT5 server. Brokers can provide APIs. Clients don't have that privilege. But knowing a little bit of coding, we can try to convert our MT5 client into a REST API. What is a REST API? Let's start from here!

REST API
REST stands for Representational State Transfer. REST is basically a webserver that allows the clients to exchange data with the server. Most of the modern programming languages like C++/Java/Python have powerful REST libraries that we can use with the REST webserver which will be the MT5 client on your desktop in this case. MQL5 has this command function webrequest that we can use to achieve our purpose:

int  WebRequest(
   const string      method,          
// HTTP method
   const string      url,             
// URL
   const string      headers,         
// headers 
   int               timeout,         
// timeout
   const char        &data[],         
// the array of the HTTP message body
   char              &result[],       
// an array containing server response data
   string            &result_headers  
// headers of server response
   );

Subscribe My YouTube Channel:
https://www.youtube.com/channel/UCUE7VPo...F_BCoxFXIw

Join Our Million Dollar Trading Challenge:
https://www.doubledoji.com/million-dolla...challenge/
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)