Skip to content

Commit c1c1130

Browse files
committed
docs: update BacktestConfig params and API coverage to 62
1 parent 4b8afd9 commit c1c1130

4 files changed

Lines changed: 49 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,42 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [2.10.2] - 2026-04-14
9+
10+
### ✨ Added
11+
12+
- **broker compatibility** — Add `broker_profile` support (`auto/guosheng/dongguan/shanxi`) in backtest config and runtime context for broker-specific API behavior.
13+
- **api coverage** — Add/complete multiple PTrade-compatible APIs and aliases, including:
14+
- `get_trading_day_by_date`, `get_trend_data`, `get_reits_list`
15+
- `get_frequency`, `get_business_type`, `get_current_kline_count`, `filter_stock_by_status`
16+
- broker naming aliases: `get_margin_asset` / `get_margin_assert`, `get_individual_transcation` / `get_individual_transaction`
17+
- **snapshot guard** — Add broker API baseline snapshots and signature compatibility guard scripts.
18+
- **tests** — Add comprehensive unit test suite for API compatibility, lifecycle, order processor, object model, cache, and broker profile behavior.
19+
20+
### 🔧 Changed
21+
22+
- **market data API** — Refactor `get_price` / `get_history` with normalized frequency handling:
23+
- support minute aggregations (`5m/15m/30m/60m/120m`)
24+
- support period aggregations (`1w/mo/1q/1y`)
25+
- add minute-gap fill behavior for `fill='pre'`
26+
- align default history fields to include `price`
27+
- **release tooling** — Move release utilities from `scripts/` to `script/` and align release docs with the current CI auto-release workflow.
28+
- **docs** — Update PTrade API references, backtest support matrix, and broker compatibility docs.
29+
30+
### 🐛 Fixed
31+
32+
- **api contracts** — Fix multiple broker compatibility edge cases in API signatures/parameters and optional alias kwargs.
33+
- **order/position semantics** — Adjust T+1-related position and limit-check behavior to match expected test contracts.
34+
- **release guard path** — Fix API signature guard to read source from `src/simtradelab/ptrade/api.py`.
35+
36+
### 📦 Upgrade
37+
38+
```bash
39+
pip install --upgrade simtradelab==2.10.2
40+
```
41+
42+
---
43+
844
## [2.10.1] - 2026-03-26
945

1046
### 🐛 Fixed

README.de.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
**Kernfunktionen:**
2929

