Add initial implementation of backtesting framework with CLI interface. Introduce core modules for data loading, trade management, performance metrics, and logging. Include Supertrend indicator calculations and slippage estimation. Update .gitignore to exclude logs and CSV files.
This commit is contained in:
11
logging_utils.py
Normal file
11
logging_utils.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from __future__ import annotations
|
||||
from pathlib import Path
|
||||
import pandas as pd
|
||||
|
||||
|
||||
def write_trade_log(trades: list[dict], path: Path) -> None:
|
||||
if not trades:
|
||||
return
|
||||
df = pd.DataFrame(trades)
|
||||
path.parent.mkdir(parents=True, exist_ok=True)
|
||||
df.to_csv(path, index=False)
|
||||
Reference in New Issue
Block a user