{"repo":"codfish-zz/cn-trader","free":true,"listed":false,"github":"https://github.com/codfish-zz/cn-trader","clone":"git clone https://github.com/codfish-zz/cn-trader.git","description":"Python back testing system for trading strategies, based on backtrader and AkShare, customized for China market.","language":"Python","stars":29,"topics":["back-testing","backtesting","trading-strategies","financial"],"license":"Apache-2.0","category":"trading","readme_excerpt":"cn-trader English 简体中文 Overview Python back testing system for trading strategies, customized for China market. Features - Real A-share trading rules : commission (0.03% + ¥5 minimum) + stamp duty (sell-side 0.1%) + transfer fee (Shanghai 0.002%) + 100-share lot rounding + T+1 restriction + slippage. - Unified data layer : eastmoney/sina dual-source failover, Parquet local cache, incremental update, normalized columns [date, open, high, low, close, volume, amount] . - Core metrics : total return, annualized return, max drawdown, Sharpe ratio, win rate, profit/loss ratio, average trade pnl. - Benchmark comparison : CSI 300 by default, automatic Alpha / Beta / excess cumulative return. - Parameter optimization : cartesian grid search via backtrader optstrategy . - Layered architecture : data ( data.py ) → engine ( engine.py ) → orchestration ( mainland.py ) → renderer ( renderer.py ) → UI ( ui.py ). Installation This repository is tested on Python 3.10+, backtrader 1.9+ and AkShare 1.4+. With pip With source Or Quick tour Launch the interactive UI Run a single backtest from a script The output contains two rich tables — Backtest Summary and Core Metrics — covering Sharpe ratio, max drawdown, win rate, profit/loss ratio, plus Alpha / Beta / excess return against CSI 300. Use the unified data layer Drive the backtest engine directly Parameter optimization (P3) Environment variables Variable Default Description --- --- --- CN TRADER CACHE DIR /.cn trader/cache Data cache directory","default_branch":null,"files":null,"tree":[],"storefront":"/r/codfish-zz","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/codfish-zz/cn-trader/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}