mirror of
https://github.com/Ichinga-Samuel/aiomql.git
synced 2026-07-28 12:47:43 +00:00
4.2 KiB
4.2 KiB
Table of Contents
get_data
Cursor Objects
class Cursor(NamedTuple)
A cursor to iterate over the data. Marks the current position.
BackTestData Objects
@dataclass
class BackTestData()
The data class to store the backtesting data.
Attributes:
namestr - The name of the backtest data.terminaldict - The terminal information.versiontuple - The version of the terminal.accountdict - The account information.symbolsdict - The symbols information.ticksdict - The ticks data.ratesdict - The rates data.spanrange - The range of the data.rangerange - The range of the data.ordersdict - The orders data.dealsdict - The deals data.positionsdict - The positions data.open_positionsset - The open positions.cursorCursor - The cursor to iterate over the data.marginsdict - The margins data.fully_loadedbool - A flag to indicate if the data is fully loaded
set_attrs
def set_attrs(**kwargs)
Set the attributes of the class on the instance.
fields
@property
def fields()
A list of the fields of the class.
GetData Objects
class GetData()
A class to get the backtesting data from the MetaTrader5 terminal.
Attributes:
startdatetime - The start date of the data.enddatetime - The end date of the data.symbolsSequence[str] - The symbols to get the data for.timeframesSequence[TimeFrame] - The timeframes to get the data for.namestr - The name of the backtest data.rangerange - The range of the data.spanrange - The span of the data.dataBackTestData - The backtesting data.mt5MetaTrader - The MetaTrader5 instance.task_queueTaskQueue - The task queue to handle the requests.
__init__
def __init__(*,
start: datetime,
end: datetime,
symbols: Sequence[str],
timeframes: Sequence[TimeFrame],
name: str = "")
Get the backtesting data from the MetaTrader5 terminal.
Arguments:
startdatetime - The start date of the data.enddatetime - The end date of the data.symbolsSequence[str] - The symbols to get the data for.timeframesSequence[TimeFrame] - The timeframes to get the data for.namestr - The name of the backtest data.
pickle_data
@classmethod
def pickle_data(cls, *, data: BackTestData, name: str | Path)
Pickle the data to a file.
Arguments:
dataBackTestData - The data to pickle.namestr | Path - The name of the file to pickle the data to.
load_data
@classmethod
def load_data(cls, *, name: str | Path) -> BackTestData
Load the data from a file.
Arguments:
namestr | Path - The name of the file to load the data from.
save_data
def save_data(*, name: str | Path = "")
Save the data to a file.
Arguments:
namestr | Path - The name of the file to save the data to. If not provided, the name of the data is used.
get_data
async def get_data(workers: int = None)
Use the task queue to get the data from the MetaTrader5 terminal.
Arguments:
workersint - The number of workers to use in the task queue. If not provided, the default number of workers is used.