30-
-**46 APIs** — 100% Abdeckung für Aktien-Backtesting (Tages- und Minutenbalken)
30+
-**62 APIs** — 100% Abdeckung für Aktien-Backtesting (Tages- und Minutenbalken)
3131
-**100–160x schneller** als die PTrade-Plattform
3232
- 🚀 **In-Memory-Datenpersistenz** — Singleton-Muster, Start unter einer Sekunde nach dem ersten Laden
3333
- 💾 **Mehrstufiges Caching** — LRU-Caches für MA/VWAP/Anpassungsfaktoren/Historie, >95% Trefferquote
@@ -85,6 +85,7 @@ config = BacktestConfig(
8585
# --- Kapital & Markt ---
8686
# initial_capital=100000.0, # Startkapital (muss > 0 sein)
8787
# market='CN', # Markt: 'CN' (A-Aktien) | 'US'
88+
# broker_profile='auto', # Broker-API-Profil: 'auto' | 'guosheng' | 'dongguan' | 'shanxi'
8889
# t_plus_1=None, # T+1-Override: None=Marktstandard (CN=True, US=False)
8990
# benchmark_code='', # Benchmark-Code, leer=Marktstandard
9091

@@ -108,6 +109,7 @@ config = BacktestConfig(
108109
# --- Sandbox & i18n ---
109110
# sandbox=True, # PTrade-Sandbox: Import- & Builtin-Beschränkungen
110111
# locale='auto', # Log-Sprache: 'zh' | 'en' | 'de' (auto: CN-Markt→zh, sonst Systemsprache)
112+
# optimization_mode=False, # Optimierungsmodus: Validierung/Datenanalyse/Log-Setup überspringen (vom Optimierer gesteuert)
111113

112114
# --- Einstiegsdatei ---
113115
# strategy_file='backtest.py', # Einstiegsdatei: 'backtest.py' | 'live.py'

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ English | [中文](README.zh-CN.md) | [Deutsch](README.de.md)
2121
|---|---|---|
2222
| Speed | **100–160x faster** | Baseline |
2323
| Startup | Sub-second (data persists in memory) | Minutes |
24-
| API Coverage | 46 backtest/research APIs | Full platform |
24+
| API Coverage | 62 backtest/research APIs | Full platform |
2525
| Strategy Porting | Zero code changes | Zero code changes |
2626
| Environment | Local, free, open-source | Cloud, licensed |
2727

2828
**Core capabilities:**
2929

30-
-**46 APIs** — 100% coverage of stock backtesting scenarios (daily & minute bars)
30+
-**62 APIs** — 100% coverage of stock backtesting scenarios (daily & minute bars)
3131
-**100–160x faster** than PTrade platform
3232
- 🚀 **In-memory data persistence** — singleton pattern, sub-second startup after first load
3333
- 💾 **Multi-level caching** — LRU caches for MA/VWAP/adjustment factors/history, >95% hit rate
@@ -85,6 +85,7 @@ config = BacktestConfig(
8585
# --- Capital & Market ---
8686
# initial_capital=100000.0, # Starting capital (must be > 0)
8787
# market='CN', # Market: 'CN' (A-shares) | 'US'
88+
# broker_profile='auto', # Broker API profile: 'auto' | 'guosheng' | 'dongguan' | 'shanxi'
8889
# t_plus_1=None, # T+1 override: None=market default (CN=True, US=False)
8990
# benchmark_code='', # Benchmark code, empty=market default
9091

@@ -108,6 +109,7 @@ config = BacktestConfig(
108109
# --- Sandbox & i18n ---
109110
# sandbox=True, # PTrade sandbox: restrict imports & builtins
110111
# locale='auto', # Log language: 'zh' | 'en' | 'de' (auto: CN market→zh, else system locale)
112+
# optimization_mode=False, # Optimization mode: skip strategy validation/data analysis/logging setup
111113

112114
# --- Entry file ---
113115
# strategy_file='backtest.py', # Entry file: 'backtest.py' | 'live.py'
@@ -120,7 +122,7 @@ report = runner.run(config=config)
120122

121123
## 📚 API Overview
122124

123-
46 backtest/research APIs — 100% stock backtesting coverage.
125+
62 backtest/research APIs — 100% stock backtesting coverage.
124126

125127
| Category | APIs |
126128
|----------|------|

README.zh-CN.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121
|---|---|---|
2222
| 速度 | **快100–160倍** | 基准 |
2323
| 启动 | 亚秒级(数据常驻内存) | 分钟级 |
24-
| API覆盖 | 46个回测/研究API | 全平台 |
24+
| API覆盖 | 62个回测/研究API | 全平台 |
2525
| 策略迁移 | 零代码修改 | 零代码修改 |
2626
| 运行环境 | 本地、免费、开源 | 云端、授权 |
2727

2828
**核心能力:**
2929

30-
-**46个API** — 股票日/分钟线回测场景100%覆盖
30+
-**62个API** — 股票日/分钟线回测场景100%覆盖
3131
-**100-160倍性能提升** — 本地回测比PTrade平台快100-160倍
3232
- 🚀 **数据常驻内存** — 单例模式,首次加载后常驻,二次运行秒级启动
3333
- 💾 **多级智能缓存** — LRU缓存(MA/VWAP/复权/历史数据),命中率>95%
@@ -85,6 +85,7 @@ config = BacktestConfig(
8585
# --- 资金与市场 ---
8686
# initial_capital=100000.0, # 初始资金(必须 > 0)
8787
# market='CN', # 市场: 'CN'(A股) | 'US'(美股)
88+
# broker_profile='auto', # 券商API口径: 'auto' | 'guosheng' | 'dongguan' | 'shanxi'
8889
# t_plus_1=None, # T+1覆盖: None=市场默认(CN=True, US=False)
8990
# benchmark_code='', # 基准代码,空串=市场默认基准
9091

@@ -108,6 +109,7 @@ config = BacktestConfig(
108109
# --- 沙箱与国际化 ---
109110
# sandbox=True, # PTrade沙箱模式: 限制import和内置函数
110111
# locale='auto', # 日志语言: 'zh' | 'en' | 'de'(自动:CN市场→zh,其他→系统语言)
112+
# optimization_mode=False, # 优化模式: 跳过策略校验/数据分析/日志配置(由优化器管理)
111113

112114
# --- 入口文件 ---
113115
# strategy_file='backtest.py', # 入口文件: 'backtest.py' | 'live.py'
@@ -120,7 +122,7 @@ report = runner.run(config=config)
120122

121123
## 📚 API 概览
122124

123-
46个回测/研究API — 股票回测场景100%覆盖。
125+
62个回测/研究API — 股票回测场景100%覆盖。
124126

125127
| 类别 | API |
126128
|------|-----|

0 commit comments

Comments
 (0)