Understanding the concept of Tick is very important if you are interested in writing programs in MQL4. You may have heard already about tick or even seen a tick chart, but perhaps you do not have clear the consequences these ticks have on a MQL4 program. In this article we are going to explain what is a Tick and what is its effect in MetaTrader 4.
A simple definition of tick is: 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, notifying them about the new price of a security.
The concept of 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 during the time, each change in the level of the line is a tick. In MetaTrader you can see the tick chart for a security/currency pair in the Market Watch window, selecting the security and then tick chart, if you are not familiar with MetaTrader visit the page Getting Started with MetaTrader 4 Client Terminal. The tick chart is the fastest timeframe you will ever been able to select in a chart.
Tick and Time
It is important to understand that the concept of tick is not linked to a regular time interval. Depending on the date, time and market condition, you can find several ticks happening in a 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 timeframe. Assume that you are looking at the AUDUSD 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 fast. As an opposite example, if you are looking a EURUSD 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. Remember this behaviour 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 a Tick on MetaTrader and MQL4
Now that you understand the concept of tick we can introduce how it affects your MQL programs, we will talk about this in more details in other articles but let me anticipate it briefly. In the article 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 a chart. The default behaviour 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 Expert Advisors to run a portion of the code (function) in the program. We will go into more details about the flow of a MQL program but remember the tick as a trigger.
The concept of tick is fundamental for programming in MQL4 so make sure you understand it well, the tick is an update of the prices of the various instruments and it triggers actions in indicators and expert advisors.
Please leave a comment if you have any feedback or doubt and remember to like us on Social Media!