mirror of
https://github.com/Ichinga-Samuel/aiomql.git
synced 2026-08-05 08:17:44 +00:00
2.8 KiB
2.8 KiB
aiomql.ticks
Module for working with price ticks.
Tick Objects
class Tick()
Price Tick of a Financial Instrument.
Attributes:
timeint - Time of the last prices update for the symbolbidfloat - Current Bid priceaskfloat - Current Ask pricelastfloat - Price of the last deal (Last)volumefloat - Volume for the current Last pricetime_mscint - Time of the last prices update for the symbol in millisecondsflagsTickFlag - Tick flagsvolume_realfloat - Volume for the current Last priceIndexint - Custom attribute representing the position of the tick in a sequence.
set_attributes
def set_attributes(**kwargs)
Set attributes from keyword arguments
Ticks Objects
class Ticks()
Container data class for price ticks. Arrange in chronological order. Supports iteration, slicing and assignment
Arguments:
dataDataFrame | tuple[tuple] - Dataframe of price ticks or a tuple of tuples
Arguments:
flipbool - If flip is True reverse data chronological order.
Attributes:
data- Dataframe Object holding the ticks
__init__
def __init__(*, data: DataFrame | Iterable, flip=False)
Initialize the Ticks class. Creates a DataFrame of price ticks from the data argument.
Arguments:
dataDataFrame | Iterable - Dataframe of price ticks or any iterable object that can be converted to a pandas DataFrameflipbool - If flip is True reverse data chronological order.
ta
@property
def ta()
Access to the pandas_ta library for performing technical analysis on the underlying data attribute.
Returns:
pandas_ta- The pandas_ta library
ta_lib
@property
def ta_lib()
Access to the ta library for performing technical analysis. Not dependent on the underlying data attribute.
Returns:
ta- The ta library
data
@property
def data() -> DataFrame
DataFrame of price ticks arranged in chronological order.
rename
def rename(inplace=True, **kwargs) -> _Ticks | None
Rename columns of the candle class.
Arguments:
inplacebool - Rename the columns inplace or return a new instance of the class with the renamed columns**kwargs- The new names of the columns
Returns:
Ticks- A new instance of the class with the renamed columns if inplace is False.None- If inplace is True