MQL4 to PHP. HTTP client

Another approach and probably more versatile is to invoke PHP script located on web server. That can be useful if, for some reason you need to pass values to external web server (located outside localhost). Of course, if you can send and receive messages from/to web server, it does not mater what language is used to build logic (RoR, Python, Java, ASP, etc).

Still there is a significant drawback. During strategy testing you may run out of free TCP ports. In this case strategy testing will continue ticking and trying to send data (and receive signals buy or sell), bet connection will be immediately dropped. Even worse if you decided to use mysql as backend data storage for historical data, because each time you create connection to mysql (and close at the end of script), MS Windows will wait couple of seconds with status “CLOSE WAIT”. This phenomenon can be observed executing command “netstat -n”.

More about Metatrader native HTTP client you can find here:

http://codebase.mql4.com/7353
blog comments powered by Disqus
If you found this useful, please feel free to make a donation