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:
2026-01-09 19:53:01 +08:00
parent a25499e016
commit c4aa965a98
15 changed files with 424 additions and 568 deletions

11
market_costs.py Normal file
View File

@@ -0,0 +1,11 @@
from __future__ import annotations
TAKER_FEE_BPS_DEFAULT = 10.0 # 0.10%
def okx_fee(fee_bps: float, notional_usd: float) -> float:
return notional_usd * (fee_bps / 1e4)
def estimate_slippage_rate(slippage_bps: float, notional_usd: float) -> float:
return notional_usd * (slippage_bps / 1e4)