MQL4 Implementation of onTrade Event Handler – EA MetaTrader 4

MQL4 Implementation of onTrade Event Handler - expert for MetaTrader 4
The code keeps track of orders’ tickets in an CArrayInt. Monitoring the changes to the list of tickets in onTimer it triggers these event handlers: //+——————————————————————+ //| Event handler when stop loss is hit                              | //+——————————————————————+ void onStopLoss(ulong ticket); //+——————————————————————+ //| Event handler when take profit is hit                            | //+——————————————————————+ void onTakeProfit(ulong ticket); //+——————————————————————+ //| Event handler … Read more

Multicurrency OnTickMarketWatch tick event handler – EA MetaTrader 5

Multicurrency OnTickMarketWatch() tick event handler
The standard OnTick() handler allows to receive the ticks for only one symbol. For multicurrency experts you need the ticks for several symbols.  In some cases it’s necessary to recieve the ticks for all symbols from”Market Watch” window. The Expert Advisor exOnTickMarketWatch.mq5 uses the standard custom event handler of OnChartEvent() function, it provides the following … Read more

The “New bar” event handler for the indicators – indicator MetaTrader 5

The "New bar" event handler for the indicators - indicator for MetaTrader 5
The idea of this approach is described in the “New Bar” Event Handler article. The example of its use in the Expert Advisors is presented in the article. Here you will find the solution for the indicators. Idea is the same: it will allow to perform recalculations only when the new bar has appeared. It’s … Read more

Multicurrency OnTick (string symbol) event handler – EA MetaTrader 5

Multicurrency OnTick (string symbol) event handler - expert for MetaTrader 5
This is the new implementation of full-featured multi-currency mode in MetaTrader 5. It’s implemented in extended OnTick(string symbol) function.  Benefits: It provides the real multi-currency mode on demo and real accounts. It has simple settings. The events list for OnTick(string symbol): can be configured: NewTick and/or NewBar. The list of symbols can be configured (all … Read more

MQL Plus Enhanced Error Handler Support – library MetaTrader 5

MQL Plus Enhanced Error Handler Support - library for MetaTrader 5
Change-Log 4.2 Bugfixes, compatibilitishues resolved. Fixed error in UserErrorHandler function signature. Change-Log 4.0 Recreated the whole code structure to support shared library compilation as wel las header include compilation Supports external CSV-File as supply for mql error codes Is MQL4 compatible All MQL4 and MQL5 Languages are included Supports MQL API function shadowing to be … Read more