Sunday 2 February 2014

Create Your Own Graphical Panels in MQL5 AND MQL4

Metaquotes have upgraded the popular Forex Trading Platform MetaTrader MT4. Build 574 is now compatiable with the MQL5 language which initially offeres enriched OOP functionailty.

This means you can now develop Expert Advisors and Indicators for MT4 using the classes available in Include\Controls to create custom control panels and dialogs.

Example #include <Controls\Panel.mqh>

The MetaEditor application has been overhauled to allow MQL4 and MQL5 development and debugging.
Other additions for MT4 programmers include line numbers, full debugging, predictave typing for function names and variables. 
(MetaEditor 5.00 Build 882 19th Dec 2013)  

MetaQuotes have published a very useful example and walkthrough of the example panel. Although the article is titled "Create Your Own Graphical Panels in MQL5" the code example provided builds and runs fine in MT4 with no debugging required.

For an experienced programmer in MT4 with little exposure to MQL5, these examples provide a perfect place to get started with the additional classes and functionality that is now available for MT4.
 




A further Panel Example is already loaded in the MT4 platform under:
Navigator >> Custom Indicators >> Examples >> SimplePanel >> SimplePanel






Attach "SimplePanel" to a chart >>


This has apparently been released as a beta at this time, however some forum posters reported this build was being used for live accounts as well. It appears to be very stable.

So it looks like i will have to eat my hat MetaQuotes as my previous rant about MQL5 in my post "MetaTrader MT5 - Pros and Cons" said:

"If MT5 was a true upgrade from MT4, retaining the existing features then that would be great. I wont hold my breath for this to happen though."

Having not expected any further changes to happen with MT4, I have to say i am pleased MetaQuotes chose this upgrade - So... Top Job, Great work MetaQuotes ! Well done !!