src/tzutrader/exports

Export Module - Report Export to JSON/CSV

This module provides utilities for exporting backtest reports and scan results to various formats.

Procs

proc exportCsv(report: BacktestReport; filename: string) {....raises: [IOError],
    tags: [WriteIOEffect], forbids: [].}

Export BacktestReport to CSV file

Args: report: Report to export filename: Output file path

proc exportCsv(results: seq[ScanResult]; filename: string) {....raises: [IOError],
    tags: [WriteIOEffect], forbids: [].}

Export scan results to CSV file

Args: results: Scan results to export filename: Output file path

proc exportJson(report: BacktestReport; filename: string) {....raises: [IOError],
    tags: [WriteIOEffect], forbids: [].}

Export BacktestReport to JSON file

Args: report: Report to export filename: Output file path

proc exportJson(results: seq[ScanResult]; filename: string) {....raises: [IOError],
    tags: [WriteIOEffect], forbids: [].}

Export scan results to JSON file

Args: results: Scan results to export filename: Output file path

proc exportTradeLog(logs: seq[TradeLog]; filename: string) {....raises: [IOError],
    tags: [WriteIOEffect], forbids: [].}

Export trade logs to JSON file

Args: logs: Trade logs to export filename: Output file path

proc exportTradeLogCsv(logs: seq[TradeLog]; filename: string) {.
    ...raises: [IOError], tags: [WriteIOEffect], forbids: [].}

Export trade logs to CSV file

Args: logs: Trade logs to export filename: Output file path

proc toCsvHeader(): string {....raises: [], tags: [], forbids: [].}

Get CSV header for BacktestReport

Returns: CSV header string

proc toCsvRow(report: BacktestReport): string {....raises: [], tags: [],
    forbids: [].}

Convert BacktestReport to CSV row

Returns: CSV row string

proc toJson(log: TradeLog): JsonNode {....raises: [], tags: [], forbids: [].}

Convert TradeLog to JSON

Returns: JsonNode representation of the trade log

proc toJson(report: BacktestReport): JsonNode {....raises: [], tags: [],
    forbids: [].}

Convert BacktestReport to JSON

Returns: JsonNode representation of the report

proc toJson(results: seq[ScanResult]): JsonNode {....raises: [], tags: [],
    forbids: [].}

Convert sequence of ScanResults to JSON array

Returns: JsonNode array of scan results

proc toJson(scanResult: ScanResult): JsonNode {....raises: [], tags: [],
    forbids: [].}

Convert ScanResult to JSON

Returns: JsonNode representation of the scan result