Understanding the concept of a tick is very important if you are interested in creating programs in MQL4. You may have already heard about ticks or even seen a tick chart, but perhaps you do not have clear understanding of the consequences these ticks have on a MQL4 program. In this guide, we explain what a tick is and what its effect are in MetaTrader 4.
A simple definition of tick is the following: A tick is an update of the price of a security. It is basically an event that involves the change of the price of a security. A tick is sent by the MetaTrader server to all the client terminals connected to it, notifying them about the new price of a security.
The concept of a tick can be understood better with the help of the tick chart. A tick chart is a line chart that shows the evolution of the price through time — each change in the level of the line is a tick. In MetaTrader, you can see the tick chart for a currency pair (or any other asset) in the Market Watch panel, right-clicking the asset and then selecting Tick Chart. If you are not familiar with MetaTrader, you can read our Getting Started with MetaTrader 4 Client Terminal guide. A tick chart is the fastest timeframe you will ever be able to select for a chart.
Tick and Time
It is important to understand that the concept of a tick is not linked to a regular time interval. Depending on the date, time, and market conditions, you can find several ticks happening in one second or not even a tick in an hour. During quiet times, in fact, ticks are not frequent and, conversely, during busy hours, you will see many ticks being received in a short span of time.
For example, assume that you are looking at the AUD/USD pair during a public holiday in Australia; you will likely be noticing that although the market is open, the price changes (and ticks) will not be frequent.
As an opposite example, if you are looking at a EUR/USD tick chart just after the release of an unexpected news, you will see the tick chart going crazy, with a fast change and adjustment of the exchange rate until the news is absorbed by the market.
Remember about this behavior as it will help you in the development of your MQL4 programs. Also remember that a tick may not be equivalent to a pip or a pipette. A tick is an update in the price and this could be even bigger than a few pips.
Effects of Tick on MetaTrader and MQL4
Now that you understand the concept of a tick, we can introduce how it affects your MQL programs. We will talk about this in more detail in other guides, but here is a brief preview. In the guide on MQL4 program types, we introduced different categories of MQL programs: scripts, indicators, and expert advisors. As explained, the scripts run only once, while indicators and expert advisors run continuously once attached to the chart. The default behavior of indicators and expert advisors is to perform an action whenever a new tick is received. Basically, a tick is a trigger (event) that tells indicators and EAs to run a portion of the code (function) of their program. You will learn a lot more about the flow of an MQL program from our other guides, but for now, just remember that a tick is a trigger.
Conclusion
The concept of a tick is fundamental for programming in MQL4, so make sure you understand it well. A tick is an update of the prices of various instruments and it also triggers actions in indicators and expert advisors.