If for some reason you might want build trading logic outside MT4 build-in language MQL4, for example in PHP, you can do it in one of two ways:
- Call web server script
- Execute command line script
Actually I was surprised how powerful MT4 language MQL4 is. Even more, if something is missing, you can create external DLL in any language you like, from C++ up to C#. Even if you are not familiar how to make external DLL, there are good people around the globe who did it for you.
In order to pass variables to PHP and receive response (decision) in form of SELL or BUY, first you have to make expert. Originally experts are user created logic, which analyze market movement and trends and either suggest user when to sell or buy, or even do it automatically.
If you just need to send tick price movements to php, both methods will suite your need. But, if you want make strategy expert and test it with strategy tester, aware, in web server environment you might run out of free TCP ports. That is why the reasonable solution is to pass values to PHP CLI (described here - http://mql4-php.iinuu.eu/).
There are some other approaches, how to communicate with MT4, like MT4 API. The solution costs some money, but if you are seriously works on strategies, that might be suitable solution
» Comments