Files
aiomql/docs/lib/ticks.md
T

61 lines
1.6 KiB
Markdown
Raw Normal View History

2026-02-21 07:43:33 +01:00
# ticks
2023-10-11 09:49:06 +01:00
2026-02-21 07:43:33 +01:00
`aiomql.lib.ticks` — Tick-level price data and technical analysis.
2024-11-10 12:25:50 +01:00
2026-02-21 07:43:33 +01:00
## Overview
2024-02-12 21:09:28 +01:00
2026-02-21 07:43:33 +01:00
Provides `Tick` (a single tick) and `Ticks` (an ordered collection). Like `Candles`, the
`Ticks` class wraps a `pandas.DataFrame` and integrates with `pandas_ta`.
2024-11-10 12:25:50 +01:00
2026-02-21 07:43:33 +01:00
## Classes
2023-10-11 09:49:06 +01:00
2026-02-21 07:43:33 +01:00
### `Tick`
2024-11-10 12:25:50 +01:00
2026-02-21 07:43:33 +01:00
> A single tick (price update).
2024-02-12 21:09:28 +01:00
2026-02-21 07:43:33 +01:00
| Attribute | Type | Description |
|-----------|------|-------------|
| `time` | `int` | Tick time (unix timestamp) |
| `bid` | `float` | Bid price |
| `ask` | `float` | Ask price |
| `last` | `float` | Last price |
| `volume` | `float` | Volume |
| `flags` | `int` | Tick flags |
| `volume_real` | `float` | Real volume |
| `time_msc` | `int` | Tick time in milliseconds |
| `Index` | `int` | Position index within a `Ticks` collection |
2024-11-10 12:25:50 +01:00
2026-02-21 07:43:33 +01:00
#### Properties
2023-10-11 09:49:06 +01:00
2026-02-21 07:43:33 +01:00
| Property | Description |
|----------|-------------|
| `dict` | Attribute dictionary |
2024-11-10 12:25:50 +01:00
2026-02-21 07:43:33 +01:00
---
2024-11-10 12:25:50 +01:00
2026-02-21 07:43:33 +01:00
### `Ticks`
2024-11-10 12:25:50 +01:00
2026-02-21 07:43:33 +01:00
> Ordered collection of ticks backed by a DataFrame.
2024-11-10 12:25:50 +01:00
2026-02-21 07:43:33 +01:00
| Attribute | Type | Description |
|-----------|------|-------------|
| `data` | `DataFrame` | The underlying tick data |
| `Index` | `Series` | Positional index column |
2023-10-11 09:49:06 +01:00
2026-02-21 07:43:33 +01:00
#### Data Access
2024-02-12 21:09:28 +01:00
2026-02-21 07:43:33 +01:00
| Method / Property | Description |
|-------------------|-------------|
| `__getitem__(index)` | Get a `Tick` by position or slice |
| `__len__()` | Number of ticks |
| `__iter__()` | Iterate over `Tick` objects |
| `columns` | DataFrame column names |
| `ta` | Access to `pandas_ta` indicators |
| `rename(inplace=True, **kwargs)` | Rename columns |
2023-10-11 09:49:06 +01:00
2026-02-21 07:43:33 +01:00
#### Technical Analysis
2024-11-10 12:25:50 +01:00
2026-02-21 07:43:33 +01:00
| Method | Description |
|--------|-------------|
| `ta_lib(func, *args, **kwargs)` | Run any `pandas_ta` indicator |