You may recall that in our last minute panic (almost literally!) to get the multi-currency model of Ray the Random Robot™ (with Multiple Micro Memory Modules!) up and running before the deadline for the MetaTrader 5 Automated Trading Championship 2010, we discovered that we needed to persuade him to reduce his randomness slightly by entering trades in the direction of the last one minute bar, instead of the last tick. To do that we hurriedly added a section of code helpfully provided on the MQL5 forum by Rosh, and designed to allow expert advisors to work out when a new bar had just opened on any of their multiple currency pairs.

Now that approach has been taken to the next level. A new article on the MQL5 community site explains how to extend that approach into an object-oriented C++ style class.

For a whole variety of reasons I recommend that you read that article very carefully if you want to move beyond just the basics of MetaTrader 5 "robot" programming.