Files
Ichinga Samuel 4f0150a552 v3.23
2024-10-29 13:04:45 +01:00

1.8 KiB

aiomql.records

This module contains the Records class, which is used to read and update trade records from csv files.

Records Objects

class Records()

This utility class read trade records from csv files, and update them based on their closing positions.

Attributes:

  • config - Config object
  • records_dir(Path) - Path to directory containing record of placed trades, If not given takes the default from the config

__init__

def __init__(records_dir: Path = '')

Initialize the Records class.

Arguments:

  • records_dir Path - Path to directory containing record of placed trades.

get_records

async def get_records()

Get trade records from records_dir folder

Yields:

  • files - Trade record files

read_update

async def read_update(file: Path)

Read and update trade records

Arguments:

  • file - Trade record file

update_rows

async def update_rows(rows: list[dict]) -> list[dict]

Update the rows of entered trades in the csv file with the actual profit.

Arguments:

  • rows - A list of dictionaries from the dictionary writer object of the csv file.

Returns:

  • list[dict] - A list of dictionaries with the actual profit and win status.

update_records

async def update_records()

Update trade records in the records_dir folder.

update_record

async def update_record(file: Path | str)

Update a single trade record file.