Skip to content

LeoYeAI/agent-master-skills / skills/backtrader

backtrader

Verified

Backtrader 开源量化回测框架 - 支持多数据源、多策略、多周期回测与实盘交易,纯Python实现。

FileKindSize
QUICK_REFERENCE.mdmarkdown2.4 KB
README.mdmarkdown2.7 KB
SKILL.mdskill md19.5 KB
_meta.jsonconfig628 B
demo_project/README.mdmarkdown347 B
demo_project/demo.pyscript545 B
metadata.jsonconfig621 B
requirements.txtmanifest36 B

demo_project/demo.py

View on GitHub
import backtrader as bt

class DummyStrategy(bt.Strategy):
    def next(self):
        pass

def main():
    print("🤖 Backtrader 实际回测引擎演示")
    try:
        cerebro = bt.Cerebro()
        cerebro.addstrategy(DummyStrategy)
        print("✅ 成功初始化 Cerebro 引擎并加载了测试策略。")
        print("您可以继续使用 cerebro.adddata() 加载数据,然后调用 cerebro.run() 执行回测。")
    except Exception as e:
        print(f"❌ 初始化失败: {e}")

if __name__ == "__main__":
    main()
receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementationStars: 322kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 322kUpdated Claude CodeCodexVerifiedInstall
using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallbackStars: 322kUpdated Claude CodeCodexVerifiedInstall
verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions alwaysStars: 322kUpdated Claude CodeCodexVerifiedInstall