Module for retrieving and managing real-time tick data from MetaTrader 5.
Provides the Tick class for accessing current market price information.
Tick
Represents real-time tick data for a financial instrument.
Parameters:
Name |
Type |
Description |
Default |
symbol
|
str
|
The financial instrument symbol.
|
required
|
Returns:
Source code in mqpy\tick.py
| def __init__(self, symbol: str) -> None:
"""Initializes a Tick object.
Args:
symbol (str): The financial instrument symbol.
Returns:
None
"""
tick_info = Mt5.symbol_info_tick(symbol)
self._symbol = symbol
self._time = tick_info.time
self._bid = tick_info.bid
self._ask = tick_info.ask
self._last = tick_info.last
self._volume = tick_info.volume
self._time_msc = tick_info.time_msc
self._flags = tick_info.flags
self._volume_real = tick_info.volume_real
|
symbol
property
The financial instrument symbol.
time
property
Timestamp of the tick data.
time_msc
property
Timestamp in milliseconds.
flags
property
Flags indicating tick data attributes.
volume_real
property
Real volume (if available).
real_volume
List of real volumes.
Source code in mqpy\tick.py
| def real_volume(self) -> list[int]:
"""List of real volumes."""
return self._real_volume
|