Backtrader 事件回测

Backtrader 事件回测:运行经典双均线交叉策略回测,事件驱动模拟信号生成与持仓,输出 PyFolio 绩效报告。 含 25 条反模式约束。

✓ 0 人报告成功·v0.1.0·

晶体简介

运行经典双均线交叉策略回测,事件驱动模拟信号生成与持仓,输出 PyFolio 绩效报告。 本 skill 基于开源项目构建并集成 25 条 anti-pattern 约束。访问 doramagic.ai/r/backtrader-event-driven 查看中英双语完整文档和触发场景。适用于 Doramagic 生态(Claude Code / Cursor / openclaw / ChatGPT / Gemini 等)。

Blueprint Source

finance-bp-086

zvtvz/zvt6360a632 source files

Constraints

55total
30fatal
30 must-not-violate

Evidence Quality

Confidence88%

Medium confidence — review before critical use

30 条不可违反的约束

FATALarchitecture_guardrailfinance-C-001

WHENWhen implementing a CSV data feed

ACTIONoverride _loadline method to parse tokens into OHLCV values

CONSEQUENCECSV data feed will fail to parse any market data because _loadline is the only hook for subclasses to implement token-to-value conversion, causing the entire backtest to receive no price data

FATALdomain_rulefinance-C-002

WHENWhen parsing datetime strings from CSV

ACTIONuse the exact dtformat parameter matching the source file format

CONSEQUENCEDatetime parsing will raise ValueError at runtime when the format string doesn't match the actual date format in the CSV file, causing data loading to fail silently or crash the entire backtest

FATALdomain_rulefinance-C-003

WHENWhen configuring data feed column indices

ACTIONverify CSV column indices match the actual column positions in the file

CONSEQUENCEOHLCV values will be assigned to wrong lines or raise IndexError when column indices don't align with the actual CSV structure, producing garbage data in indicators and trading signals

常见问题

讨论 (0)

暂无讨论,成为第一个发言的人吧!

更新历史

v0.1.02026-04-23·贡献者: tangweigang-jpg

v0.1.0: 首次发布到 Doramagic.ai。基于 zvtvz/zvt 的自动化 batch-v1 元数据 + 自动生成 FAQ。