mirror of
https://github.com/Ichinga-Samuel/aiomql.git
synced 2026-07-29 05:07:43 +00:00
1.8 KiB
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 objectrecords_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_dirPath - 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.