Download MetaTrader 5

Watch how to download trading robots for free

Interesting script?
So post a link to it -
let others appraise it

You liked the script? Try it in the MetaTrader 5 terminal

2010.11.01 10:45

Multicurrency OnTickMarketWatch tick event handler - expert for MetaTrader 5

| English Русский 中文 Español Deutsch 日本語 Português

votes: 18


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 information:

  1. Symbol index of the "Market Watch" window
  2. Symbol name
  3. Tick Bid price.
  4. Symbol spread.

Launch the scOnTickMarketWatch.mq5 script to receive the ticks from "Market Watch" window.


  • This version of multicurrency event handler uses a lot of resources. The CPU usage can be decreased by increasing the delay variable of the script, but you can skip some ticks.
  • After launch of the script and Expert Advisor you can specify the symbols by adding them in "Market Watch" window.
  • You can modify the code for your needs, for example, you can configure it to receive the Ask price instead of spread.

P.S. It has been published at Russian forum.


Multicurrency OnTickMarketWatch() tick event handler

Translated from Russian by MetaQuotes Software Corp.
Original code:

Accelerator Oscillator (AC) Accelerator Oscillator (AC)

The Acceleration/Deceleration Indicator (AC) measures acceleration and deceleration of the current driving force.

Average Directional Movement Index (ADX) Average Directional Movement Index (ADX)

The Average Directional Movement Index Indicator (ADX) helps to determine if there is a price trend.

TP-SL_Removing TP-SL_Removing

Immediately deletes the SL/TP of all positions.

Closed_TOTAL Closed_TOTAL

Total closure of all positions (winners/losers). You can also select which are of a single instrument.