Trading Gurus Robot Available on MetaTrader 5


MetaTrader 5 has been open for public beta testing for a few days now.  After a few trials and tribulations we have now got our first example robot working on MetaTrader 5.  If you'd like to know what changes we had to make you can take a look at our MQL5 source code. This is just a quick port retaining the old MQL4 procedural style. We're not using any of the fancy new object oriented features of MQL5 yet.

If you're looking to get started with MQL5 yourself there a few things you need to be aware of. The first problem is that MetaQuotes currently only provide documentation on MQL5 in the Russian language! is still "coming soon", but over on the MQL4 forum fai has used Google Translate to produce a rough English translation. That is a big help, and was sufficient to get us started.

For the geeks amongst our readers here are a few more things we discovered. The start() function that does the bulk of the work of a MetaTrader 4 expert advisor needs to be renamed OnTick(). That on its own is not enough though. The function no longer returns an int. If you don't declare OnTick() as void the EA compiles OK. It just doesn't work!

A lot of other familiar things need changing too. IsTesting() isn't there, because neither is the strategy tester yet. IsDemo() doesn't exist any more either, and neither do Bid or Ask! OrderSend() is totally different, and you might find you now need to use PositionSelect() where you used to use OrderSelect(). Checkout our source for some workarounds.

If you remember a while ago we were looking forward to using the new OnTrade() event. We're still waiting, because even the Russian documentation doesn't explain how that works yet. The Google translation simply says "Description coming soon."

Filed under Trading Systems by  #

Leave a Comment

Fields marked by an asterisk (*) are required.