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

PriceHistogram OnClick Event – indicator MetaTrader 4

price histgram on click v1.02
This indicator shows four price histograms when a click event is fired. Personally, I made it for the check at the time of development, but it was shared. Updates (30/07/2015): v 1.01 Eliminated bugs due to the InpCalcTime does not work. Changed the BinRangeScale from 6 to 4. v 1.02 A large bug was found. … 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

New Bar Event – library MetaTrader 5

New Bar Event - library for MetaTrader 5
Allows you to determine the occurrence of a new bar event in a multicurrency Expert Advisor. In a multicurrency Expert Advisor, the event of a new bar formation can occur at different times for different instruments. But since the EA always works on the chart of one instrument, it becomes necessary to correctly determine in … Read more