- Date Type Structure
- Indicator Parameter Structure
- History Data Structure
- Order Book Structure
- Trade Request Structure
- Request Check Result Structure
- Trade Request Result Structure
- Trade Transaction Structure
- Price Data Structure
- Economic Сalendar structures
The Structure for Returning Current Prices (MqlTick)
This is a structure for storing the latest prices of the symbol. It is designed for fast retrieval of the most requested information about current prices.
struct MqlTick
|
The variable of the MqlTick type allows obtaining values of Ask, Bid, Last and Volume within a single call of the SymbolInfoTick() function.
The parameters of each tick are filled in regardless of whether there are changes compared to the previous tick. Thus, it is possible to find out a correct price for any moment in the past without the need to search for previous values at the tick history. For example, even if only a Bid price changes during a tick arrival, the structure still contains other parameters as well, including the previous Ask price, volume, etc.
You can analyze the tick flags to find out what data have been changed exactly:
- TICK_FLAG_BID – tick has changed a Bid price
- TICK_FLAG_ASK – a tick has changed an Ask price
- TICK_FLAG_LAST – a tick has changed the last deal price
- TICK_FLAG_VOLUME – a tick has changed a volume
- TICK_FLAG_BUY – a tick is a result of a buy deal
- TICK_FLAG_SELL – a tick is a result of a sell deal
Example:
void OnTick()
|
See also