Skip to content

Tick

Module for retrieving and managing real-time tick data from MetaTrader 5.

Provides the Tick class for accessing current market price information.

Tick #

Tick(symbol)

Represents real-time tick data for a financial instrument.

Parameters:

Name Type Description Default
symbol str

The financial instrument symbol.

required

Returns:

Type Description
None

None

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 #

symbol

The financial instrument symbol.

time property #

time

Timestamp of the tick data.

bid property #

bid

Current bid price.

ask property #

ask

Current ask price.

last property #

last

Last traded price.

volume property #

volume

Tick volume.

time_msc property #

time_msc

Timestamp in milliseconds.

flags property #

flags

Flags indicating tick data attributes.

volume_real property #

volume_real

Real volume (if available).

real_volume #

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